From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 74EA6383F841; Tue, 12 May 2020 13:46:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74EA6383F841 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589291169; bh=w9q6v1N1w4ulFPIN8Im3Jt76jLJNjG5N2qQbaGcKk20=; h=From:To:Subject:Date:From; b=akXlhI6KJFGfHjIl5cPPZjbRDiQ6RpLu7SKT4nlgEX4AN5HvV4vbivMOtTDXTzKTq +TCcb3OXtcuY/fJRNBuUVSY7KQvRHz460T/k64rYP8gNk79x7BWYz7Fh4g8lHtTIXZ eRMrLDZzH+XKlpMC7H82bywb+JgZ2WWjL7MChmPo= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/95084] New: code sinking prevents if-conversion Date: Tue, 12 May 2020 13:46:09 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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 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 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, 12 May 2020 13:46:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95084 Bug ID: 95084 Summary: code sinking prevents if-conversion Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- There's a pass ordering issue between the sink pass and tree-if-conv, if conversion for vectorization. When sink sinks a possibly trapping operation to a place that is only conditionally executed if-conversion fails which results in failed vectorization. This can be seen with https://gcc.gnu.org/pipermail/gcc-patches/2020-May/545588.html applied for gcc.dg/vect/pr56541.c (and it's ifcvt counterpart gcc.dg/tree-ssa/ifc-pr56541.c). But I've also seen this in other context. Here iftmp.2_17 =3D rR_19 < rL_20 ? rR_19 : rL_20; iftmp.3_3 =3D rR_19 < rL_20 ? rL_20 : rR_19; if (iftmp.3_3 > 0.0) goto ; [INV] else goto ; [INV] : : # iftmp.4_14 =3D PHI if (iftmp.4_14 > 0.0) becomes iftmp.3_3 =3D rR_17 < rL_18 ? rL_18 : rR_17; if (iftmp.3_3 > 0.0) goto ; [59.00%] else goto ; [41.00%] [local count: 435831803]: goto ; [100.00%] [local count: 627172605]: iftmp.2_15 =3D rR_17 < rL_18 ? rR_17 : rL_18; if (iftmp.2_15 > 0.0) and the now conditionally executed FP comparison can trap.=