https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80593
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Status|UNCONFIRMED |NEW Last reconfirmed| |2017-05-02 Target Milestone|--- |7.2 Summary|GCC 7, aligned_storage and |[7/8 Regression] GCC 7, |“dereferencing type-punned |aligned_storage and |pointer will break |“dereferencing type-punned |strict-aliasing rules” |pointer will break | |strict-aliasing rules” Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. This likely regressed with the introduction of TYPE_TYPELESS_STORAGE which aligned_storage now is, and thus 'storage' gets alias-set zero itself running into /* warn_strict_aliasing >= 3. This includes the default (3). Only warn if the cast is dereferenced immediately. */ alias_set_type set1 = get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0))); alias_set_type set2 = get_alias_set (TREE_TYPE (type)); if (set1 != set2 && set2 != 0 && (set1 == 0 || (!alias_set_subset_of (set2, set1) && !alias_sets_conflict_p (set1, set2)))) { warning (OPT_Wstrict_aliasing, "dereferencing type-punned " "pointer will break strict-aliasing rules"); return true; with set1 == 0.