This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/23585] [4.0 regression] mem_fun* code fine with -O1, bus error with -O2
- From: "pinskia at physics dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Oct 2005 13:55:01 -0000
- Subject: [Bug rtl-optimization/23585] [4.0 regression] mem_fun* code fine with -O1, bus error with -O2
- References: <bug-23585-11161@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from pinskia at gcc dot gnu dot org 2005-10-11 13:55 -------
Subject: Re: [4.0 regression] mem_fun* code fine with -O1, bus error with -O2
On Oct 11, 2005, at 9:51 AM, ebotcazou at gcc dot gnu dot org wrote:
>
>
> ------- Comment #8 from ebotcazou at gcc dot gnu dot org 2005-10-11
> 13:51 -------
>> Yes, I think the problem is in delay slot scheduling too. COND_EXPR
>> means that
>> either branch must not be evaluated because it could be illegal; if
>> you hoist a
>> mem from a branch into the delay slot of the condition, you are
>> effectively
>> partially evaluting the branch.
>
> Yes, that makes sense. At the moment the predicate used in reorg.c is
> may_trap_p so we would need to detect faulting instructions too.
may_trap_p is the correct thing as it should detect this instruction as
trapping:
/* Memory ref can trap unless it's a static var or a stack slot.
*/
case MEM:
if (MEM_NOTRAP_P (x))
return 0;
return rtx_addr_can_trap_p (XEXP (x, 0));
-- Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23585