[Bug middle-end/82899] *this in constructors could not alias with reference input parameters of the same type

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Nov 8 12:43:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82899

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |alias, missed-optimization
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Would it be valid to make 'this' __restrict?  Is it valid to do

struct X { int i; };
struct Y : X { Y(Y *); int k; };

Y::Y(Y *x)
{
  k = x->i;
}

int main()
{
  Y y(&y);
}

?  That is, access members of the base class which should be initialized
already?
This would mean using __restrict isn't valid.


More information about the Gcc-bugs mailing list