* [PATCH] Fix up ix86_expand_adjust_ufix_to_sfix_si ICE (PR target/91931)
@ 2019-09-30 7:01 Jakub Jelinek
2019-09-30 7:10 ` Uros Bizjak
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2019-09-30 7:01 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches
Hi!
The recent SUBREG simplification changes aren't as forgiving in the past and
ICE on invalid constants, in this case CONST_VECTOR:V8SI with 8x CONST_INT
0x80000000 element, which is invalid, because for SImode it needs to be sign
extended.
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?
2019-09-30 Jakub Jelinek <jakub@redhat.com>
PR target/91931
* config/i386/i386-expand.c (ix86_expand_adjust_ufix_to_sfix_si): Use
gen_int_mode instead of GEN_INT.
* gcc.target/i386/pr91931.c: New test.
--- gcc/config/i386/i386-expand.c.jj 2019-09-10 20:08:44.931792487 +0200
+++ gcc/config/i386/i386-expand.c 2019-09-29 13:19:47.122382234 +0200
@@ -1694,7 +1694,7 @@ ix86_expand_adjust_ufix_to_sfix_si (rtx
OPTAB_DIRECT);
else
{
- rtx two31 = GEN_INT (HOST_WIDE_INT_1U << 31);
+ rtx two31 = gen_int_mode (HOST_WIDE_INT_1U << 31, SImode);
two31 = ix86_build_const_vector (intmode, 1, two31);
*xorp = expand_simple_binop (intmode, AND,
gen_lowpart (intmode, tmp[0]),
--- gcc/testsuite/gcc.target/i386/pr91931.c.jj 2019-09-29 13:22:58.502510721 +0200
+++ gcc/testsuite/gcc.target/i386/pr91931.c 2019-09-29 13:23:36.099946605 +0200
@@ -0,0 +1,5 @@
+/* PR target/91931 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-loop-vectorize -mavx -mno-avx2" } */
+
+#include "../../gcc.dg/vect/pr32216.c"
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix up ix86_expand_adjust_ufix_to_sfix_si ICE (PR target/91931)
2019-09-30 7:01 [PATCH] Fix up ix86_expand_adjust_ufix_to_sfix_si ICE (PR target/91931) Jakub Jelinek
@ 2019-09-30 7:10 ` Uros Bizjak
0 siblings, 0 replies; 2+ messages in thread
From: Uros Bizjak @ 2019-09-30 7:10 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: gcc-patches
On Mon, Sep 30, 2019 at 9:01 AM Jakub Jelinek <jakub@redhat.com> wrote:
>
> Hi!
>
> The recent SUBREG simplification changes aren't as forgiving in the past and
> ICE on invalid constants, in this case CONST_VECTOR:V8SI with 8x CONST_INT
> 0x80000000 element, which is invalid, because for SImode it needs to be sign
> extended.
>
> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
> trunk?
>
> 2019-09-30 Jakub Jelinek <jakub@redhat.com>
>
> PR target/91931
> * config/i386/i386-expand.c (ix86_expand_adjust_ufix_to_sfix_si): Use
> gen_int_mode instead of GEN_INT.
>
> * gcc.target/i386/pr91931.c: New test.
OK.
Thanks,
Uros.
> --- gcc/config/i386/i386-expand.c.jj 2019-09-10 20:08:44.931792487 +0200
> +++ gcc/config/i386/i386-expand.c 2019-09-29 13:19:47.122382234 +0200
> @@ -1694,7 +1694,7 @@ ix86_expand_adjust_ufix_to_sfix_si (rtx
> OPTAB_DIRECT);
> else
> {
> - rtx two31 = GEN_INT (HOST_WIDE_INT_1U << 31);
> + rtx two31 = gen_int_mode (HOST_WIDE_INT_1U << 31, SImode);
> two31 = ix86_build_const_vector (intmode, 1, two31);
> *xorp = expand_simple_binop (intmode, AND,
> gen_lowpart (intmode, tmp[0]),
> --- gcc/testsuite/gcc.target/i386/pr91931.c.jj 2019-09-29 13:22:58.502510721 +0200
> +++ gcc/testsuite/gcc.target/i386/pr91931.c 2019-09-29 13:23:36.099946605 +0200
> @@ -0,0 +1,5 @@
> +/* PR target/91931 */
> +/* { dg-do compile } */
> +/* { dg-options "-O1 -ftree-loop-vectorize -mavx -mno-avx2" } */
> +
> +#include "../../gcc.dg/vect/pr32216.c"
>
> Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-30 7:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-30 7:01 [PATCH] Fix up ix86_expand_adjust_ufix_to_sfix_si ICE (PR target/91931) Jakub Jelinek
2019-09-30 7:10 ` Uros Bizjak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).