aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-05-03 19:57:32 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-05-03 19:57:32 +0000
commit255d3827b4ecd22efa38467bf52a9ee24f96afb5 (patch)
treec4e6b2079d241859aabc7e14a7760df92602eee4 /gcc/c-common.c
parent16c337707b0c71829fcad74fdc82d85b1f103eaf (diff)
downloadgcc-255d3827b4ecd22efa38467bf52a9ee24f96afb5.zip
gcc-255d3827b4ecd22efa38467bf52a9ee24f96afb5.tar.gz
gcc-255d3827b4ecd22efa38467bf52a9ee24f96afb5.tar.bz2
re PR c/39983 (ICE: type mismatch in address expression)
2009-05-03 Richard Guenther <rguenther@suse.de> PR c/39983 * c-typeck.c (array_to_pointer_conversion): Do not built ADDR_EXPRs of arrays of pointer-to-element type. * c-gimplify.c (c_gimplify_expr): Revert change fixing up wrong ADDR_EXPRs after-the-fact. * c-common.c (strict_aliasing_warning): Strip pointer conversions for obtaining the original type. * builtins.c (fold_builtin_memset): Handle array types. (fold_builtin_memory_op): Handle folded POINTER_PLUS_EXPRs and array types * gcc.c-torture/compile/pr39983.c: New testcase. From-SVN: r147083
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index d877c0f..ff8e83a 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1762,6 +1762,10 @@ warn_logical_operator (location_t location, enum tree_code code,
bool
strict_aliasing_warning (tree otype, tree type, tree expr)
{
+ /* Strip pointer conversion chains and get to the correct original type. */
+ STRIP_NOPS (expr);
+ otype = TREE_TYPE (expr);
+
if (!(flag_strict_aliasing
&& POINTER_TYPE_P (type)
&& POINTER_TYPE_P (otype)