aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMike Stump <mrs@gcc.gnu.org>1996-05-06 18:07:22 +0000
committerMike Stump <mrs@gcc.gnu.org>1996-05-06 18:07:22 +0000
commit7b8b9722a4c9b7789d3d1bfcc12f23d49eb0b1bf (patch)
treeb02b475ce4ade84a787e519042726486a6b36068 /gcc
parent405f0da64e8d6ca359de9ea35e56c6f0149a15e2 (diff)
downloadgcc-7b8b9722a4c9b7789d3d1bfcc12f23d49eb0b1bf.zip
gcc-7b8b9722a4c9b7789d3d1bfcc12f23d49eb0b1bf.tar.gz
gcc-7b8b9722a4c9b7789d3d1bfcc12f23d49eb0b1bf.tar.bz2
expr.c (expand_increment): Add third parameter to know when to ignore the result value.
* expr.c (expand_increment): Add third parameter to know when to ignore the result value. (store_constructor): Ditto. (expand_expr, case PREINCREMENT_EXPR): Ditto. (expand_expr, case PREDECREMENT_EXPR): Ditto. (expand_expr, case POSTINCREMENT_EXPR): Ditto. (expand_expr, case POSTDECREMENT_EXPR): Ditto. * tree.c (stabilize_reference): Always ignore the first operand of COMPOUND_EXPRs. From-SVN: r11939
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c14
-rw-r--r--gcc/tree.c8
2 files changed, 11 insertions, 11 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 2fa8259..6678d30 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -187,7 +187,7 @@ static rtx result_vector PROTO((int, rtx));
static rtx expand_builtin_apply_args PROTO((void));
static rtx expand_builtin_apply PROTO((rtx, rtx, rtx));
static void expand_builtin_return PROTO((rtx));
-static rtx expand_increment PROTO((tree, int));
+static rtx expand_increment PROTO((tree, int, int));
void bc_expand_increment PROTO((struct increment_operator *, tree));
tree bc_runtime_type_code PROTO((tree));
rtx bc_allocate_local PROTO((int, int));
@@ -3601,7 +3601,7 @@ store_constructor (exp, target, cleared)
expand_increment (build (PREINCREMENT_EXPR,
TREE_TYPE (index),
- index, integer_one_node), 0);
+ index, integer_one_node), 0, 0);
expand_end_loop ();
emit_label (loop_end);
@@ -6763,12 +6763,12 @@ expand_expr (exp, target, tmode, modifier)
case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
- return expand_increment (exp, 0);
+ return expand_increment (exp, 0, ignore);
case POSTINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
/* Faster to treat as pre-increment if result is not used. */
- return expand_increment (exp, ! ignore);
+ return expand_increment (exp, ! ignore, ignore);
case ADDR_EXPR:
/* If nonzero, TEMP will be set to the address of something that might
@@ -9210,9 +9210,9 @@ expand_builtin_return (result)
POST is 1 for postinc/decrements and 0 for preinc/decrements. */
static rtx
-expand_increment (exp, post)
+expand_increment (exp, post, ignore)
register tree exp;
- int post;
+ int post, ignore;
{
register rtx op0, op1;
register rtx temp, value;
@@ -9343,7 +9343,7 @@ expand_increment (exp, post)
incremented = TREE_OPERAND (incremented, 0);
}
- temp = expand_assignment (incremented, newexp, ! post, 0);
+ temp = expand_assignment (incremented, newexp, ! post && ! ignore , 0);
return post ? op0 : temp;
}
diff --git a/gcc/tree.c b/gcc/tree.c
index d7c0e05..7aa6c77 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2412,10 +2412,10 @@ stabilize_reference (ref)
break;
case COMPOUND_EXPR:
- result = build_nt (COMPOUND_EXPR,
- stabilize_reference_1 (TREE_OPERAND (ref, 0)),
- stabilize_reference (TREE_OPERAND (ref, 1)));
- break;
+ /* We cannot wrap the first expression in a SAVE_EXPR, as then
+ it wouldn't be ignored. This matters when dealing with
+ volatiles. */
+ return stabilize_reference_1 (ref);
case RTL_EXPR:
result = build1 (INDIRECT_REF, TREE_TYPE (ref),