From 45bb3afb87036bd243b1f096b9371e9785b0841c Mon Sep 17 00:00:00 2001 From: rguenth Date: Sun, 3 May 2009 19:57:32 +0000 Subject: 2009-05-03 Richard Guenther 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 --- gcc/c-gimplify.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'gcc/c-gimplify.c') 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; } -- cgit v1.2.1