gcc/
2017-08-24 Yvan Roux <yvan.roux@linaro.org>
Backport from mainline
2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR c++/80287
* class.c (fixup_may_alias): Fix all type variants.
gcc/testsuite
2017-08-24 Yvan Roux <yvan.roux@linaro.org>
Backport from mainline
2017-08-22 Yvan Roux <yvan.roux@linaro.org>
PR c++/80287
* g++.dg/pr8028.C: New test.
From-SVN: r251331
+2017-08-24 Yvan Roux <yvan.roux@linaro.org>
+
+ Backport from mainline
+ 2017-04-17 Bernd Edlinger <bernd.edlinger@hotmail.de>
+
+ PR c++/80287
+ * class.c (fixup_may_alias): Fix all type variants.
+
2017-08-22 Peter Bergner <bergner@vnet.ibm.com>
Backport from mainline
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
+2017-08-24 Yvan Roux <yvan.roux@linaro.org>
+
+ Backport from mainline
+ 2017-08-22 Yvan Roux <yvan.roux@linaro.org>
+
+ PR c++/80287
+ * g++.dg/pr8028.C: New test.
+
2017-08-22 Peter Bergner <bergner@vnet.ibm.com>
Backport from mainline
--- /dev/null
+// PR c++/80287
+// { dg-do compile { target c++11 } }
+// { dg-options "-g" }
+
+struct A {
+ operator long() {}
+} __attribute__((__may_alias__));
+
+struct {
+ A ino;
+} a;
+
+char b = a.ino;