summaryrefslogtreecommitdiff
path: root/gcc/c-gimplify.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-gimplify.c
parent9225ad443de481ff86104f12ce94de205d12b28d (diff)
downloadgcc-45bb3afb87036bd243b1f096b9371e9785b0841c.tar.gz
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-gimplify.c')
-rw-r--r--gcc/c-gimplify.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c
index a361e904b93..9cb4a0b2d17 100644
--- a/gcc/c-gimplify.c
+++ b/gcc/c-gimplify.c
@@ -196,20 +196,5 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
&& !warn_init_self)
TREE_NO_WARNING (DECL_EXPR_DECL (*expr_p)) = 1;
- /* The C frontend is the only one producing &ARRAY with pointer-to-element
- type. This is invalid in gimple, so produce a properly typed
- ADDR_EXPR instead and wrap a conversion around it. */
- if (code == ADDR_EXPR
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (*expr_p, 0))) == ARRAY_TYPE
- && !lang_hooks.types_compatible_p (TREE_TYPE (TREE_TYPE (*expr_p)),
- TREE_TYPE (TREE_OPERAND (*expr_p, 0))))
- {
- tree type = TREE_TYPE (*expr_p);
- TREE_TYPE (*expr_p)
- = build_pointer_type (TREE_TYPE (TREE_OPERAND (*expr_p, 0)));
- *expr_p = build1 (NOP_EXPR, type, *expr_p);
- return GS_OK;
- }
-
return GS_UNHANDLED;
}