[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 02:07:00 GMT 2007
------- Comment #3 from mueller at gcc dot gnu dot org 2007-12-08 02:07 -------
this patch seems to be an alternative way of making -Wstrict-aliasing=3 work
again for the testcase:
--- c-common.c (revision 130658)
+++ c-common.c (working copy)
@@ -1035,7 +1035,8 @@ strict_aliasing_warning (tree otype, tre
&& POINTER_TYPE_P (otype) && !VOID_TYPE_P (TREE_TYPE (type))))
return false;
- if ((warn_strict_aliasing > 1) && TREE_CODE (expr) == ADDR_EXPR
+ if ((warn_strict_aliasing > 1)
+ && (TREE_CODE (expr) == CONVERT_EXPR || TREE_CODE (expr) == ADDR_EXPR)
&& (DECL_P (TREE_OPERAND (expr, 0))
|| handled_component_p (TREE_OPERAND (expr, 0))))
{
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34386
More information about the Gcc-bugs
mailing list