diff options
author | Richard Stallman <rms@gnu.org> | 1992-06-04 02:12:28 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-06-04 02:12:28 +0000 |
commit | 68d884911e5d330965258f5ee34005ec7ef83022 (patch) | |
tree | 582ed9089a32b015ed6df64bada7119b852c7443 | |
parent | 454f2ef20efb456f6e550bba8482627f7021e283 (diff) | |
download | gcc-68d884911e5d330965258f5ee34005ec7ef83022.zip gcc-68d884911e5d330965258f5ee34005ec7ef83022.tar.gz gcc-68d884911e5d330965258f5ee34005ec7ef83022.tar.bz2 |
*** empty log message ***
From-SVN: r1153
-rw-r--r-- | gcc/config/mips/mips.md | 6 | ||||
-rw-r--r-- | gcc/fold-const.c | 10 |
2 files changed, 13 insertions, 3 deletions
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index ec73c4d..761409a 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -1220,7 +1220,7 @@ move\\t%0,%z4\\n\\ and\\t%0,%1,%2 andi\\t%0,%1,%x2 lui\\t%3,(%X2)>>16\;and\\t%0,%1,%3 - li\\t%@,%X2\;and\\t%0,%1,%@" + li\\t%3,%X2\;and\\t%0,%1,%3" [(set_attr "type" "arith,arith,multi,multi") (set_attr "mode" "SI") (set_attr "length" "1,1,2,3") @@ -1336,7 +1336,7 @@ move\\t%0,%z4\\n\\ or\\t%0,%1,%2 ori\\t%0,%1,%x2 lui\\t%3,(%X2)>>16\;or\\t%0,%1,%3 - li\\t%@,%X2\;or\\t%0,%1,%@" + li\\t%3,%X2\;or\\t%0,%1,%3" [(set_attr "type" "arith,arith,multi,multi") (set_attr "mode" "SI") (set_attr "length" "1,1,2,3") @@ -1452,7 +1452,7 @@ move\\t%0,%z4\\n\\ xor\\t%0,%1,%2 xori\\t%0,%1,%x2 lui\\t%3,(%X2)>>16\;xor\\t%0,%1,%3 - li\\t%@,%X2\;xor\\t%0,%1,%@" + li\\t%3,%X2\;xor\\t%0,%1,%3" [(set_attr "type" "arith,arith,multi,multi") (set_attr "mode" "SI") (set_attr "length" "1,1,2,3") diff --git a/gcc/fold-const.c b/gcc/fold-const.c index ba44e20..0bc6db3 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2733,6 +2733,8 @@ fold (expr) /* Other kinds of FIX are not handled properly by fold_convert. */ /* Two conversions in a row are not needed unless: - the intermediate type is narrower than both initial and final, or + - the intermediate type and innermost type differ in signedness, + and the outermost type is wider than the intermediate, or - the initial type is a pointer type and the precisions of the intermediate and final types differ, or - the final type is a pointer type and the precisions of the @@ -2744,6 +2746,14 @@ fold (expr) || TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (t, 0))) > TYPE_PRECISION (TREE_TYPE (t))) + && ! ((TREE_CODE (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 0), 0))) + == INTEGER_TYPE) + && (TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0))) + == INTEGER_TYPE) + && (TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (t, 0))) + != TREE_UNSIGNED (TREE_OPERAND (TREE_OPERAND (t, 0), 0))) + && (TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (t, 0))) + < TYPE_PRECISION (TREE_TYPE (t)))) && ((TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (t, 0))) && (TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (t, 0))) > TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (t, 0), 0))))) |