[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 Paolo Carlini changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #13 from Paolo Carlini --- This can be closed, right?
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 --- Comment #12 from Aldy Hernandez --- Author: aldyh Date: Wed Sep 13 17:19:29 2017 New Revision: 252528 URL: https://gcc.gnu.org/viewcvs?rev=252528&root=gcc&view=rev Log: 2017-08-22 Yvan Roux PR c++/80287 * g++.dg/pr80287.C: New test. Added: branches/range-gen2/gcc/testsuite/g++.dg/pr80287.C Modified: branches/range-gen2/gcc/testsuite/ChangeLog
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 --- Comment #11 from Yvan Roux --- Author: yroux Date: Thu Aug 24 13:20:22 2017 New Revision: 251331 URL: https://gcc.gnu.org/viewcvs?rev=251331&root=gcc&view=rev Log: PR c++/80287 C++ crash with __attribute((may_alias)) gcc/ 2017-08-24 Yvan Roux Backport from mainline 2017-04-17 Bernd Edlinger PR c++/80287 * class.c (fixup_may_alias): Fix all type variants. gcc/testsuite 2017-08-24 Yvan Roux Backport from mainline 2017-08-22 Yvan Roux PR c++/80287 * g++.dg/pr8028.C: New test. Added: branches/gcc-6-branch/gcc/testsuite/g++.dg/pr80287.C Modified: branches/gcc-6-branch/gcc/ChangeLog branches/gcc-6-branch/gcc/cp/class.c branches/gcc-6-branch/gcc/testsuite/ChangeLog
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 --- Comment #10 from Yvan Roux --- Author: yroux Date: Tue Aug 22 10:51:52 2017 New Revision: 251273 URL: https://gcc.gnu.org/viewcvs?rev=251273&root=gcc&view=rev Log: 2017-08-22 Yvan Roux Backport from mainline 2017-08-22 Yvan Roux PR c++/80287 * g++.dg/pr80287.C: New test. Added: branches/gcc-7-branch/gcc/testsuite/g++.dg/pr80287.C Modified: branches/gcc-7-branch/gcc/testsuite/ChangeLog
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 --- Comment #9 from Yvan Roux --- Author: yroux Date: Tue Aug 22 09:32:38 2017 New Revision: 251268 URL: https://gcc.gnu.org/viewcvs?rev=251268&root=gcc&view=rev Log: 2017-08-22 Yvan Roux PR c++/80287 * g++.dg/pr80287.C: New test. Added: trunk/gcc/testsuite/g++.dg/pr80287.C Modified: trunk/gcc/testsuite/ChangeLog
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 --- Comment #8 from Yvan Roux --- OK, I'll submit a patch to add this second testcase on trunk and then only include it in the backport on GCC 6. Thanks
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 --- Comment #7 from Bernd Edlinger --- Hmm, yes, maybe having a second test case without C++17 would be fine.
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 --- Comment #6 from Yvan Roux --- Hi, I got a small issue when testing the backport into the branch: g++.dg/lto/pr80287_0.C is not a suitable testcase for GCC 6 branch, since it uses c++17 class std:any which is not available in GCC 6. In the first place this bug was found when building libstdc++-v3/testsuite/20_util/any/assign/2.cc, but it is not related to std:any, I found it on my side in ceph package build, and the issue is exhibited when compiling this reduced testcase with -g: struct A { operator long() {} } __attribute__((__may_alias__)); struct { A ino; } a; char b = a.ino; So, I wonder what is the best way to handle that, adding this new testcase on trunk as g++.dg/pr80287.C and only backport this one into GCC 6, or avoid std:any usage into g++.dg/lto/pr80287_0.C ?
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 --- Comment #5 from Bernd Edlinger --- (In reply to Yvan Roux from comment #4) > Hi Bernd, > > gcc-6-branch is impacted by this issue (observed on AArch64 target at > r250109, with regression introduced at r234768). I can prepare the backport > if you whish. Yes, thanks, go ahead.
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 Yvan Roux changed: What|Removed |Added CC||yroux at gcc dot gnu.org --- Comment #4 from Yvan Roux --- Hi Bernd, gcc-6-branch is impacted by this issue (observed on AArch64 target at r250109, with regression introduced at r234768). I can prepare the backport if you whish.
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 --- Comment #3 from Bernd Edlinger --- fixed on trunk. It's theoretically possible that gcc-6-branch is also affected, but I have not tried.
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 --- Comment #2 from Bernd Edlinger --- Author: edlinger Date: Mon Apr 17 20:41:40 2017 New Revision: 246955 URL: https://gcc.gnu.org/viewcvs?rev=246955&root=gcc&view=rev Log: 017-04-17 Bernd Edlinger PR c++/80287 * class.c (fixup_may_alias): Fix all type variants. gcc/testsuite 2017-04-17 Bernd Edlinger PR c++/80287 * g++.dg/lto/pr80287_0.C: New test. Added: trunk/gcc/testsuite/g++.dg/lto/pr80287_0.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/class.c trunk/gcc/testsuite/ChangeLog
[Bug c++/80287] C++ crash with __attribute((may_alias))
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80287 --- Comment #1 from Bernd Edlinger --- good news is, I already have a patch: Index: gcc/cp/class.c === --- gcc/cp/class.c (revision 246605) +++ gcc/cp/class.c (working copy) @@ -2060,12 +2060,14 @@ static void fixup_may_alias (tree klass) { - tree t; + tree t, v; for (t = TYPE_POINTER_TO (klass); t; t = TYPE_NEXT_PTR_TO (t)) -TYPE_REF_CAN_ALIAS_ALL (t) = true; +for (v = TYPE_MAIN_VARIANT (t); v; v = TYPE_NEXT_VARIANT (v)) + TYPE_REF_CAN_ALIAS_ALL (v) = true; for (t = TYPE_REFERENCE_TO (klass); t; t = TYPE_NEXT_REF_TO (t)) -TYPE_REF_CAN_ALIAS_ALL (t) = true; +for (v = TYPE_MAIN_VARIANT (t); v; v = TYPE_NEXT_VARIANT (v)) + TYPE_REF_CAN_ALIAS_ALL (v) = true; } /* Early variant fixups: we apply attributes at the beginning of the class