aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index ef31a32f54e..ffaaf2237a6 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -6484,7 +6484,8 @@ static
tree
fold (tree expr)
{
- const tree t = expr;
+ /* APPLE LOCAL altivec */
+ tree t = expr;
const tree type = TREE_TYPE (expr);
tree t1 = NULL_TREE;
tree tem;
@@ -6496,6 +6497,15 @@ fold (tree expr)
if all operands are constant. */
int wins = 1;
+ /* APPLE LOCAL begin AltiVec */
+ /* Fold constant comma expressions. */
+ while (TREE_CODE (t) == COMPOUND_EXPR && TREE_CONSTANT (t))
+ t = TREE_OPERAND (t, 1);
+
+ code = TREE_CODE (t);
+ kind = TREE_CODE_CLASS (code);
+ /* APPLE LOCAL end AltiVec */
+
/* Return right away if a constant. */
if (kind == tcc_constant)
return t;