From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5070E3858431; Tue, 28 Mar 2023 08:42:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5070E3858431 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1679992930; bh=l+C7cPJpAJJY5d8LLXUXYetvEhqGNvImkK+LxsSk6lA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EU7dPX94/aWLBZ34v2G2Wgxnhexo3bCM1V4jRL6J+DIlT9fJxqSOA8rbItABELmAT PsO9RjQyblNEie5yo7JRd3qJSlsKpCSi1pRLQTvvsLWPUu3oE+JKEdvqCZ5PtBm5VA 7GiSpdbbCy6nunKght4uIZjCJLPZQJRmaJG4QAwc= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/109140] [12/13 regression] internal error on array element comparison in loop with -O2 -mvis3 Date: Tue, 28 Mar 2023 08:42:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ebotcazou at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109140 --- Comment #14 from CVS Commits --- The master branch has been updated by Eric Botcazou : https://gcc.gnu.org/g:a21bd7faba67997a6da457dbda16f15bca1a9156 commit r13-6893-ga21bd7faba67997a6da457dbda16f15bca1a9156 Author: Eric Botcazou Date: Tue Mar 28 10:13:24 2023 +0200 Fix PR target/109140 This is a regression present on the mainline and 12 branch at -O2, but = the issue is related to vectorization so was present at -O3 in earlier versions. The vcondu expander that was added for VIS 3 more than a decade ago does not fully work, because it does not filter out the unsigned condition codes (the instruction is an UNSPEC that accepts only signed condition codes). While I was at it, I also added the missing vcond and vcondu expanders = for the new comparison instructions that were added in VIS 4. gcc/ PR target/109140 * config/sparc/sparc.cc (sparc_expand_vcond): Call signed_condi= tion on operand #3 to get the final condition code. Use std::swap. * config/sparc/sparc.md (vcondv8qiv8qi): New VIS 4 expander. (fucmp8_vis): Move around. (fpcmpu_vis): Likewise. (vcondu): New VIS 4 expander. gcc/testsuite/ * gcc.target/sparc/20230328-1.c: New test. * gcc.target/sparc/20230328-2.c: Likewise. * gcc.target/sparc/20230328-3.c: Likewise. * gcc.target/sparc/20230328-4.c: Likewise.=