From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6B875384A01D; Thu, 10 Dec 2020 10:01:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B875384A01D From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98211] [11 Regression] Wrong code at -O3 since r11-4482-gb626b00823af9ca9 Date: Thu, 10 Dec 2020 10:01:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2020 10:01:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98211 --- Comment #7 from Richard Biener --- Hmm, OK, so besides the incomplete bool pattern matching the issue seems to= be that while we reject the problematic conversion in vectorizable_conversion = it slips through via vectorizable_assignment because it does /* Conversion between boolean types of different sizes is a simple assignment in case their vectypes are same boolean vectors. */ && (!VECTOR_BOOLEAN_TYPE_P (vectype) || !VECTOR_BOOLEAN_TYPE_P (vectype_in))) as opposed to vectorizable_conversions if (VECTOR_BOOLEAN_TYPE_P (vectype_out) && !VECTOR_BOOLEAN_TYPE_P (vectype_in)) that was added by g:2dab46d5fc9f95de16bd9bf0f219be5e64324d1f without a test= case or PR reference so it's difficult to tell what it was supposed to allow. N= ow, for the case in question the conversion would have slipped though anyway si= nce the only difference in the types is the sign and that one is BOOLEAN_TYPE and the other INTEGER_TYPE. So the exception above seems to intent to allow conversions with different precisions (note we now have precision 1 for all vector bools). So I'm going to just copy the vectorizable_conversion condition into vectorizable_assignment as well.=