From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 82BDD3861841; Wed, 1 Jul 2020 15:46:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 82BDD3861841 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593618398; bh=pRuRaTA9/47U+qu2pcLIIJib1nD7T+vqfZDNUCxPLeA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pTompHDQt9S6/T9LX49bv6FIWZval5/Xh/vUFc9SRoJcDgWZE/rWN1Hds6J51PmfU RYTDNMnsjtQUrJbfO2owJXDf8lFTenJ0IcnU8lXTEJTxUMSG+L7satsGMF3gXP/ldZ GE/WRSGFG2fYi3U7odi4wA/Xoxe/vMzfHlbOzSvo= From: "slyfox at inbox dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/96015] [10/11 Regression] gcc-10.1.0 miscompiles Python on hppa Date: Wed, 01 Jul 2020 15:46:38 +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: 10.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at inbox dot ru 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: 10.2 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, 01 Jul 2020 15:46:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96015 --- Comment #11 from Sergei Trofimovich --- Looking at -fdump-tree-all: $gcc/xgcc -B$gcc -lm -Wsign-compare -Wall -fno-PIE -no-pie -fno-stack-protector -O2 -S bug_test.c -o bad-bug.S -fdump-tree-all I see that stores are eliminated at 'bad-bug.c.191t.cddce3' stage: Was (at bad-bug.c.190t.dse3): """ __attribute__((noipa, noinline, noclone, no_icf)) long_richcompare (int * self, int * other, int op) { int sign; int result; int _1; int _2; int _5; int prephitmp_6; int _13; int _16; [local count: 1073741823]: _1 =3D yes (); if (_1 =3D=3D 0) goto ; [51.12%] else goto ; [48.88%] [local count: 524844999]: _2 =3D yes (); if (_2 =3D=3D 0) goto ; [34.00%] else goto ; [66.00%] [local count: 346397698]: if (self_11(D) =3D=3D other_12(D)) goto ; [30.00%] else goto ; [70.00%] [local count: 242478389]: _13 =3D *self_11(D); _16 =3D *other_12(D); sign_17 =3D _13 - _16; if (sign_17 =3D=3D 0) goto ; [34.00%] else goto ; [66.00%] [local count: 160035736]: goto ; [100.00%] [local count: 103919309]: switch (op_14(D)) [33.33%], case 0: [16.67%], case 1: [33.33%], case 3: [33.33%], case 5: [16.67%]> [local count: 23093180]: : goto ; [100.00%] [local count: 115465900]: # prephitmp_6 =3D PHI <0(13), 1(7)> : goto ; [100.00%] [count: 0]: : __builtin_unreachable (); [local count: 727344125]: [local count: 1073741824]: # _5 =3D PHI <0(13), prephitmp_6(9), 0(11), 0(8), 1(7)> : return _5; [local count: 242478389]: # result_21 =3D PHI <1(5), sign_17(6)> switch (op_14(D)) [33.33%], case 0: [16.67%], case 1: [50.00%], case 3: [50.00%], case 5: [50.00%]> } """ Became (at bad-bug.c.191t.cddce3): """ Removing basic block 5 __attribute__((noipa, noinline, noclone, no_icf)) long_richcompare (int * self, int * other, int op) { int sign; int result; int _1; int _2; int _5; int prephitmp_6; [local count: 1073741823]: _1 =3D yes (); if (_1 =3D=3D 0) goto ; [51.12%] else goto ; [48.88%] [local count: 524844999]: _2 =3D yes (); if (_2 =3D=3D 0) goto ; [34.00%] else goto ; [66.00%] [local count: 346397698]: if (self_11(D) =3D=3D other_12(D)) goto ; [30.00%] else goto ; [70.00%] [local count: 103919309]: switch (op_14(D)) [33.33%], case 0: [16.67%], case 1: [33.33%], case 3: [33.33%], case 5: [16.67%]> [local count: 23093180]: : goto ; [100.00%] [local count: 115465900]: # prephitmp_6 =3D PHI <0(11), 1(5)> : goto ; [100.00%] [count: 0]: : __builtin_unreachable (); [local count: 727344125]: [local count: 1073741824]: # _5 =3D PHI <0(11), prephitmp_6(7), 0(9), 0(6), 1(5)> : return _5; [local count: 242478389]: switch (op_14(D)) [33.33%], case 0: [16.67%], case 1: [50.00%], case 3: [50.00%], case 5: [50.00%]> } """ Note: the following block disappeared completely: """ [local count: 242478389]: _13 =3D *self_11(D); _16 =3D *other_12(D); """=