This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/34386] -Wstrict-aliasing=3 ineffective (tree-ssa-alias-warnings.c)
- From: "mueller at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Dec 2007 12:55:50 -0000
- Subject: [Bug middle-end/34386] -Wstrict-aliasing=3 ineffective (tree-ssa-alias-warnings.c)
- References: <bug-34386-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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