aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Bothner <bothner@gcc.gnu.org>1994-10-28 16:24:27 -0700
committerPer Bothner <bothner@gcc.gnu.org>1994-10-28 16:24:27 -0700
commit333a5daee532cfa73071c8b399afa4fcffc2289c (patch)
tree985fcf800578c3aa4523706af26bf18853d8bfe7
parent8be3ef7d1dd00285b28184b3906cf80574268b7a (diff)
downloadgcc-333a5daee532cfa73071c8b399afa4fcffc2289c.zip
gcc-333a5daee532cfa73071c8b399afa4fcffc2289c.tar.gz
gcc-333a5daee532cfa73071c8b399afa4fcffc2289c.tar.bz2
In the case of {[LO .. HI] = VALUE}, only evaluate VALUE once.
From-SVN: r8358
-rw-r--r--gcc/c-typeck.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 1a6713c..c40d08a 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -6168,6 +6168,10 @@ process_init_element (value)
break;
}
+ /* In the case of [LO .. HI] = VALUE, only evaluate VALUE once. */
+ if (constructor_range_end)
+ value = save_expr (value);
+
/* Now output the actual element.
Ordinarily, output once.
If there is a range, repeat it till we advance past the range. */