public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] i386: Fix endless recursion in ix86_expand_vector_init_general with MMX [PR110152]
@ 2023-06-07 16:51 Jakub Jelinek
  2023-06-08  5:53 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2023-06-07 16:51 UTC (permalink / raw)
  To: Uros Bizjak, Richard Biener; +Cc: gcc-patches

Hi!

I'm getting
+FAIL: gcc.target/i386/3dnow-1.c (internal compiler error: Segmentation fault signal terminated program cc1)
+FAIL: gcc.target/i386/3dnow-1.c (test for excess errors)
+FAIL: gcc.target/i386/3dnow-2.c (internal compiler error: Segmentation fault signal terminated program cc1)
+FAIL: gcc.target/i386/3dnow-2.c (test for excess errors)
+FAIL: gcc.target/i386/mmx-1.c (internal compiler error: Segmentation fault signal terminated program cc1)
+FAIL: gcc.target/i386/mmx-1.c (test for excess errors)
+FAIL: gcc.target/i386/mmx-2.c (internal compiler error: Segmentation fault signal terminated program cc1)
+FAIL: gcc.target/i386/mmx-2.c (test for excess errors)
regressions on i686-linux since r14-1166.  The problem is when
ix86_expand_vector_init_general is called with mmx_ok = true and
mode = V4HImode, it newly recurses with mmx_ok = false and mode = V2SImode,
but as mmx_ok is false and !TARGET_SSE, we recurse again with the same
arguments (ok, fresh new tmp and vals) infinitely.
The following patch fixes that by passing mmx_ok to that recursive call.
For n_words == 4 it isn't needed, because we only care about mmx_ok for
V2SImode or V2SFmode and no other modes.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2023-06-07  Jakub Jelinek  <jakub@redhat.com>

	PR target/110152
	* config/i386/i386-expand.cc (ix86_expand_vector_init_general): For
	n_words == 2 recurse with mmx_ok as first argument rather than false.

--- gcc/config/i386/i386-expand.cc.jj	2023-06-03 15:32:04.489410367 +0200
+++ gcc/config/i386/i386-expand.cc	2023-06-07 10:31:34.715981752 +0200
@@ -16371,7 +16371,7 @@ quarter:
 	  machine_mode concat_mode = tmp_mode == DImode ? V2DImode : V2SImode;
 	  rtx tmp = gen_reg_rtx (concat_mode);
 	  vals = gen_rtx_PARALLEL (concat_mode, gen_rtvec_v (2, words));
-	  ix86_expand_vector_init_general (false, concat_mode, tmp, vals);
+	  ix86_expand_vector_init_general (mmx_ok, concat_mode, tmp, vals);
 	  emit_move_insn (target, gen_lowpart (mode, tmp));
 	}
       else if (n_words == 4)

	Jakub


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] i386: Fix endless recursion in ix86_expand_vector_init_general with MMX [PR110152]
  2023-06-07 16:51 [PATCH] i386: Fix endless recursion in ix86_expand_vector_init_general with MMX [PR110152] Jakub Jelinek
@ 2023-06-08  5:53 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2023-06-08  5:53 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Uros Bizjak, gcc-patches



> Am 07.06.2023 um 18:52 schrieb Jakub Jelinek via Gcc-patches <gcc-patches@gcc.gnu.org>:
> 
> Hi!
> 
> I'm getting
> +FAIL: gcc.target/i386/3dnow-1.c (internal compiler error: Segmentation fault signal terminated program cc1)
> +FAIL: gcc.target/i386/3dnow-1.c (test for excess errors)
> +FAIL: gcc.target/i386/3dnow-2.c (internal compiler error: Segmentation fault signal terminated program cc1)
> +FAIL: gcc.target/i386/3dnow-2.c (test for excess errors)
> +FAIL: gcc.target/i386/mmx-1.c (internal compiler error: Segmentation fault signal terminated program cc1)
> +FAIL: gcc.target/i386/mmx-1.c (test for excess errors)
> +FAIL: gcc.target/i386/mmx-2.c (internal compiler error: Segmentation fault signal terminated program cc1)
> +FAIL: gcc.target/i386/mmx-2.c (test for excess errors)
> regressions on i686-linux since r14-1166.  The problem is when
> ix86_expand_vector_init_general is called with mmx_ok = true and
> mode = V4HImode, it newly recurses with mmx_ok = false and mode = V2SImode,
> but as mmx_ok is false and !TARGET_SSE, we recurse again with the same
> arguments (ok, fresh new tmp and vals) infinitely.
> The following patch fixes that by passing mmx_ok to that recursive call.
> For n_words == 4 it isn't needed, because we only care about mmx_ok for
> V2SImode or V2SFmode and no other modes.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Ok.

Richard 

> 2023-06-07  Jakub Jelinek  <jakub@redhat.com>
> 
>    PR target/110152
>    * config/i386/i386-expand.cc (ix86_expand_vector_init_general): For
>    n_words == 2 recurse with mmx_ok as first argument rather than false.
> 
> --- gcc/config/i386/i386-expand.cc.jj    2023-06-03 15:32:04.489410367 +0200
> +++ gcc/config/i386/i386-expand.cc    2023-06-07 10:31:34.715981752 +0200
> @@ -16371,7 +16371,7 @@ quarter:
>      machine_mode concat_mode = tmp_mode == DImode ? V2DImode : V2SImode;
>      rtx tmp = gen_reg_rtx (concat_mode);
>      vals = gen_rtx_PARALLEL (concat_mode, gen_rtvec_v (2, words));
> -      ix86_expand_vector_init_general (false, concat_mode, tmp, vals);
> +      ix86_expand_vector_init_general (mmx_ok, concat_mode, tmp, vals);
>      emit_move_insn (target, gen_lowpart (mode, tmp));
>    }
>       else if (n_words == 4)
> 
>    Jakub
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-08  5:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-07 16:51 [PATCH] i386: Fix endless recursion in ix86_expand_vector_init_general with MMX [PR110152] Jakub Jelinek
2023-06-08  5:53 ` Richard Biener

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).