+2016-03-04 Richard Biener <rguenther@suse.de>
+
+ PR c++/70054
+ * c-common.c (strict_aliasing_warning): Use alias_set_subset_of
+ instead of alias_sets_conflict_p.
+
2016-03-01 Marek Polacek <polacek@redhat.com>
PR c++/69795
alias_set_type set2 = get_alias_set (TREE_TYPE (type));
if (set1 != set2 && set2 != 0
- && (set1 == 0 || !alias_sets_conflict_p (set1, set2)))
+ && (set1 == 0 || !alias_set_subset_of (set2, set1)))
{
warning (OPT_Wstrict_aliasing, "dereferencing type-punned "
"pointer will break strict-aliasing rules");
+2016-03-04 Richard Biener <rguenther@suse.de>
+
+ PR c++/70054
+ * g++.dg/warn/Wstrict-aliasing-bogus-union-2.C: New testcase.
+ * gcc.dg/Wstrict-aliasing-struct-member.c: New testcase.
+
2016-03-04 Dominik Vogt <vogt@linux.vnet.ibm.com>
PR testsuite/69766
--- /dev/null
+/* { dg-do compile { target c++11 } } */
+/* { dg-options "-Wstrict-aliasing=2 -O2 -Wall" } */
+
+#include <type_traits>
+
+struct foo
+{
+ std::aligned_storage<sizeof(long), alignof(long)>::type raw;
+
+ long& cooked()
+ {
+ return *static_cast<long*>(static_cast<void*>(&raw)); /* { dg-bogus "strict-aliasing" } */
+ }
+};
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wall" } */
+
+struct S { int i; long l; };
+long x;
+struct S foo () { return *(struct S *)&x; } /* { dg-warning "will break strict-aliasing" } */