diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-02-16 16:15:40 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-02-16 16:15:40 +0100 |
commit | 5aa7d94c2e02552095cd56bd36ca19db4cb58c9a (patch) | |
tree | b6733f347deabb26123cd915133b4007c4eda4c1 /gcc | |
parent | 87440c298eb2ed47166b8d57a4afc90d310f3a8f (diff) | |
download | gcc-5aa7d94c2e02552095cd56bd36ca19db4cb58c9a.zip gcc-5aa7d94c2e02552095cd56bd36ca19db4cb58c9a.tar.gz gcc-5aa7d94c2e02552095cd56bd36ca19db4cb58c9a.tar.bz2 |
re PR rtl-optimization/69764 (ICE on x86_64-linux-gnu at -O0 (in decompose, at rtl.h:2107))
PR rtl-optimization/69764
PR rtl-optimization/69771
* optabs.c (expand_binop): Ensure for shift optabs invalid CONST_INT
op1 is valid for GET_MODE_INNER (mode) and force it into a reg.
From-SVN: r233456
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/optabs.c | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7fd48ec..5eb8754 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-02-16 Jakub Jelinek <jakub@redhat.com> + + PR rtl-optimization/69764 + PR rtl-optimization/69771 + * optabs.c (expand_binop): Ensure for shift optabs invalid CONST_INT + op1 is valid for GET_MODE_INNER (mode) and force it into a reg. + 2016-02-16 Richard Biener <rguenther@suse.de> PR tree-optimization/69776 diff --git a/gcc/optabs.c b/gcc/optabs.c index b651878..a6d8822 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -1125,6 +1125,16 @@ expand_binop (machine_mode mode, optab binoptab, rtx op0, rtx op1, op1 = negate_rtx (mode, op1); binoptab = add_optab; } + /* For shifts, constant invalid op1 might be expanded from different + mode than MODE. As those are invalid, force them to a register + to avoid further problems during expansion. */ + else if (CONST_INT_P (op1) + && shift_optab_p (binoptab) + && UINTVAL (op1) >= GET_MODE_BITSIZE (GET_MODE_INNER (mode))) + { + op1 = gen_int_mode (INTVAL (op1), GET_MODE_INNER (mode)); + op1 = force_reg (GET_MODE_INNER (mode), op1); + } /* Record where to delete back to if we backtrack. */ last = get_last_insn (); |