aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-05-06 16:38:56 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-05-06 16:38:56 +0000
commit714a0864cc92b27ba75cff579b33a44702556ad3 (patch)
treed9e21764e236cc2733340797bd3eff491099c76b /gcc/c-typeck.c
parent7026707d152f30b0615dd3c6eabd62bedd5c30a4 (diff)
downloadgcc-714a0864cc92b27ba75cff579b33a44702556ad3.zip
gcc-714a0864cc92b27ba75cff579b33a44702556ad3.tar.gz
gcc-714a0864cc92b27ba75cff579b33a44702556ad3.tar.bz2
c-typeck.c (internal_build_compound_expr): Check for array to pointer conversion just once.
* c-typeck.c (internal_build_compound_expr): Check for array to pointer conversion just once. From-SVN: r41879
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index f05422c..33ac1169 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)))