diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/expmed.c | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8e24141..b10f351 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2002-04-22 Tom Rix <trix@redhat.com> + + * expmed.c (init_expmed): Generate shifted constant once. + 2002-04-22 Zack Weinberg <zack@codesourcery.com> * c-lex.c (lex_charconst): Call convert to get constant in diff --git a/gcc/expmed.c b/gcc/expmed.c index 76b90fa..e60ccbf 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -144,19 +144,18 @@ init_expmed () for (m = 1; m < MAX_BITS_PER_WORD; m++) { + rtx c_int = GEN_INT ((HOST_WIDE_INT) 1 << m); shift_cost[m] = shiftadd_cost[m] = shiftsub_cost[m] = 32000; XEXP (SET_SRC (PATTERN (shift_insn)), 1) = GEN_INT (m); if (recog (PATTERN (shift_insn), shift_insn, &dummy) >= 0) shift_cost[m] = rtx_cost (SET_SRC (PATTERN (shift_insn)), SET); - XEXP (XEXP (SET_SRC (PATTERN (shiftadd_insn)), 0), 1) - = GEN_INT ((HOST_WIDE_INT) 1 << m); + XEXP (XEXP (SET_SRC (PATTERN (shiftadd_insn)), 0), 1) = c_int; if (recog (PATTERN (shiftadd_insn), shiftadd_insn, &dummy) >= 0) shiftadd_cost[m] = rtx_cost (SET_SRC (PATTERN (shiftadd_insn)), SET); - XEXP (XEXP (SET_SRC (PATTERN (shiftsub_insn)), 0), 1) - = GEN_INT ((HOST_WIDE_INT) 1 << m); + XEXP (XEXP (SET_SRC (PATTERN (shiftsub_insn)), 0), 1) = c_int; if (recog (PATTERN (shiftsub_insn), shiftsub_insn, &dummy) >= 0) shiftsub_cost[m] = rtx_cost (SET_SRC (PATTERN (shiftsub_insn)), SET); } |