Program: 133000
Project: 133000
Buggy source:
/** 
 * Do one iteration of the iterative optimizer passes
 * @param icOutput
 * @param logger
 * @param prog
 * @param debug 
 * @param iteration
 * @param nIterations
 * @throws Exception
 */
private static void iterate(PrintStream icOutput,Logger logger,Program prog,boolean debug,long nIterations) throws UserException {
  FunctionInline inliner=new FunctionInline();
  boolean canReorder=true;
  for (long iteration=0; iteration < nIterations; iteration++) {
    OptimizerPipeline pipe=new OptimizerPipeline(icOutput);
    if (SUPER_DEBUG) {
      pipe.setValidator(Validate.standardValidator());
    }
    pipe.addPass(inliner);
    pipe.addPass(new ConstantFold());
    if ((iteration % 3) == 2) {
      pipe.addPass(new LoopUnroller());
      pipe.addPass(Validate.standardValidator());
    }
    boolean lastHalf=iteration > nIterations * 2;
    if (canReorder) {
      pipe.addPass(new HoistLoops(lastHalf));
    }
    if (canReorder && (iteration % 2 == 1)) {
      pipe.addPass(new ReorderInstructions(lastHalf));
    }
    if (iteration == nIterations - 2) {
      canReorder=false;
    }
    pipe.addPass(new ForwardDataflow(!canReorder));
    pipe.addPass(new DeadCodeEliminator());
    pipe.addPass(new ContinuationFusion());
    if (iteration == nIterations - (nIterations / 4) - 1) {
      pipe.addPass(new Pipeline());
      if (debug)       pipe.addPass(Validate.standardValidator());
    }
    boolean doWaitMerges=iteration == nIterations - (nIterations / 4) - 2;
    pipe.addPass(new WaitCoalescer(doWaitMerges,canReorder));
    if (debug)     pipe.addPass(Validate.standardValidator());
    pipe.runPipeline(logger,prog,iteration);
  }
}

Fixed version (ground truth):
/** 
 * Do one iteration of the iterative optimizer passes
 * @param icOutput
 * @param logger
 * @param prog
 * @param debug 
 * @param iteration
 * @param nIterations
 * @throws Exception
 */
private static void iterate(PrintStream icOutput,Logger logger,Program prog,boolean debug,long nIterations) throws UserException {
  FunctionInline inliner=new FunctionInline();
  boolean canReorder=true;
  for (long iteration=0; iteration < nIterations; iteration++) {
    OptimizerPipeline pipe=new OptimizerPipeline(icOutput);
    if (SUPER_DEBUG) {
      pipe.setValidator(Validate.standardValidator());
    }
    pipe.addPass(inliner);
    pipe.addPass(new ConstantFold());
    if ((iteration % 3) == 2) {
      pipe.addPass(new LoopUnroller());
      pipe.addPass(Validate.standardValidator());
    }
    boolean lastHalf=iteration > nIterations * 2;
    if (canReorder) {
      pipe.addPass(new HoistLoops(lastHalf));
    }
    if (canReorder && (iteration % 2 == 1)) {
      pipe.addPass(new ReorderInstructions(lastHalf));
    }
    if (iteration == nIterations - 2) {
      canReorder=false;
    }
    pipe.addPass(new ForwardDataflow(canReorder));
    pipe.addPass(new DeadCodeEliminator());
    pipe.addPass(new ContinuationFusion());
    if (iteration == nIterations - (nIterations / 4) - 1) {
      pipe.addPass(new Pipeline());
      if (debug)       pipe.addPass(Validate.standardValidator());
    }
    boolean doWaitMerges=iteration == nIterations - (nIterations / 4) - 2;
    pipe.addPass(new WaitCoalescer(doWaitMerges,canReorder));
    if (debug)     pipe.addPass(Validate.standardValidator());
    pipe.runPipeline(logger,prog,iteration);
  }
}