[Bug middle-end/34386] -Wstrict-aliasing=3 ineffective (tree-ssa-alias-warnings.c)
mueller at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sat Dec 8 12:56:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list