From: Richard Henderson Date: Tue, 4 Nov 1997 21:15:45 +0000 (-0800) Subject: alpha.c (summarize_insn): Handle ASM_OPERANDS. X-Git-Tag: releases/egcs-1.0.0~165 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efd60d18d87640474a85a5624c8004d3768f0fb7;p=thirdparty%2Fgcc.git alpha.c (summarize_insn): Handle ASM_OPERANDS. * alpha.c (summarize_insn): Handle ASM_OPERANDS. Don't recurse for SUBREG, just fall through. * alpha.c (alpha_handle_trap_shadows): Init sum.defd to zero. * alpha.md (attr trap): Make TRAP_YES non-zero for sanity's sake. * combine.c (try_combine): When setting elim_i1, check if newi2pat sets i1dest. * combine.c (try_combine): When setting elim_i2, check whether newi2pat sets i2dest. When calling distribute_notes for i3dest_killed, pass elim_i2 and elim_i1. Co-Authored-By: Jim Wilson From-SVN: r16313 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 81aad33be286..fdb1b1b255c6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +Tue Nov 4 14:12:30 1997 Richard Henderson (rth@cygnus.com) + Jim Wilson (wilson@cygnus.com) + + * alpha.c (summarize_insn): Handle ASM_OPERANDS. Don't recurse + for SUBREG, just fall through. + + * alpha.c (alpha_handle_trap_shadows): Init sum.defd to zero. + + * alpha.md (attr trap): Make TRAP_YES non-zero for sanity's sake. + + * combine.c (try_combine): When setting elim_i1, check if newi2pat + sets i1dest. + + * combine.c (try_combine): When setting elim_i2, check whether newi2pat + sets i2dest. When calling distribute_notes for i3dest_killed, pass + elim_i2 and elim_i1. + Mon Nov 3 14:36:50 1997 Jeffrey A Law (law@cygnus.com) * configure.in (sco5): Use cpio to install header files. diff --git a/gcc/combine.c b/gcc/combine.c index 3626e48e9757..bcb6fe9c783f 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2141,10 +2141,14 @@ try_combine (i3, i2, i1) rtx i3links, i2links, i1links = 0; rtx midnotes = 0; register int regno; - /* Compute which registers we expect to eliminate. */ - rtx elim_i2 = (newi2pat || i2dest_in_i2src || i2dest_in_i1src + /* Compute which registers we expect to eliminate. newi2pat may be setting + either i3dest or i2dest, so we must check it. */ + rtx elim_i2 = ((newi2pat && reg_set_p (i2dest, newi2pat)) + || i2dest_in_i2src || i2dest_in_i1src ? 0 : i2dest); - rtx elim_i1 = i1 == 0 || i1dest_in_i1src ? 0 : i1dest; + rtx elim_i1 = (i1 == 0 || i1dest_in_i1src + || (newi2pat && reg_set_p (i1dest, newi2pat)) + ? 0 : i1dest); /* Get the old REG_NOTES and LOG_LINKS from all our insns and clear them. */ @@ -2305,7 +2309,7 @@ try_combine (i3, i2, i1) distribute_notes (gen_rtx (EXPR_LIST, REG_DEAD, i3dest_killed, NULL_RTX), NULL_RTX, i3, newi2pat ? i2 : NULL_RTX, - NULL_RTX, NULL_RTX); + elim_i2, elim_i1); } /* For I2 and I1, we have to be careful. If NEWI2PAT exists and sets diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 0c5334004f40..b3ac7132f059 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -2784,11 +2784,20 @@ summarize_insn (x, sum, set) summarize_insn (XEXP (x, 0), sum, 0); break; + case ASM_OPERANDS: + for (i = ASM_OPERANDS_INPUT_LENGTH (x) - 1; i >= 0; i--) + summarize_insn (ASM_OPERANDS_INPUT (x, i), sum, 0); + break; + case PARALLEL: for (i = XVECLEN (x, 0) - 1; i >= 0; i--) summarize_insn (XVECEXP (x, 0, i), sum, 0); break; + case SUBREG: + x = SUBREG_REG (x); + /* FALLTHRU */ + case REG: { int regno = REGNO (x); @@ -2824,10 +2833,6 @@ summarize_insn (x, sum, set) summarize_insn (XEXP (x, 0), sum, 0); break; - case SUBREG: - summarize_insn (SUBREG_REG (x), sum, set); - break; - case CONST_INT: case CONST_DOUBLE: case SYMBOL_REF: case LABEL_REF: case CONST: break; @@ -2958,7 +2963,7 @@ alpha_handle_trap_shadows (insns) sum.used.i = 0; sum.used.fp = 0; sum.used.mem = 0; - sum.defd = shadow.used; + sum.defd = sum.used; switch (GET_CODE (i)) { diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 570ab915ae26..af7f1d265d27 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -39,7 +39,7 @@ ;; The TRAP_TYPE attribute marks instructions that may generate traps ;; (which are imprecise and may need a trapb if software complention ;; is desired). -(define_attr "trap" "yes,no" (const_string "no")) +(define_attr "trap" "no,yes" (const_string "no")) ;; For the EV4 we include four function units: ABOX, which computes ;; the address, BBOX, used for branches, EBOX, used for integer