------- Comment #3 from amylaar at gcc dot gnu dot org  2006-09-11 19:50 -------
(In reply to comment #2)
> Please provide a testcase as well as the other required bits of info.
> 

This is a stripped down cc1plus testcase:

void
f (unsigned char *a, int &i)
{
  i = a[0] << 8 & a[1];
}

This doesn't actually trigger the 'global variable' part, but distribute_notes
fails to see that there is a set because it looks at PATTERN (tem), when it
should be looking at tem, and thus fails to see a REG_INC note.
The invalid REG_DEAD note triggered an ICE during sched1 with a 4.1.1 based
compiler with ENABLE_CHECKING set, compiling for sh4-elf with -O2
-fno-exceptions.

I can replicate the invalid REG_DEAD note with vanilla 4.1-2006-03-21,
although of course it won't ICE, since checking is disabled.

This insn appears in the combine dump:

(insn 13 8 14 0 (set (reg:QI 162)
        (mem:QI (post_inc:SI (reg/v/f:SI 159 [ a ])) [0 S1 A8])) 182 {movqi_i}
(
insn_list:REG_DEP_TRUE 6 (nil))
    (expr_list:REG_UNUSED (reg:QI 162)
        (expr_list:REG_DEAD (reg/v/f:SI 159 [ a ])
            (expr_list:REG_INC (reg/v/f:SI 159 [ a ])
                (nil)))))

The testcase doesn't trigger with 4.2, but that's because we don't have
a post-increment in the same place; the distribute_notes code is still wrong
there.


-- 

amylaar at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|0000-00-00 00:00:00         |2006-09-11 19:50:45
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28965

Reply via email to