From 333a5daee532cfa73071c8b399afa4fcffc2289c Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Fri, 28 Oct 1994 16:24:27 -0700 Subject: In the case of {[LO .. HI] = VALUE}, only evaluate VALUE once. From-SVN: r8358 --- gcc/c-typeck.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc') 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. */ -- cgit v1.1