From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 62B623858C62; Thu, 8 Jun 2023 08:12:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62B623858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686211976; bh=FqIkiOWD2phMQk5PqHl/q9arghHyzuCwGltiVIvRtk4=; h=From:To:Subject:Date:From; b=bIJvisXXXSwXQ9zZ6fZ3VhZsaO6NIuQreNaj6ZN1TivpS7i831NBbcWAVfeLwfsHz leanEbcVNIHEj/4lM3E7HdtiM7PE0vsHqv8EQEAu1EZmVflxr2yuF+TUFtsV2IqGvk Zufgd7g+tl5W0/Anp5sTkJwSQ4sQuTkayJEGt+tY= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-1630] i386: Fix endless recursion in ix86_expand_vector_init_general with MMX [PR110152] X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/heads/master X-Git-Oldrev: d08f2e4f74583e27002368989bba197f8eb7f6d2 X-Git-Newrev: 2b2bf793d3fb8980cb2b83e9e2a8c236ad2434f5 Message-Id: <20230608081256.62B623858C62@sourceware.org> Date: Thu, 8 Jun 2023 08:12:55 +0000 (GMT) List-Id: https://gcc.gnu.org/g:2b2bf793d3fb8980cb2b83e9e2a8c236ad2434f5 commit r14-1630-g2b2bf793d3fb8980cb2b83e9e2a8c236ad2434f5 Author: Jakub Jelinek Date: Thu Jun 8 10:11:25 2023 +0200 i386: Fix endless recursion in ix86_expand_vector_init_general with MMX [PR110152] 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. 2023-06-08 Jakub Jelinek 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. Diff: --- gcc/config/i386/i386-expand.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc index 697eb475f48..def060ab562 100644 --- a/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc @@ -16376,7 +16376,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)