diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2002-02-24 21:43:52 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2002-02-24 16:43:52 -0500 |
commit | 8041889f4499628bcf5585a78f5b2e9349b6422a (patch) | |
tree | d41aac23d0588c869de70813a306b8896a0bf5c3 | |
parent | 506d4ef6a187164128f403497ac24fcc11a08d84 (diff) | |
download | gcc-8041889f4499628bcf5585a78f5b2e9349b6422a.zip gcc-8041889f4499628bcf5585a78f5b2e9349b6422a.tar.gz gcc-8041889f4499628bcf5585a78f5b2e9349b6422a.tar.bz2 |
* optabs.c (widen_operand): Properly handle CONST_INT for NO_EXTEND.
From-SVN: r50011
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/optabs.c | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0621754..8e06eee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Sun Feb 24 16:38:56 2002 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * optabs.c (widen_operand): Properly handle CONST_INT for NO_EXTEND. + 2002-02-24 Neil Booth <neil@daikokuya.demon.co.uk> * cpplex.c (cpp_interpret_charconst): Get signedness or diff --git a/gcc/optabs.c b/gcc/optabs.c index 69fb999..bb3e292 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -186,11 +186,14 @@ widen_operand (op, mode, oldmode, unsignedp, no_extend) { rtx result; - /* If we must extend do so. If OP is either a constant or a SUBREG - for a promoted object, also extend since it will be more efficient to - do so. */ + /* If we don't have to extend and this is a constant, return it. */ + if (no_extend && GET_MODE (op) == VOIDmode) + return op; + + /* If we must extend do so. If OP is a SUBREG for a promoted object, also + extend since it will be more efficient to do so unless the signedness of + a promoted object differs from our extension. */ if (! no_extend - || GET_MODE (op) == VOIDmode || (GET_CODE (op) == SUBREG && SUBREG_PROMOTED_VAR_P (op) && SUBREG_PROMOTED_UNSIGNED_P (op) == unsignedp)) return convert_modes (mode, oldmode, op, unsignedp); |