From cc2e8b2d919f2f65a289b31f3b12a27e868c21f6 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Fri, 27 Apr 2001 23:55:03 +0000 Subject: [PATCH] function.c (purge_addressof_1): Remove the duplicate if (code == SET) block. * function.c (purge_addressof_1): Remove the duplicate if (code == SET) block. Fold the two if (code == ADDRESSOF) blocks together. From-SVN: r41649 --- gcc/ChangeLog | 6 ++++++ gcc/function.c | 30 +++++++++++------------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f6baaabc865..08224fcd4bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-04-27 Zack Weinberg + + * function.c (purge_addressof_1): Remove the duplicate + if (code == SET) block. Fold the two if (code == ADDRESSOF) + blocks together. + 2001-04-28 Jason Merrill * except.c (expand_eh_region_start): Don't start a new block. diff --git a/gcc/function.c b/gcc/function.c index 482e3ef089d..c2727047e2d 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -2991,14 +2991,19 @@ purge_addressof_1 (loc, insn, force, store, ht) result &= purge_addressof_1 (&SET_SRC (x), insn, force, 0, ht); return result; } - - else if (code == ADDRESSOF && GET_CODE (XEXP (x, 0)) == MEM) + else if (code == ADDRESSOF) { + rtx sub, insns; + + if (GET_CODE (XEXP (x, 0)) != MEM) + { + put_addressof_into_stack (x, ht); + return true; + } + /* We must create a copy of the rtx because it was created by overwriting a REG rtx which is always shared. */ - rtx sub = copy_rtx (XEXP (XEXP (x, 0), 0)); - rtx insns; - + sub = copy_rtx (XEXP (XEXP (x, 0), 0)); if (validate_change (insn, loc, sub, 0) || validate_replace_rtx (x, sub, insn)) return true; @@ -3210,22 +3215,9 @@ purge_addressof_1 (loc, insn, force, store, ht) } goto restart; } - give_up:; - /* else give up and put it into the stack */ - } - - else if (code == ADDRESSOF) - { - put_addressof_into_stack (x, ht); - return true; - } - else if (code == SET) - { - result = purge_addressof_1 (&SET_DEST (x), insn, force, 1, ht); - result &= purge_addressof_1 (&SET_SRC (x), insn, force, 0, ht); - return result; } + give_up: /* Scan all subexpressions. */ fmt = GET_RTX_FORMAT (code); for (i = 0; i < GET_RTX_LENGTH (code); i++, fmt++) -- 2.30.2