[go: nahoru, domu]

Bug 89551 - [9 regression] Test case gcc.dg/uninit-pred-8_b.c fails after r269302
Summary: [9 regression] Test case gcc.dg/uninit-pred-8_b.c fails after r269302
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 9.0
: P3 normal
Target Milestone: 9.0
Assignee: Richard Biener
URL:
Keywords: diagnostic
: 89717 (view as bug list)
Depends on:
Blocks: Wuninitialized 89497 89634
  Show dependency treegraph
 
Reported: 2019-03-01 16:13 UTC by seurer
Modified: 2019-03-15 11:08 UTC (History)
2 users (show)

See Also:
Host: powerpc64*-unknown-linux-gnu
Target: powerpc64*-unknown-linux-gnu
Build: powerpc64*-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2019-03-04 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description seurer 2019-03-01 16:13:53 UTC
New failures (update from 269300 to 269304):
FAIL: gcc.dg/uninit-pred-8_b.c bogus warning (test for bogus messages, line 20)
FAIL: gcc.dg/uninit-pred-8_b.c bogus warning (test for bogus messages, line 39)
FAIL: gcc.dg/uninit-pred-8_b.c warning (test for warnings, line 42)

spawn -ignore SIGHUP /home/seurer/gcc/build/gcc-test2/gcc/xgcc -B/home/seurer/gcc/build/gcc-test2/gcc/ /home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/uninit-pred-8_b.c -fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers -fdiagnostics-color=never -Wuninitialized -O2 -S -o uninit-pred-8_b.s
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/uninit-pred-8_b.c: In function 'foo':
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/uninit-pred-8_b.c:20:7: warning: 'v' may be used uninitialized in this function [-Wmaybe-uninitialized]
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/uninit-pred-8_b.c: In function 'foo_2':
/home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/uninit-pred-8_b.c:39:7: warning: 'v' may be used uninitialized in this function [-Wmaybe-uninitialized]
FAIL: gcc.dg/uninit-pred-8_b.c bogus warning (test for bogus messages, line 20)
PASS: gcc.dg/uninit-pred-8_b.c bogus warning (test for bogus messages, line 23)
FAIL: gcc.dg/uninit-pred-8_b.c bogus warning (test for bogus messages, line 39)
FAIL: gcc.dg/uninit-pred-8_b.c warning (test for warnings, line 42)
PASS: gcc.dg/uninit-pred-8_b.c (test for excess errors)
testcase /home/seurer/gcc/gcc-test2/gcc/testsuite/gcc.dg/dg.exp completed in 0 seconds

		=== gcc Summary ===

# of expected passes		2
# of unexpected failures	3
Comment 1 Richard Biener 2019-03-04 09:10:25 UTC
I will have a look.
Comment 2 Richard Biener 2019-03-04 10:22:21 UTC
The difference starts in DOM3 by the CFG cleanup change catching two more BB merging opportunities which then in VRP2 causes(?) extra jump threadings to happen (for whatever reason...).

On x86_64 we have different IL (branch-cost, logical-op-non-short-circuit)
so what happens is different.

The IL we hand off to the late uninit pass is not resembling the original
source in any way due to these threadings and the usual inabilities of
the uninit pass pop up.

--param logical-op-non-short-circuit=1 fixes the testcase on powerpc64le,
=0 makes it fail on x86_64.

I'll adjust the testcase, not sure if anybody wants to analyze why
jump threading goes berzerk here.

Note disabling DOM3 fixes the testcase as well - the effect is just
the extra forwarder and then in VRP2:

 Visiting statement:
 _2 = g.0_1 + 1;
-<<<< COPY m_19 = m_8(D)
-0>>> COPY m_20 = m_8(D)
+LKUP STMT n_7(D) le_expr 9
+FIND: 0
+LKUP STMT m_8(D) gt_expr 100
+FIND: 0
+  Registering jump thread: (6, 7) incoming edge;  (7, 8) joiner;  (8, 10) normal; (10, 11) nocopy;
 <<<< COPY m_20 = m_8(D)
+LKUP STMT n_7(D) le_expr 9
+FIND: 0
+  Registering jump thread: (6, 7) incoming edge;  (7, 9) joiner;  (9, 11) normal;

and more similar cases.
Comment 3 Richard Biener 2019-03-06 10:13:41 UTC
Author: rguenth
Date: Wed Mar  6 10:13:08 2019
New Revision: 269416

URL: https://gcc.gnu.org/viewcvs?rev=269416&root=gcc&view=rev
Log:
2019-03-06  Richard Biener  <rguenther@suse.de>

	PR testsuite/89551
	* gcc.dg/uninit-pred-8_b.c: Force logical-op-non-short-circuit
	the way that makes the testcase PASS.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/uninit-pred-8_b.c
Comment 4 Richard Biener 2019-03-06 10:13:51 UTC
Fixed.
Comment 5 Richard Biener 2019-03-15 09:16:10 UTC
*** Bug 89717 has been marked as a duplicate of this bug. ***
Comment 6 Richard Biener 2019-03-15 11:08:25 UTC
Author: rguenth
Date: Fri Mar 15 11:07:53 2019
New Revision: 269704

URL: https://gcc.gnu.org/viewcvs?rev=269704&root=gcc&view=rev
Log:
2019-03-15  Richard Biener  <rguenther@suse.de>

	Backport from mainline
	2019-03-06  Richard Biener  <rguenther@suse.de>

	PR testsuite/89551
	* gcc.dg/uninit-pred-8_b.c: Force logical-op-non-short-circuit
	the way that makes the testcase PASS.

	2018-11-30  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/85368
	* params.def (PARAM_LOGICAL_OP_NON_SHORT_CIRCUIT): New param.
	* tree-ssa-ifcombine.c (ifcombine_ifandif): If
	--param logical-op-non-short-circuit is present, override
	LOGICAL_OP_NON_SHORT_CIRCUIT value from the param.
	* fold-const.c (fold_range_test, fold_truth_andor): Likewise.

Modified:
    branches/gcc-8-branch/gcc/ChangeLog
    branches/gcc-8-branch/gcc/fold-const.c
    branches/gcc-8-branch/gcc/params.def
    branches/gcc-8-branch/gcc/testsuite/ChangeLog
    branches/gcc-8-branch/gcc/testsuite/gcc.dg/uninit-pred-8_b.c
    branches/gcc-8-branch/gcc/tree-ssa-ifcombine.c