------- Additional Comments From rguenth at gcc dot gnu dot org 2005-09-05
10:36 -------
Pinskias patch fixes one part of the problem. For x86 there remains the
issue that we are passing X on the stack and generate
_Z8call_foov:
.LFB2:
subl $26, %esp
.LCFI4:
pushw %ax
.LCFI5:
.LCFI6:
call _Z3foo1X
addl $28, %esp
ret
which is correct, but I wonder where we figure out to use %ax as source
for the tmp X. Also no RTL optimizer sees that the pushw %ax can be
safely combined with the stack adjust before because the contents of %ax
are unknown and we don't care about what value we pass on the stack.
The call expander produces
(insn 9 8 10 1 (parallel [
(set (reg/f:SI 7 sp)
(plus:SI (reg/f:SI 7 sp)
(const_int -2 [0xfffffffe])))
(clobber (reg:CC 17 flags))
]) -1 (nil)
(nil))
(insn 10 9 11 1 (set (mem/s:QI (pre_modify:SI (reg/f:SI 7 sp)
(plus:SI (reg/f:SI 7 sp)
(const_int -2 [0xfffffffe]))) [0 S1 A8])
(reg:QI 58 [ D.1755 ])) -1 (nil)
(nil))
(call_insn 11 10 12 1 (call (mem:QI (symbol_ref:SI ("_Z3foo1X") [flags 0x41]
<function_decl 0x40230e00 foo>) [0 S1 A8])
(const_int 16 [0x10])) -1 (nil)
(nil)
(nil))
where it should not use reg 58 as the source to push, but rather
the stack slot we assigned to the D.1755 tmp.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20408