From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EAF5C3858C39; Wed, 10 Apr 2024 13:39:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAF5C3858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712756368; bh=lMu52alTeEJpnjms09teG06oSgcdvPg5xii0GLdj8ZI=; h=From:To:Subject:Date:From; b=YrYu/rBmbJcPsSSFIhWAVAwadn3qAvB6Od032ZIt0U4WxCk/t1cptXR2bIhKE2FAX UNcqeYMslZJ5ILUAsvgciGZQBrBuXdwDVhlAuGr3wKFKuSnZYjq/H3idWV/B6cUXVK vJFGSm2r5+s0FSltYrvEswNQjUVSKmbp/vy3qBHg= From: "stefansf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114678] New: FAIL: gcc.dg/tree-ssa/range-sincos.c scan-tree-dump-not evrp "link_error" on s390 Date: Wed, 10 Apr 2024 13:39:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: stefansf 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcctarget Message-ID: 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=3D114678 Bug ID: 114678 Summary: FAIL: gcc.dg/tree-ssa/range-sincos.c scan-tree-dump-not evrp "link_error" on s390 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: stefansf at gcc dot gnu.org Target Milestone: --- Target: s390*-*-* FAIL: gcc.dg/tree-ssa/range-sincos.c scan-tree-dump-not evrp "link_error" I assume this is due to the case that on s390 we have an isinf optab. Thus, prior evrp we end up with void bar (double x) { int _1; double _5; : _5 =3D sin (x_4(D)); if (_5 ord _5) goto ; [INV] else goto ; [INV] : _1 =3D __builtin_isinf (x_4(D)); if (_1 !=3D 0) goto ; [INV] else goto ; [INV] : link_error (); : return; } whereas, e.g., on x86-64 we have void bar (double x) { double _1; double _7; : _7 =3D sin (x_6(D)); if (_7 ord _7) goto ; [INV] else goto ; [INV] : if (x_6(D) unord x_6(D)) goto ; [INV] else goto ; [INV] : link_error (); : _1 =3D ABS_EXPR ; if (_1 u<=3D 1.79769313486231570814527423731704356798070567525844996599e+= 308) goto ; [INV] else goto ; [INV] : link_error (); : return; } If this optimization is all about ABS_EXPR the following patch would work on s390x and x86-64: @@ -24,20 +24,20 @@ bar (double x) { if (__builtin_isnan (x)) link_error (); - if (__builtin_isinf (x)) + if (__builtin_fabs (x) =3D=3D __builtin_inf ()) link_error (); } } However, I'm not sure whether this is not also a missed optimization in cas= e of an isinf optab?=