diff options
author | Richard Sandiford <richard@codesourcery.com> | 2007-09-03 15:35:52 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2007-09-03 15:35:52 +0000 |
commit | c722c7daaf9b2ad6435f075fce2573b9c58112ec (patch) | |
tree | e5fef72222c55492804f063aeaff14e113ce5a35 /gcc | |
parent | 171cb6996f0607925d63878cb74209d67cf09fb0 (diff) | |
download | gcc-c722c7daaf9b2ad6435f075fce2573b9c58112ec.zip gcc-c722c7daaf9b2ad6435f075fce2573b9c58112ec.tar.gz gcc-c722c7daaf9b2ad6435f075fce2573b9c58112ec.tar.bz2 |
re PR middle-end/33290 (gcc.c-torture/execute/930921-1.c fails at -O1 and above now)
gcc/
PR middle-end/33290
* optabs.c (avoid_expensive_constant): Canonicalize CONST_INTs
before forcing them into a register.
From-SVN: r128048
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/optabs.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9bdd53f..3526e61 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2007-09-03 Richard Sandiford <richard@codesourcery.com> + PR middle-end/33290 + * optabs.c (avoid_expensive_constant): Canonicalize CONST_INTs + before forcing them into a register. + +2007-09-03 Richard Sandiford <richard@codesourcery.com> + * config/mips/mips.md (fetchop_bit): Use define_code_iterator rather than define_code_macro. diff --git a/gcc/optabs.c b/gcc/optabs.c index fee7c50..8d0139e 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1290,7 +1290,13 @@ avoid_expensive_constant (enum machine_mode mode, optab binoptab, && CONSTANT_P (x) && rtx_cost (x, binoptab->code) > COSTS_N_INSNS (1)) { - if (GET_MODE (x) != VOIDmode) + if (GET_CODE (x) == CONST_INT) + { + HOST_WIDE_INT intval = trunc_int_for_mode (INTVAL (x), mode); + if (intval != INTVAL (x)) + x = GEN_INT (intval); + } + else x = convert_modes (mode, VOIDmode, x, unsignedp); x = force_reg (mode, x); } |