diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-06-13 18:32:39 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-06-13 18:32:39 -0400 |
commit | 21403f14b292fcf53cc270ce42c1bd2517f40adb (patch) | |
tree | b043ec48f6fcfb58f9ed3e8dbcd8a0670f5418aa /gcc/fold-const.c | |
parent | dbfac751de5465c89ecc64e3e7a4e3fd300691f0 (diff) | |
download | gcc-21403f14b292fcf53cc270ce42c1bd2517f40adb.zip gcc-21403f14b292fcf53cc270ce42c1bd2517f40adb.tar.gz gcc-21403f14b292fcf53cc270ce42c1bd2517f40adb.tar.bz2 |
(fold): When converting a COND_EXPR to an ABS_EXPR, get the types
right for ABS_EXPR to work.
From-SVN: r9939
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e7d3136..73ec234 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -4854,12 +4854,16 @@ fold (expr) case GE_EXPR: case GT_EXPR: return pedantic_non_lvalue - (fold (build1 (ABS_EXPR, type, arg1))); + (convert (type, fold (build1 (ABS_EXPR, + TREE_TYPE (arg1), arg1)))); case LE_EXPR: case LT_EXPR: return pedantic_non_lvalue (fold (build1 (NEGATE_EXPR, type, - fold (build1 (ABS_EXPR, type, arg1))))); + convert (type, + fold (build1 (ABS_EXPR, + TREE_TYPE (arg1), + arg1)))))); } /* If this is A != 0 ? A : 0, this is simply A. For ==, it is |