diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-06-14 15:35:06 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-06-14 15:35:06 +0200 |
commit | 75b5bc017bbeb83768564a3bd8128e382d327102 (patch) | |
tree | fbdf198a6c3f99aadacfcc2a274072d316ded024 | |
parent | 977ac63eab69884aa8d4bd317d7c1b80627d75ef (diff) | |
download | gcc-75b5bc017bbeb83768564a3bd8128e382d327102.zip gcc-75b5bc017bbeb83768564a3bd8128e382d327102.tar.gz gcc-75b5bc017bbeb83768564a3bd8128e382d327102.tar.bz2 |
re PR target/85945 (ICE in resolve_subreg_use, at lower-subreg.c:751)
PR target/85945
* lower-subreg.c (find_decomposable_subregs): Don't decompose float
subregs of multi-word pseudos unless the float mode has word size.
* gcc.c-torture/compile/pr85945.c: New test.
From-SVN: r261593
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lower-subreg.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr85945.c | 16 |
4 files changed, 37 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2697048..65284fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-06-14 Jakub Jelinek <jakub@redhat.com> + + PR target/85945 + * lower-subreg.c (find_decomposable_subregs): Don't decompose float + subregs of multi-word pseudos unless the float mode has word size. + 2018-06-14 Richard Biener <rguenther@suse.de> PR middle-end/86139 diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c index 32e70dc..72818b8 100644 --- a/gcc/lower-subreg.c +++ b/gcc/lower-subreg.c @@ -497,7 +497,16 @@ find_decomposable_subregs (rtx *loc, enum classify_move_insn *pcmi) were the same number and size of pieces. Hopefully this doesn't happen much. */ - if (outer_words == 1 && inner_words > 1) + if (outer_words == 1 + && inner_words > 1 + /* Don't allow to decompose floating point subregs of + multi-word pseudos if the floating point mode does + not have word size, because otherwise we'd generate + a subreg with that floating mode from a different + sized integral pseudo which is not allowed by + validate_subreg. */ + && (!FLOAT_MODE_P (GET_MODE (x)) + || outer_size == UNITS_PER_WORD)) { bitmap_set_bit (decomposable_context, regno); iter.skip_subrtxes (); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1286073..74e5d85 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-06-14 Jakub Jelinek <jakub@redhat.com> + + PR target/85945 + * gcc.c-torture/compile/pr85945.c: New test. + 2018-06-14 Richard Biener <rguenther@suse.de> PR ipa/86124 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr85945.c b/gcc/testsuite/gcc.c-torture/compile/pr85945.c new file mode 100644 index 0000000..93b2023 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr85945.c @@ -0,0 +1,16 @@ +/* PR target/85945 */ + +typedef float V __attribute__((vector_size(16))); +union U { V v; float f[4]; }; +int f; +float g[4]; + +void +foo (void) +{ + V d; + union U i; + i.v = d; + for (f = 0; f < 4; f++) + g[f] = i.f[f]; +} |