diff options
author | Andrew Pinski <andrew_pinski@playstation.sony.com> | 2007-04-23 01:53:56 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2007-04-22 18:53:56 -0700 |
commit | 1f2ad84c3c4c7975b49b09ae9fc1a6b62be19e13 (patch) | |
tree | 4513c5254a2c57ebf8614052ec61b449af5ec70e /gcc/expr.c | |
parent | 51da21be95f20ad512253b0420ea743506dd2f0f (diff) | |
download | gcc-1f2ad84c3c4c7975b49b09ae9fc1a6b62be19e13.zip gcc-1f2ad84c3c4c7975b49b09ae9fc1a6b62be19e13.tar.gz gcc-1f2ad84c3c4c7975b49b09ae9fc1a6b62be19e13.tar.bz2 |
re PR middle-end/31448 (ICE in expand_shift with bit fields and expand inlining constants)
2007-04-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/31448
* expr.c (reduce_to_bit_field_precision): Handle
CONST_INT rtx's.
2007-04-22 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR middle-end/31448
* gcc.c-torture/execute/pr31448.c: New testcase.
From-SVN: r124054
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -8962,7 +8962,14 @@ reduce_to_bit_field_precision (rtx exp, rtx target, tree type) HOST_WIDE_INT prec = TYPE_PRECISION (type); if (target && GET_MODE (target) != GET_MODE (exp)) target = 0; - if (TYPE_UNSIGNED (type)) + /* For constant values, reduce using build_int_cst_type. */ + if (GET_CODE (exp) == CONST_INT) + { + HOST_WIDE_INT value = INTVAL (exp); + tree t = build_int_cst_type (type, value); + return expand_expr (t, target, VOIDmode, EXPAND_NORMAL); + } + else if (TYPE_UNSIGNED (type)) { rtx mask; if (prec < HOST_BITS_PER_WIDE_INT) |