aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1999-10-07 20:10:09 -0400
committerJason Merrill <jason@gcc.gnu.org>1999-10-07 20:10:09 -0400
commit6fbfac9226aa91f37641f562f200cd6fa35b4611 (patch)
treeb1c3c499a16276b254e73a32086cb072d17359cb /gcc/expr.c
parent11028a5379153307e5eef4b71b836e41b11551c6 (diff)
downloadgcc-6fbfac9226aa91f37641f562f200cd6fa35b4611.zip
gcc-6fbfac9226aa91f37641f562f200cd6fa35b4611.tar.gz
gcc-6fbfac9226aa91f37641f562f200cd6fa35b4611.tar.bz2
expr.c (expand_expr, [...]): Set TREE_USED sooner.
* expr.c (expand_expr, TARGET_EXPR): Set TREE_USED sooner. * c-decl.c (finish_struct): Use simpler method of removing elements of a singly-linked list. From-SVN: r29860
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 568460b..79e651f 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7128,21 +7128,11 @@ expand_expr (exp, target, tmode, modifier)
tree negated = fold (build1 (NEGATE_EXPR, type,
TREE_OPERAND (exp, 1)));
- /* Deal with the case where we can't negate the constant
- in TYPE. */
if (TREE_UNSIGNED (type) || TREE_OVERFLOW (negated))
- {
- tree newtype = signed_type (type);
- tree newop0 = convert (newtype, TREE_OPERAND (exp, 0));
- tree newop1 = convert (newtype, TREE_OPERAND (exp, 1));
- tree newneg = fold (build1 (NEGATE_EXPR, newtype, newop1));
-
- if (! TREE_OVERFLOW (newneg))
- return expand_expr (convert (type,
- build (PLUS_EXPR, newtype,
- newop0, newneg)),
- target, tmode, ro_modifier);
- }
+ /* If we can't negate the constant in TYPE, leave it alone and
+ expand_binop will negate it for us. We used to try to do it
+ here in the signed version of TYPE, but that doesn't work
+ on POINTER_TYPEs. */;
else
{
exp = build (PLUS_EXPR, type, TREE_OPERAND (exp, 0), negated);
@@ -7845,6 +7835,11 @@ expand_expr (exp, target, tmode, modifier)
if (! ignore)
target = original_target;
+ /* Set this here so that if we get a target that refers to a
+ register variable that's already been used, put_reg_into_stack
+ knows that it should fix up those uses. */
+ TREE_USED (slot) = 1;
+
if (target == 0)
{
if (DECL_RTL (slot) != 0)
@@ -7914,7 +7909,6 @@ expand_expr (exp, target, tmode, modifier)
/* Mark it as expanded. */
TREE_OPERAND (exp, 1) = NULL_TREE;
- TREE_USED (slot) = 1;
store_expr (exp1, target, 0);
expand_decl_cleanup (NULL_TREE, cleanups);