From abd418d31ff128278eefebb5bdfa39aba68b42c4 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Wed, 25 Nov 1992 18:04:15 +0000 Subject: [PATCH] (expand_binop, expand_twoval_binop): If we are going to fail, remove any load from MEM we did due to -fforce-mem... (expand_binop, expand_twoval_binop): If we are going to fail, remove any load from MEM we did due to -fforce-mem; if the MEM was volatile, this will cause an extra load. (expand_complex_abs): Likewise. Correct use of variable LAST so it doesn't include the load from MEM (to fix unrelated bug). From-SVN: r2797 --- gcc/optabs.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/optabs.c b/gcc/optabs.c index 51ce7106e71..1dd2e26264d 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -280,6 +280,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) || binoptab->code == LSHIFTRT || binoptab->code == ROTATE || binoptab->code == ROTATERT); + rtx entry_last = get_last_insn (); rtx last; class = GET_MODE_CLASS (mode); @@ -1093,7 +1094,11 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) if (! (methods == OPTAB_WIDEN || methods == OPTAB_LIB_WIDEN || methods == OPTAB_MUST_WIDEN)) - return 0; /* Caller says, don't even try. */ + { + /* Caller says, don't even try. */ + delete_insns_since (entry_last); + return 0; + } /* Compute the value of METHODS to pass to recursive calls. Don't allow widening to be tried recursively. */ @@ -1172,6 +1177,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods) } } + delete_insns_since (entry_last); return 0; } @@ -1254,6 +1260,7 @@ expand_twoval_binop (binoptab, op0, op1, targ0, targ1, unsignedp) enum machine_mode mode = GET_MODE (targ0 ? targ0 : targ1); enum mode_class class; enum machine_mode wider_mode; + rtx entry_last = get_last_insn (); rtx last; class = GET_MODE_CLASS (mode); @@ -1358,6 +1365,7 @@ expand_twoval_binop (binoptab, op0, op1, targ0, targ1, unsignedp) } } + delete_insns_since (entry_last); return 0; } @@ -1651,7 +1659,8 @@ expand_complex_abs (mode, op0, target, unsignedp) enum mode_class class = GET_MODE_CLASS (mode); enum machine_mode wider_mode; register rtx temp; - rtx last = get_last_insn (); + rtx entry_last = get_last_insn (); + rtx last; rtx pat; /* Find the correct mode for the real and imaginary parts. */ @@ -1670,6 +1679,8 @@ expand_complex_abs (mode, op0, target, unsignedp) op0 = force_not_mem (op0); } + last = get_last_insn (); + if (target) target = protect_from_queue (target, 1); @@ -1819,6 +1830,7 @@ expand_complex_abs (mode, op0, target, unsignedp) } } + delete_insns_since (entry_last); return 0; } -- 2.30.2