From 68d884911e5d330965258f5ee34005ec7ef83022 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Thu, 4 Jun 1992 02:12:28 +0000 Subject: [PATCH] *** empty log message *** From-SVN: r1153 --- gcc/config/mips/mips.md | 6 +++--- 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 ec73c4d71389..761409a83730 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 ba44e202bc58..0bc6db3e55ef 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))))) -- 2.47.3