http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47427

--- Comment #3 from rguenther at suse dot de <rguenther at suse dot de> 
2011-01-24 12:59:58 UTC ---
On Mon, 24 Jan 2011, jakub at gcc dot gnu.org wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47427
> 
> Jakub Jelinek <jakub at gcc dot gnu.org> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |hubicka at gcc dot gnu.org,
>                    |                            |jakub at gcc dot gnu.org
> 
> --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-01-24 
> 12:50:47 UTC ---
> I think this is pretty much the same issue as PR47428, except in this case it
> is not a PHI in which such a replacement is made, but for y_9 = 0; given that 
> y
> is argument declared const the inliner replaces it with 1 = 0;.
> So perhaps the PR47428 patch isn't the right fix.

copyrename shouldn't do this (coalesce to TREE_READONLY vars - it also
doesn't seem to not coalesce to TREE_THIS_VOLATILE vars, though those
shouldn't be in SSA form).

> The reason why y_9 is on the LHS of a set is copyrename.  I guess a fix could
> be either not doing copyrename if an SSA_NAME of a TREE_READONLY var would be
> on the LHS of an assignment or result of a PHI, or drop the TREE_READONLY from
> the parameter in such a case (but that would result in us dropping such info 
> in
> debug info), or avoid the optimization
>   /* If the parameter is never assigned to, has no SSA_NAMEs created,
>      we would not need to create a new variable here at all, if it
>      weren't for debug info.  Still, we can just use the argument
>      value.  */
>   if (TREE_READONLY (p)
>       ...
> in setup_one_parameter.
> 
> Richard/Honza, what do you think?

Fix copyrename.

Richard.

Reply via email to