This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] for PR 18040


On Sun, 2004-10-17 at 21:46 +0200, Zdenek Dvorak wrote:
> 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.

Except then the optimizers would have to start breaking apart
expressions and stripping off nops again where they didn't matter,
wouldn't they?
Right now the only time you see a nop_expr is at the top level of a RHS.
Changing gimple to allow casts in any other part of the tree is a very
bad idea, IMHO.



> 
> Zdenek
-- 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]