From c377133d644be373832849ad8990b3192119e096 Mon Sep 17 00:00:00 2001 From: neil Date: Sun, 6 May 2001 16:38:56 +0000 Subject: [PATCH] * c-typeck.c (internal_build_compound_expr): Check for array to pointer conversion just once. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41879 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/c-typeck.c | 12 ++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c8f3f0a..5d65f15 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-05-06 Neil Booth + + * c-typeck.c (internal_build_compound_expr): Check for + array to pointer conversion just once. + 2001-05-05 Richard Henderson * integrate.c (copy_insn_list): Substitute NOTE_EXPECTED_VALUE. diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index f05422c..33ac116 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -3644,6 +3644,10 @@ internal_build_compound_expr (list, first_p) if (TREE_CHAIN (list) == 0) { + /* Convert arrays to pointers when there really is a comma operator. */ + if (!first_p && TREE_CODE (TREE_TYPE (TREE_VALUE (list))) == ARRAY_TYPE) + TREE_VALUE (list) = default_conversion (TREE_VALUE (list)); + #if 0 /* If something inside inhibited lvalueness, we should not override. */ /* Consider (x, y+0), which is not an lvalue since y+0 is not. */ @@ -3658,14 +3662,6 @@ internal_build_compound_expr (list, first_p) return TREE_VALUE (list); } - if (TREE_CHAIN (list) != 0 && TREE_CHAIN (TREE_CHAIN (list)) == 0) - { - /* Convert arrays to pointers when there really is a comma operator. */ - if (TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (list)))) == ARRAY_TYPE) - TREE_VALUE (TREE_CHAIN (list)) - = default_conversion (TREE_VALUE (TREE_CHAIN (list))); - } - rest = internal_build_compound_expr (TREE_CHAIN (list), FALSE); if (! TREE_SIDE_EFFECTS (TREE_VALUE (list))) -- 2.7.4