This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/82899] *this in constructors could not alias with reference input parameters of the same type
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 08 Nov 2017 12:43:37 +0000
- Subject: [Bug middle-end/82899] *this in constructors could not alias with reference input parameters of the same type
- Auto-submitted: auto-generated
- References: <bug-82899-4@http.gcc.gnu.org/bugzilla/>
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.