diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-27 09:50:04 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-27 09:50:04 +0000 |
commit | 6295ca724123bcba17754cde6db8280274894197 (patch) | |
tree | ef16ed7af638323b496055d922dbdc8e19ef42aa /gcc/expr.c | |
parent | 9af93fe5bf230f989e0d8a18afda2546f10de092 (diff) | |
download | ppe42-gcc-6295ca724123bcba17754cde6db8280274894197.tar.gz ppe42-gcc-6295ca724123bcba17754cde6db8280274894197.zip |
2008-02-27 Richard Guenther <rguenther@suse.de>
PR middle-end/34971
* expr.c (expand_expr_real_1): Assert on rotates that operate
on partial modes.
* fold-const.c (fold_binary): Use the types precision, not the
bitsize of the mode if folding rotate expressions. Build rotates
only for full modes.
* gcc.c-torture/execute/pr34971.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132706 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 36741918fb3..79a039a529f 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -8898,10 +8898,16 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, case BIT_XOR_EXPR: goto binop; - case LSHIFT_EXPR: - case RSHIFT_EXPR: case LROTATE_EXPR: case RROTATE_EXPR: + /* The expansion code only handles expansion of mode precision + rotates. */ + gcc_assert (GET_MODE_PRECISION (TYPE_MODE (type)) + == TYPE_PRECISION (type)); + + /* Falltrough. */ + case LSHIFT_EXPR: + case RSHIFT_EXPR: /* If this is a fixed-point operation, then we cannot use the code below because "expand_shift" doesn't support sat/no-sat fixed-point shifts. */ |