This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] for PR 18040
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: rakdver at atrey dot karlin dot mff dot cuni dot cz, gcc-patches at gcc dot gnu dot org
- Date: Sun, 17 Oct 2004 15:46:08 -0400
- Subject: Re: [patch] for PR 18040
- References: <10410171944.AA00989@vlsi1.ultra.nyu.edu>
On Sun, 2004-10-17 at 15:44 -0400, Richard Kenner wrote:
> is_gimple_addressable uses handled_component_p to determine whether its
> operand is a component reference. However handled_component_p allows
> also NOP_EXPRs and CONVERT_EXPRs. This in turn makes SRA believe that
> ((cast) var).field is valid gimple (since "(cast) var" passes
> is_gimple_addressable), which causes crash later.
>
> Can you explain this more? I very much think it's going in the wrong
> direction to not use handled_component_p. If we don't want to view a
> an expression as being a component that's handled, we should change
> handled_component_p. But right now, what you show above in valid GIMPLE.
> Perhaps there's a bug elsewehre.
--
((cast)var).field is not valid gimple.
Casts must be in a statement by themselves, unless the argument is
is_gimple_min_invariant.
IE (cast)(var.field) would be legal if var.field passes
is_gimple_min_invariant, however ((cast)var).field is not valid gimple
ever.
--Dan