summaryrefslogtreecommitdiffstats
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-03 19:57:32 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-03 19:57:32 +0000
commit45bb3afb87036bd243b1f096b9371e9785b0841c (patch)
treec4e6b2079d241859aabc7e14a7760df92602eee4 /gcc/c-common.c
parent9225ad443de481ff86104f12ce94de205d12b28d (diff)
downloadppe42-gcc-45bb3afb87036bd243b1f096b9371e9785b0841c.tar.gz
ppe42-gcc-45bb3afb87036bd243b1f096b9371e9785b0841c.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147083 138bc75d-0d04-0410-961f-82ee72b054a4
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 d877c0f8469..ff8e83afdc1 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)
OpenPOWER on IntegriCloud