https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108776
Richard Biener <rguenth at gcc dot gnu.org> 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 <rguenth at gcc dot gnu.org> ---
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=2, decl_uid=3331, cgraph_uid=3,
symbol_order=2)
326 range_of_expr(y_11(D)) at stmt _2 = _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=2, decl_uid=3954, cgraph_uid=3,
symbol_order=2)
299 range_of_expr(y_11(D)) at stmt _2 = _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 VARYING
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 =[irange] _Bool [0, 0] NONZERO 0x0
GORI Computes y_11(D) = [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 BB2
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 =[irange] _Bool [1, 1]
GORI Computes y_11(D) = [irange] unsigned int [9, +INF] intersect
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) != 16)
GORI LHS =[irange] _Bool [0, 0] NONZERO 0x0
GORI Computes y_11(D) = [irange] unsigned int [16, 16] NONZERO
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 [16,
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 = _16;
Removing dead stmt _14 = _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:
<bb 2> :
if (y_11(D) > 8)
goto <bb 3>; [INV]
else
goto <bb 5>; [INV]
<bb 3> :
if (y_11(D) != 16)
goto <bb 4>; [INV]
else
goto <bb 5>; [INV]
x86_64:
<bb 2> :
_1 = y_14(D) > 8;
_2 = y_14(D) != 16;
_3 = _1 & _2;
if (_3 != 0)
goto <bb 3>; [INV]
else
goto <bb 4>; [INV]
Setting --param logical-op-non-short-circuit=1 fixes the testcase for ppc64le
on the branch, I suspect it will be the same for s390x.