------- Comment #14 from ubizjak at gmail dot com 2008-03-18 15:30 ------- (In reply to comment #12) > Uros: the problem isn't cse. It's already expand which creates broken code > (it reads from and writes to (mem (plus (virtual-incoming-regs) (4)). > But it does that only because the input tree is completely wrong (TER breaks > this).
Yes, looking a bit more into the expand dump, it looks that gcc tries to fix outgoing call stack by copying 'c' and 'd' into the position of 'listener' and 'b'. It accidentally overwrites 'listener' (and 'b', but this isn't used anywhere). The code would work OK if 'listener' would be copied to a temporary first. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35616