This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/33638] [4.3 regression]: wrong code with -fforce-addr
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Oct 2007 19:58:53 -0000
- Subject: [Bug rtl-optimization/33638] [4.3 regression]: wrong code with -fforce-addr
- References: <bug-33638-9562@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #19 from ubizjak at gmail dot com 2007-10-06 19:58 -------
In dse.c, scan_insn(), we have:
if ((GET_CODE (PATTERN (insn)) == CLOBBER)
|| volatile_refs_p (PATTERN (insn))
|| (flag_non_call_exceptions && may_trap_p (PATTERN (insn)))
|| (RTX_FRAME_RELATED_P (insn))
|| find_reg_note (insn, REG_FRAME_RELATED_EXPR, NULL_RTX))
insn_info->cannot_delete = true;
And since the docs say that:
`RTX_FRAME_RELATED_P (X)'
Nonzero in an `insn', `call_insn', `jump_insn', `barrier', or
`set' which is part of a function prologue and sets the stack
pointer, sets the frame pointer, or saves a register. This flag
should also be set on an instruction that sets up a temporary
register to use in place of the frame pointer. Stored in the
`frame_related' field and printed as `/f'.
I wonder if the insn that stores to (or uses(?)) this temporary register (in
place of the frame pointer) should also be marked as frame related insn?
So, all the insns in the sequence of
set tmpreg, FP + const
...
store (tmpreg)
should be marked as frame related insns.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33638