This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/34386] -Wstrict-aliasing=3 ineffective (tree-ssa-alias-warnings.c)



------- Comment #5 from mueller at gcc dot gnu dot org  2007-12-08 12:55 -------
this seems to be readding the warning with relatively low false positive rate
(e.g. didn't find a false one yet). 

--- cp/typeck.c (revision 130658)
+++ cp/typeck.c (working copy)
@@ -5269,11 +5268,16 @@ build_reinterpret_cast_1 (tree type, tre

       expr = build_unary_op (ADDR_EXPR, expr, 0);
       if (expr != error_mark_node)
-       expr = build_reinterpret_cast_1
-         (build_pointer_type (TREE_TYPE (type)), expr, c_cast_p,
-          valid_p);
-      if (expr != error_mark_node)
-       expr = build_indirect_ref (expr, 0);
+        {
+         if (strict_aliasing_warning (intype, type, expr))
+               TREE_NO_WARNING (expr) = 1;
+
+         expr = build_reinterpret_cast_1
+           (build_pointer_type (TREE_TYPE (type)), expr, c_cast_p,
+            valid_p);
+          if (expr != error_mark_node)
+           expr = build_indirect_ref (expr, 0);
+        }
       return expr;
     }


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]