diff options
author | Richard Guenther <rguenther@suse.de> | 2010-03-20 13:44:18 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-03-20 13:44:18 +0000 |
commit | d491d2af314a455227666dd245dc27ea0dfdea8e (patch) | |
tree | 4b97c99c8dd9e98f9e5f57b7f470ee45624f13c1 /gcc/combine.c | |
parent | 39bac0102c930a6d38486f5716793d531dc90302 (diff) | |
download | gcc-d491d2af314a455227666dd245dc27ea0dfdea8e.zip gcc-d491d2af314a455227666dd245dc27ea0dfdea8e.tar.gz gcc-d491d2af314a455227666dd245dc27ea0dfdea8e.tar.bz2 |
re PR rtl-optimization/43438 (possible wrong code bug)
2010-03-20 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/43438
* combine.c (make_extraction): Properly zero-/sign-extend an
extraction of the low part of a CONST_INT. Also handle
CONST_DOUBLE.
* gcc.c-torture/execute/pr43438.c: New testcase.
From-SVN: r157592
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index f4f2fa0..a5240c9 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -6793,8 +6793,10 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos, if (mode == tmode) return new_rtx; - if (CONST_INT_P (new_rtx)) - return gen_int_mode (INTVAL (new_rtx), mode); + if (CONST_INT_P (new_rtx) + || GET_CODE (new_rtx) == CONST_DOUBLE) + return simplify_unary_operation (unsignedp ? ZERO_EXTEND : SIGN_EXTEND, + mode, new_rtx, tmode); /* If we know that no extraneous bits are set, and that the high bit is not set, convert the extraction to the cheaper of |