aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2005-11-28 10:00:55 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2005-11-28 10:00:55 +0000
commitbbee4b64682d27f5ea99df3654e3e1b139443e0e (patch)
tree218aa8d29f5907f93670f6494b5c844f7b4bd278 /gcc/c-common.c
parentd531830f5db3d08322202915d9b44572f410841e (diff)
downloadgcc-bbee4b64682d27f5ea99df3654e3e1b139443e0e.zip
gcc-bbee4b64682d27f5ea99df3654e3e1b139443e0e.tar.gz
gcc-bbee4b64682d27f5ea99df3654e3e1b139443e0e.tar.bz2
c-common.c (strict_aliasing_warning): Handle all component-ref like accesses.
2005-11-28 Richard Guenther <rguenther@suse.de> * c-common.c (strict_aliasing_warning): Handle all component-ref like accesses. * gcc.dg/alias-9.c: New testcase. * g++.dg/warn/Wstrict-aliasing-7.C: Likewise. From-SVN: r107598
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 82fe613..b416a5d 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -966,7 +966,7 @@ strict_aliasing_warning(tree otype, tree type, tree expr)
&& POINTER_TYPE_P (type) && POINTER_TYPE_P (otype)
&& TREE_CODE (expr) == ADDR_EXPR
&& (DECL_P (TREE_OPERAND (expr, 0))
- || TREE_CODE (TREE_OPERAND (expr, 0)) == COMPONENT_REF)
+ || handled_component_p (TREE_OPERAND (expr, 0)))
&& !VOID_TYPE_P (TREE_TYPE (type)))
{
/* Casting the address of an object to non void pointer. Warn