diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2014-12-12 20:11:10 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2014-12-12 20:11:10 +0000 |
commit | f66af4aa7fe664c2a2b3172b1a32002c6d5317f8 (patch) | |
tree | 73a1ac6159c8150cb22eff72c59163fb46ebb19f /gcc | |
parent | 88c7eae209d973c8f7e72ba199e4153aef18992b (diff) | |
download | gcc-f66af4aa7fe664c2a2b3172b1a32002c6d5317f8.zip gcc-f66af4aa7fe664c2a2b3172b1a32002c6d5317f8.tar.gz gcc-f66af4aa7fe664c2a2b3172b1a32002c6d5317f8.tar.bz2 |
re PR rtl-optimization/64110 (ICE: Max. number of generated reload insns per insn is achieved (90))
2014-12-12 Vladimir Makarov <vmakarov@redhat.com>
PR target/64110
* lra-constraints.c (process_alt_operands): Refuse alternative
when reload pseudo of given class can not hold value of given
mode.
2014-12-12 Vladimir Makarov <vmakarov@redhat.com>
PR target/64110
* gcc.target/i386/pr64110.c: New.
From-SVN: r218688
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/lra-constraints.c | 23 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr64110.c | 17 |
4 files changed, 52 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3a20032..689c4fd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-12-12 Vladimir Makarov <vmakarov@redhat.com> + + PR target/64110 + * lra-constraints.c (process_alt_operands): Refuse alternative + when reload pseudo of given class can not hold value of given + mode. + 2014-12-12 Thomas Schwinge <thomas@codesourcery.com> * gimple-walk.c (walk_gimple_op) <GIMPLE_OMP_FOR>: Also check diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index e9d8bf6..e0d4c19 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -2267,6 +2267,29 @@ process_alt_operands (int only_alternative) goto fail; } + /* Alternative loses if it required class pseudo can not + hold value of required mode. Such insns can be + described by insn definitions with mode iterators. + Don't use ira_prohibited_class_mode_regs here as it + is common practice for constraints to use a class + which does not have actually enough regs to hold the + value (e.g. x86 AREG for mode requiring more one + general reg). */ + if (GET_MODE (*curr_id->operand_loc[nop]) != VOIDmode + && ! hard_reg_set_empty_p (this_alternative_set) + && ! HARD_REGNO_MODE_OK (ira_class_hard_regs + [this_alternative][0], + GET_MODE (*curr_id->operand_loc[nop]))) + { + if (lra_dump_file != NULL) + fprintf + (lra_dump_file, + " alt=%d: reload pseudo for op %d " + " can not hold the mode value -- refuse\n", + nalt, nop); + goto fail; + } + /* Check strong discouragement of reload of non-constant into class THIS_ALTERNATIVE. */ if (! CONSTANT_P (op) && ! no_regs_p diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f2502ff..d0796b6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-12 Vladimir Makarov <vmakarov@redhat.com> + + PR target/64110 + * gcc.target/i386/pr64110.c: New. + 2014-12-12 Thomas Schwinge <thomas@codesourcery.com> * c-c++-common/gomp/nesting-1.c: New file. diff --git a/gcc/testsuite/gcc.target/i386/pr64110.c b/gcc/testsuite/gcc.target/i386/pr64110.c new file mode 100644 index 0000000..84d8843 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr64110.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=core-avx2" } */ + +int foo (void); +int a; +short *b; + +void +bar (short x) +{ + while (a--) + { + int i, j = foo (); + for (i = 0; i < j; ++i) + *b++ = x; + } +} |