Hi!

While bootstrapping the PR54519 patches last night, I've noticed a
comparison failure on i686-linux.  The problem was -g vs. -g0
swapping two instructions in tree-inline.o, caused by find_modifiable_mems
scanning [head, tail) instead of [head, tail] sequence of instructions.
Without -g0 on tree-inline.c we had a MEM load as last insn in a bb (i.e.
tail) which wasn't processed by find_modifiable_mems, while with -g
there were some DEBUG_INSNs after it and find_mems was called on it
and triggerring the optimization.

Fixed by scanning also the tail insn, the same way as other spots in
sched-deps.c handle [head, tail] walk.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2012-10-03  Jakub Jelinek  <ja...@redhat.com>

        PR rtl-optimization/54792
        * sched-deps.c (find_modifiable_mems): Scan also TAIL insn.

--- gcc/sched-deps.c.jj 2012-10-01 10:08:43.000000000 +0200
+++ gcc/sched-deps.c    2012-10-03 11:35:57.215589982 +0200
@@ -4816,10 +4816,10 @@ find_mem (struct mem_inc_info *mii, rtx
 void
 find_modifiable_mems (rtx head, rtx tail)
 {
-  rtx insn;
+  rtx insn, next_tail = NEXT_INSN (tail);
   int success_in_block = 0;
 
-  for (insn = head; insn != tail; insn = NEXT_INSN (insn))
+  for (insn = head; insn != next_tail; insn = NEXT_INSN (insn))
     {
       struct mem_inc_info mii;
 

        Jakub

Reply via email to