From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A593F3858022; Mon, 26 Jun 2023 07:30:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A593F3858022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687764634; bh=9jJTUM2aSUo5cdalN+gxAjXY0j7Yi53TNmRCejzpwlI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tpzqZsf8HK3mZLB4bT1VYNP14OSE51Y69yWIcT0jBXBtPPrQzcGdui9USOs3uF88i 0Gf3+IpbvVYVn0uXEW23kKW0xT0PzCQi78GZE777RTYymF7u+IURSYirVBaERd/b6l rbmpSDzh55LYyOds5p+xPDvg+aQxr5+pZxGtu/ts= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110018] Missing vectorizable_conversion(unsigned char -> double) for BB vectorizer Date: Mon, 26 Jun 2023 07:30:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D110018 --- Comment #9 from CVS Commits --- The master branch has been updated by hongtao Liu : https://gcc.gnu.org/g:77a50c772771f681085922b493922516c3c03e9a commit r14-2085-g77a50c772771f681085922b493922516c3c03e9a Author: liuhongt Date: Sun Jun 25 11:35:09 2023 +0800 Don't use intermiediate type for FIX_TRUNC_EXPR when ftrapping-math. > > Hmm, good question. GENERIC has a direct truncation to unsigned ch= ar > > for example, the C standard generally says if the integral part can= not > > be represented then the behavior is undefined. So I think we shoul= d be > > safe here (0x1.0p32 doesn't fit an int). > > We should be following Annex F (unspecified value plus "invalid" exception > for out-of-range floating-to-integer conversions rather than undefined > behavior). But we don't achieve that very well at present (see bug 9= 3806 > comments 27-29 for examples of how such conversions produce wobbly > values). That would mean guarding this with !flag_trapping_math would be the appropriate thing to do. gcc/ChangeLog: PR tree-optimization/110371 PR tree-optimization/110018 * tree-vect-stmts.cc (vectorizable_conversion): Don't use intermiediate type for FIX_TRUNC_EXPR when ftrapping-math. gcc/testsuite/ChangeLog: * gcc.target/i386/pr110018-1.c: Add -fno-trapping-math to dg-options. * gcc.target/i386/pr110018-2.c: Ditto.=