[patch] Reuse non-gimple_reg variable for inlining

Richard Biener rguenther@suse.de
Thu Jun 10 06:44:46 GMT 2021


On Wed, 9 Jun 2021, Eric Botcazou wrote:

> > I'm afraid the inliner would need to prove the to be inlined callee doesn't
> > modify its own copy of the variable too, because if it modifies it (at least
> > in C/C++ const can be cast away), then this introduces wrong-code, see
> > PR100994 for details.
> 
> Then please remove the TREE_READONLY marker in C/C++ if this is a lie.

I agree the cases are invalid C/C++ - this isn't casting away
const qualification of a pointed to type but of an object and storing
into a readonly object at least invokes undefined behavior.  It
might even be allowed to diagnose it as error.

Richard.


More information about the Gcc-patches mailing list