From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 40E173858414; Thu, 11 May 2023 07:13:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 40E173858414 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683789238; bh=x5wNvFNusUPJSROHaldFtnNC+KpIgBWhbD0vbrTQSs8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GCNutQwoGgIbTw2L9m9rX8ICF2HVnNDXQFhyExYQgoiFE2eQGLsgXCG+GbhuARgLG wfN8n5KZFyJaHlmqSp5NF7V1biRo85PhvtLIo0Y+01Zbh4RfcxF+u22g75QmArCnjk mNpGa2AIWCE2aqXlVd5qOsDVra37n3iKg1kZWKr8= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/108776] new test case c-c++-common/rotate-11.c from r12-9158-ga015ebe382cd6d fails Date: Thu, 11 May 2023 07:13:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: testsuite X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cf_gcctarget everconfirmed bug_status cc cf_reconfirmed_on 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=3D108776 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Target|powerpc64le-linux-gnu |powerpc64le-linux-gnu | |s390x-linux-gnu Ever confirmed|0 |1 Status|UNCONFIRMED |NEW CC| |rguenth at gcc dot gnu.org Last reconfirmed| |2023-05-11 --- Comment #1 from Richard Biener --- Also fails on s390x. On ppc64le we only have four r<<, baz() and qux() are not handled (why do we have 6 functions but expect 5 rotates only without checking exactly which function we expect not to transform?). On trunk we handle baz() fine but still do not handle qux(). The IL into forwprop1 is the same so it's likely differences in ranger behavior triggering here. branch: ;; Function baz (baz, funcdef_no=3D2, decl_uid=3D3331, cgraph_uid=3D3, symbol_order=3D2) 326 range_of_expr(y_11(D)) at stmt _2 =3D _1 << y_11(D); 327 range_on_entry (y_11(D)) to BB 5 328 range_of_stmt (y_11(D)) at stmt GIMPLE_NOP GLOBAL : UPDATE cache for y_11(D) in BB 0 : successors : : No updates! TRUE : (328) range_of_stmt (y_11(D)) unsigned int VARYING y_11(D) : CACHE: BB 5 DOM query, found unsigned int VARYING at BB0 CACHE: Range for DOM returns : unsigned int VARYING Filled from dominator! : unsigned int VARYING TRUE : (327) range_on_entry (y_11(D)) unsigned int VARYING TRUE : (326) range_of_expr (y_11(D)) unsigned int VARYING unsigned char baz (unsigned char x, unsigned int y) trunk: ;; Function baz (baz, funcdef_no=3D2, decl_uid=3D3954, cgraph_uid=3D3, symbol_order=3D2) 299 range_of_expr(y_11(D)) at stmt _2 =3D _1 << y_11(D); 300 range_on_entry (y_11(D)) to BB 5 301 range_of_stmt (y_11(D)) at stmt GIMPLE_NOP GLOBAL : UPDATE cache for y_11(D) in BB 0 : successors : : No updates! TRUE : (301) range_of_stmt (y_11(D)) [irange] unsigned int VAR= YING y_11(D) : CACHE: BB 5 DOM query for y_11(D), found [irange] unsigned int VARYING at BB0 302 GORI outgoing_edge for y_11(D) on edge 2->5 303 GORI compute op 1 (y_11(D)) at if (y_11(D) > 8) GORI LHS =3D[irange] _Bool [0, 0] NONZERO 0x0 GORI Computes y_11(D) =3D [irange] unsigned int [0, 8] NONZERO= 0xf intersect Known range : [irange] unsigned int VARYING GORI TRUE : (303) produces (y_11(D)) [irange] unsigned int [0, = 8] NONZERO 0xf GORI TRUE : (302) outgoing_edge (y_11(D)) [irange] unsigned int [0= , 8] NONZERO 0xf CACHE: BB 3 DOM query for y_11(D), found [irange] unsigned int VARYING at B= B2 304 GORI outgoing_edge for y_11(D) on edge 2->3 305 GORI compute op 1 (y_11(D)) at if (y_11(D) > 8) GORI LHS =3D[irange] _Bool [1, 1] GORI Computes y_11(D) =3D [irange] unsigned int [9, +INF] inte= rsect Known range : [irange] unsigned int VARYING GORI TRUE : (305) produces (y_11(D)) [irange] unsigned int [9, +INF] GORI TRUE : (304) outgoing_edge (y_11(D)) [irange] unsigned int [9, +INF] CACHE: Adjusted edge range for 2->3 : [irange] unsigned int [9, +INF] CACHE: Range for DOM returns : [irange] unsigned int [9, +INF] 306 GORI outgoing_edge for y_11(D) on edge 3->5 307 GORI compute op 1 (y_11(D)) at if (y_11(D) !=3D 16) GORI LHS =3D[irange] _Bool [0, 0] NONZERO 0x0 GORI Computes y_11(D) =3D [irange] unsigned int [16, 16] NONZE= RO 0x10 intersect Known range : [irange] unsigned int VARYING GORI TRUE : (307) produces (y_11(D)) [irange] unsigned int [16,= 16] NONZERO 0x10 GORI TRUE : (306) outgoing_edge (y_11(D)) [irange] unsigned int [1= 6, 16] NONZERO 0x10 CACHE: Range for DOM returns : [irange] unsigned int [0, 8][16, 16] NONZERO 0x1f Filled from dominator! : [irange] unsigned int [0, 8][16, 16] NONZERO 0x1f TRUE : (300) range_on_entry (y_11(D)) [irange] unsigned int [0, 8][16, 16] NONZERO 0x1f TRUE : (299) range_of_expr (y_11(D)) [irange] unsigned int [0, 8][= 16, 16] NONZERO 0x1f gimple_simplified to _14 =3D _16; Removing dead stmt _14 =3D _16; unsigned char baz (unsigned char x, unsigned int y) On x86_64 the IL into forwprop1 is different (logical-op-non-short-circuit): ppc64le: : if (y_11(D) > 8) goto ; [INV] else goto ; [INV] : if (y_11(D) !=3D 16) goto ; [INV] else goto ; [INV] x86_64: : _1 =3D y_14(D) > 8; _2 =3D y_14(D) !=3D 16; _3 =3D _1 & _2; if (_3 !=3D 0) goto ; [INV] else goto ; [INV] Setting --param logical-op-non-short-circuit=3D1 fixes the testcase for ppc= 64le on the branch, I suspect it will be the same for s390x.=