From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D7B5D3861800; Wed, 10 Mar 2021 05:00:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7B5D3861800 From: "aoliva at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99372] gimplefe-28.c ICEs when sqrt insn is not available Date: Wed, 10 Mar 2021 05:00:15 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aoliva at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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 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: Wed, 10 Mar 2021 05:00:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99372 --- Comment #2 from Alexandre Oliva --- I didn't mean that the testcase didn't check, I meant that the gimple parser didn't check. It swallows the .SQRT call even though it the attempt to exp= and the call will ICE because there's no usable opcode: [aoliva@gcc1-power7 gcc]$ ./xgcc -B./ ../../gcc/testsuite/gcc.dg/gimplefe-2= 8.c - fgimple -msoft-float during RTL pass: expand=20=20=20 ../../gcc/testsuite/gcc.dg/gimplefe-28.c: In function =E2=80=98f1=E2=80=99: ../../gcc/testsuite/gcc.dg/gimplefe-28.c:6:1: internal compiler error: in expand _direct_optab_fn, at internal-fn.c:3360 6 | f1 (double x) | ^~ 0x10d017d7 expand_direct_optab_fn ../../gcc/internal-fn.c:3360 0x10d076bf expand_SQRT ../../gcc/internal-fn.def:256 0x10d09187 expand_internal_call(internal_fn, gcall*) ../../gcc/internal-fn.c:4079 0x10d091db expand_internal_call(gcall*) ../../gcc/internal-fn.c:4087 0x1087e637 expand_call_stmt ../../gcc/cfgexpand.c:2749 [...] internal-fn.c:3359: insn_code icode =3D direct_optab_handler (optab, TYPE_MODE (types.first)); gcc_assert (icode !=3D CODE_FOR_nothing); As an altenative for the gimple parser's checking, I suppose we could have = an expander that fell back to a regular function call, though the assert check suggests we didn't expect the intrinsic call to be present when the opcode = is not available. cdce3.c suggests other parts of the compiler can tell, ahead of expand, whe= ther a sqrt insn is available, to decide whether or not to shrink-wrap, so it mi= ght make sense to use the same test here. I haven't identified what the early = test is.=