aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-03-24 19:58:58 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2011-03-24 19:58:58 +0100
commit6f0c9f06a58f56e54a595cdbb419c6a987710519 (patch)
treebcc127f2ba58f61140e326dd7155f9c73496fb01 /gcc/simplify-rtx.c
parent50e373331f436e2e39ca86262662a9d3ac7f3c67 (diff)
downloadgcc-6f0c9f06a58f56e54a595cdbb419c6a987710519.zip
gcc-6f0c9f06a58f56e54a595cdbb419c6a987710519.tar.gz
gcc-6f0c9f06a58f56e54a595cdbb419c6a987710519.tar.bz2
re PR debug/48204 (ICE: in decimal_to_decnumber, at dfp.c:115 with -fno-tree-ccp -fno-tree-dominator-opts -fno-tree-fre -g)
PR debug/48204 * simplify-rtx.c (simplify_const_unary_operation): Call real_convert when changing mode class with FLOAT_EXTEND. * gcc.dg/dfp/pr48204.c: New test. From-SVN: r171423
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 4a8e3c6..847a4bb 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1526,7 +1526,8 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode,
}
else if (GET_CODE (op) == CONST_DOUBLE
- && SCALAR_FLOAT_MODE_P (mode))
+ && SCALAR_FLOAT_MODE_P (mode)
+ && SCALAR_FLOAT_MODE_P (GET_MODE (op)))
{
REAL_VALUE_TYPE d, t;
REAL_VALUE_FROM_CONST_DOUBLE (d, op);
@@ -1549,7 +1550,10 @@ simplify_const_unary_operation (enum rtx_code code, enum machine_mode mode,
d = real_value_truncate (mode, d);
break;
case FLOAT_EXTEND:
- /* All this does is change the mode. */
+ /* All this does is change the mode, unless changing
+ mode class. */
+ if (GET_MODE_CLASS (mode) != GET_MODE_CLASS (GET_MODE (op)))
+ real_convert (&d, mode, &d);
break;
case FIX:
real_arithmetic (&d, FIX_TRUNC_EXPR, &d, NULL);