This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] for PR 18040
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 17 Oct 2004 21:46:15 +0200
- Subject: Re: [patch] for PR 18040
- References: <10410171944.AA00989@vlsi1.ultra.nyu.edu>
Hello,
> 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.
no, it is not valid gimple, since it does not match grammar as
described in documentation. Also considering "(cast) something"
to be addressable is a bit weird by itself.
Of course feel free to propose to extend gimple for this if you think it
would be useful; handling the no-op casts in addresses would not be a
problem from optimizations point of view.
Zdenek