[Bug middle-end/15054] [3.3/3.4/3.5 Regression] Bad code due to overlapping stack temporaries

uweigand at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Apr 22 14:44:00 GMT 2004


------- Additional Comments From uweigand at gcc dot gnu dot org  2004-04-22 13:46 -------
Why did you change the component to 'middle-end'?  The bug is already present
on the RTL level right after expand (this is on i386):

(insn 144 142 145 (parallel[
            (set (reg/v/f:SI 74)
                (plus:SI (reg/f:SI 54 virtual-stack-vars)
                    (const_int -32 [0xffffffe0])))
            (clobber (reg:CC 17 flags))
        ] ) -1 (nil)
    (nil))

(insn 156 153 158 (parallel[
            (set (reg/v/f:SI 75)
                (plus:SI (reg/f:SI 54 virtual-stack-vars)
                    (const_int -32 [0xffffffe0])))
            (clobber (reg:CC 17 flags))
        ] ) -1 (nil)
    (nil))

(insn 158 156 159 (set (reg/v/f:SI 76)
        (const_int 0 [0x0])) -1 (nil)
    (nil))

(insn 164 162 165 (set (mem/s/j:SI (reg/v/f:SI 75) [0 <variable>.ptr+0 S4 A32])
        (reg/v/f:SI 76)) -1 (nil)
    (nil))

(insn 169 167 170 (set (reg:CCZ 17 flags)
        (compare:CCZ (mem/s/j:SI (reg/v/f:SI 74) [0 <variable>.canary+0 S4 A32])
            (const_int 123 [0x7b]))) -1 (nil)
    (nil))

See how <variable>.ptr and <variable>.canary share the same stack slot?

That this is subsequently optimized away is only the logical conclusion,
and not a middle-end bug.  The bug is the overlapping stack slot assignment.

-- 


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



More information about the Gcc-bugs mailing list