diff options
-rw-r--r-- | gcc/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/alias.c | 9 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 2 | ||||
-rw-r--r-- | gcc/config/darwin.c | 14 | ||||
-rw-r--r-- | gcc/config/m68k/m68k.c | 2 | ||||
-rw-r--r-- | gcc/config/m88k/m88k.c | 2 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 5 | ||||
-rw-r--r-- | gcc/config/pa/pa.c | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 10 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 2 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.md | 44 | ||||
-rw-r--r-- | gcc/explow.c | 24 | ||||
-rw-r--r-- | gcc/recog.c | 9 | ||||
-rw-r--r-- | gcc/rtl.h | 3 |
14 files changed, 58 insertions, 84 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 01d855ab607..6b30fd302f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +Mon Jul 2 21:52:19 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * explow.c (plus_constant_wide, case LO_SUM): New case. + (plus_constant_for_output_wide): Delete. + * rtl.h (plus_constant_for_output): Delete. + * alias.c (canon_rtx, init_alias_analysis): Call plus_constant + instead of plus_constant_for_output. + * recog.c (offsettable_address_p, adj_offsettable_operand): Likewise. + * config/darwin.c, config/arm/arm.c, config/m68k/m68k.c: Likewise. + * config/m88k/m88k.c, config/mips/mips.c, config/pa/pa.c: Likewise. + * config/rs6000/rs6000.c, config/sparc/sparc.c: Likewise. + * config/sparc/sparc.md: Likewise. + Convert some change_address calls to adjust_address. + 2001-07-03 Joseph S. Myers <jsm28@cam.ac.uk> * doc/extend.texi, doc/gcc.texi, doc/invoke.texi, doc/md.texi, diff --git a/gcc/alias.c b/gcc/alias.c index 79c0c33c6e3..83354257b75 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -959,12 +959,10 @@ canon_rtx (x) if (x0 != XEXP (x, 0) || x1 != XEXP (x, 1)) { - /* We can tolerate LO_SUMs being offset here; these - rtl are used for nothing other than comparisons. */ if (GET_CODE (x0) == CONST_INT) - return plus_constant_for_output (x1, INTVAL (x0)); + return plus_constant (x1, INTVAL (x0)); else if (GET_CODE (x1) == CONST_INT) - return plus_constant_for_output (x0, INTVAL (x1)); + return plus_constant (x0, INTVAL (x1)); return gen_rtx_PLUS (GET_MODE (x), x0, x1); } } @@ -2349,8 +2347,7 @@ init_alias_analysis () rtx op0 = XEXP (src, 0); op0 = reg_known_value[REGNO (op0)]; reg_known_value[regno] - = plus_constant_for_output (op0, - INTVAL (XEXP (src, 1))); + = plus_constant (op0, INTVAL (XEXP (src, 1))); reg_known_equiv_p[regno] = 0; } else if (REG_N_SETS (regno) == 1 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 97ca596b3f8..5fe04181119 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -2234,7 +2234,7 @@ legitimize_pic_address (orig, mode, reg) win: if (GET_CODE (offset) == CONST_INT) - return plus_constant_for_output (base, INTVAL (offset)); + return plus_constant (base, INTVAL (offset)); } if (GET_MODE_SIZE (mode) > 4 diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 37715796cb0..816cd4bbb4f 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -474,13 +474,9 @@ machopic_indirect_data_reference (orig, reg) return orig; if (MACHOPIC_PURE && GET_CODE (orig) == CONST_INT) - { - result = plus_constant_for_output (base, INTVAL (orig)); - } + result = plus_constant (base, INTVAL (orig)); else - { - result = gen_rtx (PLUS, Pmode, base, orig); - } + result = gen_rtx (PLUS, Pmode, base, orig); if (RTX_UNCHANGING_P (base) && RTX_UNCHANGING_P (orig)) RTX_UNCHANGING_P (result) = 1; @@ -835,13 +831,11 @@ machopic_legitimize_pic_address (orig, mode, reg) Pmode, (base == reg ? 0 : reg)); if (GET_CODE (orig) == CONST_INT) { - pic_ref = plus_constant_for_output (base, INTVAL (orig)); + pic_ref = plus_constant (base, INTVAL (orig)); is_complex = 1; } else - { - pic_ref = gen_rtx (PLUS, Pmode, base, orig); - } + pic_ref = gen_rtx (PLUS, Pmode, base, orig); if (RTX_UNCHANGING_P (base) && RTX_UNCHANGING_P (orig)) RTX_UNCHANGING_P (pic_ref) = 1; diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index e377e77c15e..d0c3da1f3a1 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -1402,7 +1402,7 @@ legitimize_pic_address (orig, mode, reg) else abort (); if (GET_CODE (orig) == CONST_INT) - return plus_constant_for_output (base, INTVAL (orig)); + return plus_constant (base, INTVAL (orig)); pic_ref = gen_rtx_PLUS (Pmode, base, orig); /* Likewise, should we set special REG_NOTEs here? */ } diff --git a/gcc/config/m88k/m88k.c b/gcc/config/m88k/m88k.c index 12313c9d0d6..86332bfad3f 100644 --- a/gcc/config/m88k/m88k.c +++ b/gcc/config/m88k/m88k.c @@ -368,7 +368,7 @@ legitimize_address (pic, orig, reg, scratch) if (GET_CODE (addr) == CONST_INT) { if (ADD_INT (addr)) - return plus_constant_for_output (base, INTVAL (addr)); + return plus_constant (base, INTVAL (addr)); else if (! reload_in_progress && ! reload_completed) addr = force_reg (Pmode, addr); /* We can't create any new registers during reload, so use the diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index dd735cc25c1..08be812f324 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -930,9 +930,8 @@ double_memory_operand (op, mode) return 1; return memory_address_p ((GET_MODE_CLASS (mode) == MODE_INT - ? SImode - : SFmode), - plus_constant_for_output (addr, 4)); + ? SImode : SFmode), + plus_constant (addr, 4)); } /* Return nonzero if the code of this rtx pattern is EQ or NE. */ diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 9100a80fa32..4d17d4500e7 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -758,7 +758,7 @@ legitimize_pic_address (orig, mode, reg) if (GET_CODE (orig) == CONST_INT) { if (INT_14_BITS (orig)) - return plus_constant_for_output (base, INTVAL (orig)); + return plus_constant (base, INTVAL (orig)); orig = force_reg (Pmode, orig); } pic_ref = gen_rtx_PLUS (Pmode, base, orig); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 912be346783..b9f2348c5ef 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3992,11 +3992,11 @@ print_operand (file, x, code) we have already done it, we can just use an offset of word. */ if (GET_CODE (XEXP (x, 0)) == PRE_INC || GET_CODE (XEXP (x, 0)) == PRE_DEC) - output_address (plus_constant_for_output (XEXP (XEXP (x, 0), 0), - UNITS_PER_WORD)); + output_address (plus_constant (XEXP (XEXP (x, 0), 0), + UNITS_PER_WORD)); else - output_address (plus_constant_for_output (XEXP (x, 0), - UNITS_PER_WORD)); + output_address (plus_constant (XEXP (x, 0), UNITS_PER_WORD)); + if (small_data_operand (x, GET_MODE (x))) fprintf (file, "@%s(%s)", SMALL_DATA_RELOC, reg_names[SMALL_DATA_REG]); @@ -8444,7 +8444,7 @@ rs6000_machopic_legitimize_pic_address (orig, mode, reg) if (GET_CODE (offset) == CONST_INT) { if (SMALL_INT (offset)) - return plus_constant_for_output (base, INTVAL (offset)); + return plus_constant (base, INTVAL (offset)); else if (! reload_in_progress && ! reload_completed) offset = force_reg (Pmode, offset); else diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index ab24f0d8f1b..05fff2b35b2 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -2813,7 +2813,7 @@ legitimize_pic_address (orig, mode, reg) if (GET_CODE (offset) == CONST_INT) { if (SMALL_INT (offset)) - return plus_constant_for_output (base, INTVAL (offset)); + return plus_constant (base, INTVAL (offset)); else if (! reload_in_progress && ! reload_completed) offset = force_reg (Pmode, offset); else diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index c6888049bef..61c2b9baf12 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -2958,8 +2958,7 @@ " { rtx word0 = adjust_address (operands[1], SImode, 0); - rtx word1 = change_address (operands[1], SImode, - plus_constant_for_output (XEXP (word0, 0), 4)); + rtx word1 = adjust_address (operands[1], SImode, 4); rtx high_part = gen_highpart (SImode, operands[0]); rtx low_part = gen_lowpart (SImode, operands[0]); @@ -2985,14 +2984,10 @@ [(clobber (const_int 0))] " { - rtx word0 = adjust_address (operands[0], SImode, 0); - rtx word1 = change_address (operands[0], SImode, - plus_constant_for_output (XEXP (word0, 0), 4)); - rtx high_part = gen_highpart (SImode, operands[1]); - rtx low_part = gen_lowpart (SImode, operands[1]); - - emit_insn (gen_movsi (word0, high_part)); - emit_insn (gen_movsi (word1, low_part)); + emit_insn (gen_movsi (adjust_address (operands[0], SImode, 0), + gen_highpart (SImode, operands[1]))); + emit_insn (gen_movsi (adjust_address (operands[0], SImode, 4), + gen_lowpart (SImode, operands[1]))); DONE; }") @@ -3595,8 +3590,7 @@ " { rtx word0 = adjust_address (operands[1], SFmode, 0); - rtx word1 = change_address (operands[1], SFmode, - plus_constant_for_output (XEXP (word0, 0), 4)); + rtx word1 = adjust_address (operands[1], SFmode, 4); if (GET_CODE (operands[0]) == SUBREG) operands[0] = alter_subreg (operands[0]); @@ -3630,8 +3624,7 @@ " { rtx word0 = adjust_address (operands[0], SFmode, 0); - rtx word1 = change_address (operands[0], SFmode, - plus_constant_for_output (XEXP (word0, 0), 4)); + rtx word1 = adjust_address (operands[0], SFmode, 4); if (GET_CODE (operands[1]) == SUBREG) operands[1] = alter_subreg (operands[1]); @@ -3656,8 +3649,8 @@ rtx dest1, dest2; dest1 = adjust_address (operands[0], SFmode, 0); - dest2 = change_address (operands[0], SFmode, - plus_constant_for_output (XEXP (dest1, 0), 4)); + dest2 = adjust_address (operands[0], SFmode, 4); + emit_insn (gen_movsf (dest1, CONST0_RTX (SFmode))); emit_insn (gen_movsf (dest2, CONST0_RTX (SFmode))); DONE; @@ -3930,8 +3923,7 @@ break; case MEM: dest1 = adjust_address (set_dest, DFmode, 0); - dest2 = change_address (set_dest, DFmode, - plus_constant_for_output (XEXP (dest1, 0), 8)); + dest2 = adjust_address (set_dest, DFmode, 8); break; default: abort (); @@ -3951,8 +3943,7 @@ " { rtx word0 = adjust_address (operands[1], DFmode, 0); - rtx word1 = change_address (operands[1], DFmode, - plus_constant_for_output (XEXP (word0, 0), 8)); + rtx word1 = adjust_address (operands[1], DFmode, 8); rtx set_dest, dest1, dest2; set_dest = operands[0]; @@ -3986,17 +3977,14 @@ [(clobber (const_int 0))] " { - rtx word1 = adjust_address (operands[0], DFmode, 0); - rtx word2 = change_address (operands[0], DFmode, - plus_constant_for_output (XEXP (word1, 0), 8)); - rtx set_src; - - set_src = operands[1]; + rtx set_src = operands[1]; if (GET_CODE (set_src) == SUBREG) set_src = alter_subreg (set_src); - emit_insn (gen_movdf (word1, gen_df_reg (set_src, 0))); - emit_insn (gen_movdf (word2, gen_df_reg (set_src, 1))); + emit_insn (gen_movdf (adjust_address (operands[0], DFmode, 0), + gen_df_reg (set_src, 0))); + emit_insn (gen_movdf (adjust_address (operands[0], DFmode, 8), + gen_df_reg (set_src, 1))); DONE; }") diff --git a/gcc/explow.c b/gcc/explow.c index 0281826508a..a6a05f57cbf 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -174,6 +174,11 @@ plus_constant_wide (x, c) c = 0; } break; + + case LO_SUM: + return gen_rtx_LO_SUM (mode, XEXP (x, 0), + plus_constant (XEXP (x, 1), c)); + default: break; @@ -189,25 +194,6 @@ plus_constant_wide (x, c) else return x; } - -/* This is the same as `plus_constant', except that it handles LO_SUM. - - This function should be used via the `plus_constant_for_output' macro. */ - -rtx -plus_constant_for_output_wide (x, c) - register rtx x; - register HOST_WIDE_INT c; -{ - register enum machine_mode mode = GET_MODE (x); - - if (GET_CODE (x) == LO_SUM) - return gen_rtx_LO_SUM (mode, XEXP (x, 0), - plus_constant_for_output (XEXP (x, 1), c)); - - else - return plus_constant (x, c); -} /* If X is a sum, return a new sum like X but lacking any constant terms. Add all the removed constant terms into *CONSTPTR. diff --git a/gcc/recog.c b/gcc/recog.c index dd5318ba476..10230d5be12 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -1968,7 +1968,7 @@ offsettable_address_p (strictp, mode, y) of the specified mode. We assume that if Y and Y+c are valid addresses then so is Y+d for all 0<d<c. */ - z = plus_constant_for_output (y, mode_sz - 1); + z = plus_constant (y, mode_sz - 1); /* Use QImode because an odd displacement may be automatically invalid for any wider mode. But it should be valid for a single byte. */ @@ -2035,8 +2035,7 @@ adj_offsettable_operand (op, offset) if (CONSTANT_ADDRESS_P (y)) { - new = gen_rtx_MEM (GET_MODE (op), - plus_constant_for_output (y, offset)); + new = gen_rtx_MEM (GET_MODE (op), plus_constant (y, offset)); MEM_COPY_ATTRIBUTES (new, op); return new; } @@ -2051,12 +2050,12 @@ adj_offsettable_operand (op, offset) const_loc = find_constant_term_loc (&z); if (const_loc) { - *const_loc = plus_constant_for_output (*const_loc, offset); + *const_loc = plus_constant (*const_loc, offset); return op; } } - new = gen_rtx_MEM (GET_MODE (op), plus_constant_for_output (y, offset)); + new = gen_rtx_MEM (GET_MODE (op), plus_constant (y, offset)); MEM_COPY_ATTRIBUTES (new, op); return new; } diff --git a/gcc/rtl.h b/gcc/rtl.h index 84de8fe3d39..efbaec23335 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1144,9 +1144,6 @@ extern int ceil_log2 PARAMS ((unsigned HOST_WIDE_INT)); #define plus_constant(X,C) plus_constant_wide (X, (HOST_WIDE_INT) (C)) -#define plus_constant_for_output(X,C) \ - plus_constant_for_output_wide (X, (HOST_WIDE_INT) (C)) - /* In builtins.c */ extern rtx expand_builtin_expect_jump PARAMS ((union tree_node *, rtx, rtx)); |