diff options
author | David Daney <ddaney@caviumnetworks.com> | 2009-12-04 17:46:23 +0000 |
---|---|---|
committer | David Daney <daney@gcc.gnu.org> | 2009-12-04 17:46:23 +0000 |
commit | d0e4968c33c257bcfa1afa4f499661c18c80e5bc (patch) | |
tree | 3644884bc7ca74ce76b6bc0e62b5e2e10bb44f61 /gcc/combine.c | |
parent | c21237d52701733032eaa6fb97e4d233fabcaaaa (diff) | |
download | gcc-d0e4968c33c257bcfa1afa4f499661c18c80e5bc.zip gcc-d0e4968c33c257bcfa1afa4f499661c18c80e5bc.tar.gz gcc-d0e4968c33c257bcfa1afa4f499661c18c80e5bc.tar.bz2 |
re PR rtl-optimization/42164 (internal compiler error: in simplify_subreg, at simplify-rtx.c:5138)
2009-12-04 David Daney <ddaney@caviumnetworks.com>
PR rtl-optimization/42164
* combine.c (combine_simplify_rtx): Handle truncation of integer
constants.
2009-12-04 David Daney <ddaney@caviumnetworks.com>
PR rtl-optimization/42164
* gcc.c-torture/compile/pr42164.c: New test.
From-SVN: r154987
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index cdc677d..7f3f6da 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -5156,6 +5156,10 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) force_to_mode (XEXP (x, 0), GET_MODE (XEXP (x, 0)), GET_MODE_MASK (mode), 0)); + /* We can truncate a constant value and return it. */ + if (CONST_INT_P (XEXP (x, 0))) + return gen_int_mode (INTVAL (XEXP (x, 0)), mode); + /* Similarly to what we do in simplify-rtx.c, a truncate of a register whose value is a comparison can be replaced with a subreg if STORE_FLAG_VALUE permits. */ |