This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Avoid simplifying RTL expressions in too large integral modes (PR target/68269)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 14 Jan 2016 15:31:07 +0100
- Subject: [PATCH] Avoid simplifying RTL expressions in too large integral modes (PR target/68269)
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
This PR is an ICE while expand_field_assignment attempts to "simplify"
some (zero_extract:DI (subreg:DI (reg:OI ...) 0) (const_int 32) (const_int 0))
or what on ia64. The problem is that ia64 and various other backends add
various very large integral modes (OI in this case, but x86_64 even XImode),
which are really meant just as subregs of corresponding vector modes,
holding arbitrary data in them, but aren't really supported for arithmetics.
Yet, expand_field_assignment looks through any SUBREGs and just blindly
assumes that it will get something reasonable out fo that. But, if
!TARGET_SUPPORTS_WIDE_INT, simplify-rtx.c will just ICE on that. For
TARGET_SUPPORTS_WIDE_INT, I bet all that will happen is that you get
something that really won't be matched anyway, so IMHO it is not worth
because of this to convert all targets to wide ints.
This patch just arranges to punt if compute_mode is not a supported mode.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2016-01-14 Jakub Jelinek <jakub@redhat.com>
PR target/68269
* combine.c (expand_field_assignment): Punt if compute_mode is
unsupported scalar mode.
--- gcc/combine.c.jj 2016-01-07 09:42:39.000000000 +0100
+++ gcc/combine.c 2016-01-13 17:09:22.474067565 +0100
@@ -7247,6 +7247,10 @@ expand_field_assignment (const_rtx x)
if (len >= HOST_BITS_PER_WIDE_INT)
break;
+ /* Don't try to compute in too wide unsupported modes. */
+ if (!targetm.scalar_mode_supported_p (compute_mode))
+ break;
+
/* Now compute the equivalent expression. Make a copy of INNER
for the SET_DEST in case it is a MEM into which we will substitute;
we don't want shared RTL in that case. */
Jakub