From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 530313858D35; Fri, 9 Jun 2023 10:10:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 530313858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686305409; bh=oZDQ7tZHUUl3XnhJ9/TuqOZXkEdcNJ/F3JTM9NMvVZU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=d6d01LctW+gBBlU7xgemVreTWCVhKyqjBFcqruf+GH9uGgGTF3rGGb/p1m9VnzVGi wjX7L78cuAhzk9Y2+aZx7pnr/gU6VHFigqfDYiOWCwsEW+31GINzBG7hPuRTNnrsG6 6qNjSbMQJYNpc5nTXY4FNNDtiZvESfA9fUhkv0a4= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110182] [11/12 Regression] Vector(2) cast from double to float and back and subtraction seems to produce incorrect results Date: Fri, 09 Jun 2023 10:10:08 +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: 13.1.1 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: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc cf_known_to_work cf_known_to_fail 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=3D110182 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[11/12/13/14 Regression] |[11/12 Regression] |Vector(2) cast from double |Vector(2) cast from double |to float and back and |to float and back and |subtraction seems to |subtraction seems to |produce incorrect results |produce incorrect results Known to work| |13.1.1, 14.0 Known to fail| |13.1.0 --- Comment #6 from Richard Biener --- Fixed on trunk and GCC 13 branch sofar. Not my day writing commit logs tho= ugh ... commit b6118b8155a679ced926e8ff900e0ed969cd23a7 (HEAD -> gcc-13, origin/releases/gcc-13) Author: Richard Biener Date: Fri Jun 9 09:29:09 2023 +0200 middle-end/110182 - TYPE_PRECISION on VECTOR_TYPE causes wrong-code When folding two conversions in a row we use TYPE_PRECISION but that's invalid for VECTOR_TYPE. The following fixes this by using element_precision instead. middle-end/110182 * match.pd (two conversions in a row): Use element_precision to DTRT for VECTOR_TYPE. (cherry picked from commit 3e12669a0eb968cfcbe9242b382fd8020935edf8)=