From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A65C43858438; Tue, 16 Nov 2021 09:44:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A65C43858438 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103253] [12 Regression] ICE: Segmentation fault (in convert_mult_to_fma or in vect_recog_mask_conversion_pattern) since r12-5129-g8ed62c929c7c4462 Date: Tue, 16 Nov 2021 09:44:45 +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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: tnfchris at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.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: Tue, 16 Nov 2021 09:44:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103253 --- Comment #8 from rguenther at suse dot de --- On Tue, 16 Nov 2021, tnfchris at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103253 >=20 > --- Comment #7 from Tamar Christina --- > > .COND_MUL might raise an exception and DCE removes unused LHS of calls.= Looks like FMA analysis doesn't like internal fns w/o a LHS? >=20 > That makes sense, it looks like it needs the LHS to find the uses to see = if > it's an ADD. So likely `convert_mult_to_fma` should return false if ther= e's no > LHS as there are no uses then and it can't be an FMA. Yes. As said, it's odd that .COND_MUL prevails, so maybe sth is wrong with its attribute spec. Ah, I think it's the "old" issue of internal-fn.def not being sensitive to -fno-trapping-math. Generally ECF_NOTHROW would be wrong here but with -fno-trapping-math it would be OK. We might want to eventually special-case some of the internal fns in internal_fn_flags? Or have a special ECF_FP_TRAP which we'd rewrite in internal_fn_flags based on flag_trapping_math (but we'd need a caller context to be able to lookup the correct flag_trapping_math here). Alternatively whoever adds those patterns should mark the GIMPLE call as gimple_call_nothrow (that might be genmatch generated code in this case).=