------- Comment #7 from rguenth at gcc dot gnu dot org  2007-12-08 00:03 -------
Because the temporary object D.2360 is indeed artificial.  If you disable that
filtering you get (finally)

t.ii: In function 'const QString& staticQString(const QString&)':
t.ii:110: warning: likely type-punning may break strict-aliasing rules: object
'*{unknown}' of main type 'QHash<QString, bool>::const_iterator' is referenced
at or around t.ii:110 and may be aliased to object '{unknown}' of main type
'QHash<QString, bool>::iterator' which is referenced at or around t.ii:95.

For reference:

Index: tree-ssa-alias-warnings.c
===================================================================
--- tree-ssa-alias-warnings.c   (revision 130692)
+++ tree-ssa-alias-warnings.c   (working copy)
@@ -866,11 +866,6 @@ nonstandard_alias_p (tree ptr, tree alia
   if (var_ann (get_ssa_base (alias))->escape_mask != NO_ESCAPE)
     return false;

-  /* XXX: don't get into structures for now.  It brings much complication
-     and little benefit.  */
-  if (struct_class_union_p (ptr_type) || struct_class_union_p (alias_type))
-    return false;
-
   /* If they are both SSA names of artificials, let it go, the warning
      is too confusing.  */
   if (find_first_artificial_name (ptr) && find_first_artificial_name (alias))
@@ -923,7 +918,7 @@ dsa_named_for (tree ptr)

              if (nonstandard_alias_p (ptr, alias, false))
                strict_aliasing_warn (SSA_NAME_DEF_STMT (ptr),
-                                     ptr, true, alias, false, true);
+                                     ptr, true, alias, false, false);
            }
        }
     }


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34385

Reply via email to