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


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


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