Successfully identified regression in *gcc* in CI configuration tcwg_bmk_gnu_tk1/gnu-master-arm-spec2k6-O2. So far, this commit has regressed CI configurations: - tcwg_bmk_gnu_tk1/gnu-master-arm-spec2k6-O2
Culprit: <cut> commit 2e96b5f14e4025691b57d2301d71aa6092ed44bc Author: Aldy Hernandez aldyh@redhat.com Date: Tue Jun 15 12:32:51 2021 +0200
Backwards jump threader rewrite with ranger.
This is a rewrite of the backwards threader with a ranger based solver.
The code is divided into two parts: the path solver in gimple-range-path.*, and the path discovery bits in tree-ssa-threadbackward.c.
The legacy code is still available with --param=threader-mode=legacy, but will be removed shortly after.
gcc/ChangeLog:
* Makefile.in (tree-ssa-loop-im.o-warn): New. * flag-types.h (enum threader_mode): New. * params.opt: Add entry for --param=threader-mode. * tree-ssa-threadbackward.c (THREADER_ITERATIVE_MODE): New. (class back_threader): New. (back_threader::back_threader): New. (back_threader::~back_threader): New. (back_threader::maybe_register_path): New. (back_threader::find_taken_edge): New. (back_threader::find_taken_edge_switch): New. (back_threader::find_taken_edge_cond): New. (back_threader::resolve_def): New. (back_threader::resolve_phi): New. (back_threader::find_paths_to_names): New. (back_threader::find_paths): New. (dump_path): New. (debug): New. (thread_jumps::find_jump_threads_backwards): Call ranger threader. (thread_jumps::find_jump_threads_backwards_with_ranger): New. (pass_thread_jumps::execute): Abstract out code... (try_thread_blocks): ...here. * tree-ssa-threadedge.c (jump_threader::thread_outgoing_edges): Abstract out threading candidate code to... (single_succ_to_potentially_threadable_block): ...here. * tree-ssa-threadedge.h (single_succ_to_potentially_threadable_block): New. * tree-ssa-threadupdate.c (register_jump_thread): Return boolean. * tree-ssa-threadupdate.h (class jump_thread_path_registry): Return bool from register_jump_thread.
libgomp/ChangeLog:
* testsuite/libgomp.graphite/force-parallel-4.c: Adjust for threader. * testsuite/libgomp.graphite/force-parallel-8.c: Same.
gcc/testsuite/ChangeLog:
* g++.dg/debug/dwarf2/deallocator.C: Adjust for threader. * gcc.c-torture/compile/pr83510.c: Same. * dg.dg/analyzer/pr94851-2.c: Same. * gcc.dg/loop-unswitch-2.c: Same. * gcc.dg/old-style-asm-1.c: Same. * gcc.dg/pr68317.c: Same. * gcc.dg/pr97567-2.c: Same. * gcc.dg/predict-9.c: Same. * gcc.dg/shrink-wrap-loop.c: Same. * gcc.dg/sibcall-1.c: Same. * gcc.dg/tree-ssa/builtin-sprintf-3.c: Same. * gcc.dg/tree-ssa/pr21001.c: Same. * gcc.dg/tree-ssa/pr21294.c: Same. * gcc.dg/tree-ssa/pr21417.c: Same. * gcc.dg/tree-ssa/pr21458-2.c: Same. * gcc.dg/tree-ssa/pr21563.c: Same. * gcc.dg/tree-ssa/pr49039.c: Same. * gcc.dg/tree-ssa/pr61839_1.c: Same. * gcc.dg/tree-ssa/pr61839_3.c: Same. * gcc.dg/tree-ssa/pr77445-2.c: Same. * gcc.dg/tree-ssa/split-path-4.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-11.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-12.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-14.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-18.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-6.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-7.c: Same. * gcc.dg/tree-ssa/ssa-fre-48.c: Same. * gcc.dg/tree-ssa/ssa-thread-11.c: Same. * gcc.dg/tree-ssa/ssa-thread-12.c: Same. * gcc.dg/tree-ssa/ssa-thread-14.c: Same. * gcc.dg/tree-ssa/vrp02.c: Same. * gcc.dg/tree-ssa/vrp03.c: Same. * gcc.dg/tree-ssa/vrp05.c: Same. * gcc.dg/tree-ssa/vrp06.c: Same. * gcc.dg/tree-ssa/vrp07.c: Same. * gcc.dg/tree-ssa/vrp09.c: Same. * gcc.dg/tree-ssa/vrp19.c: Same. * gcc.dg/tree-ssa/vrp20.c: Same. * gcc.dg/tree-ssa/vrp33.c: Same. * gcc.dg/uninit-pred-9_b.c: Same. * gcc.dg/uninit-pr61112.c: Same. * gcc.dg/vect/bb-slp-16.c: Same. * gcc.target/i386/avx2-vect-aggressive.c: Same. * gcc.dg/tree-ssa/ranger-threader-1.c: New test. * gcc.dg/tree-ssa/ranger-threader-2.c: New test. * gcc.dg/tree-ssa/ranger-threader-3.c: New test. * gcc.dg/tree-ssa/ranger-threader-4.c: New test. * gcc.dg/tree-ssa/ranger-threader-5.c: New test. </cut>
Results regressed to (for first_bad == 2e96b5f14e4025691b57d2301d71aa6092ed44bc) # reset_artifacts: -10 # build_abe binutils: -9 # build_abe stage1 -- --set gcc_override_configure=--with-mode=arm --set gcc_override_configure=--disable-libsanitizer: -8 # build_abe linux: -7 # build_abe glibc: -6 # build_abe stage2 -- --set gcc_override_configure=--with-mode=arm --set gcc_override_configure=--disable-libsanitizer: -5 # true: 0 # benchmark -- -O2_marm artifacts/build-2e96b5f14e4025691b57d2301d71aa6092ed44bc/results_id: 1 # 445.gobmk,gobmk_base.default regressed by 103 # 445.gobmk,[.] fastlib regressed by 128 # 445.gobmk,[.] incremental_order_moves regressed by 127
from (for last_good == e63d76234d18cac731c4f3610d513bd8b39b5520) # reset_artifacts: -10 # build_abe binutils: -9 # build_abe stage1 -- --set gcc_override_configure=--with-mode=arm --set gcc_override_configure=--disable-libsanitizer: -8 # build_abe linux: -7 # build_abe glibc: -6 # build_abe stage2 -- --set gcc_override_configure=--with-mode=arm --set gcc_override_configure=--disable-libsanitizer: -5 # true: 0 # benchmark -- -O2_marm artifacts/build-e63d76234d18cac731c4f3610d513bd8b39b5520/results_id: 1
Artifacts of last_good build: https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tk1-gnu-master-arm... Results ID of last_good: tk1_32/tcwg_bmk_gnu_tk1/bisect-gnu-master-arm-spec2k6-O2/2943 Artifacts of first_bad build: https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tk1-gnu-master-arm... Results ID of first_bad: tk1_32/tcwg_bmk_gnu_tk1/bisect-gnu-master-arm-spec2k6-O2/2932 Build top page/logs: https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tk1-gnu-master-arm...
Configuration details:
Reproduce builds: <cut> mkdir investigate-gcc-2e96b5f14e4025691b57d2301d71aa6092ed44bc cd investigate-gcc-2e96b5f14e4025691b57d2301d71aa6092ed44bc
git clone https://git.linaro.org/toolchain/jenkins-scripts
mkdir -p artifacts/manifests curl -o artifacts/manifests/build-baseline.sh https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tk1-gnu-master-arm... --fail curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tk1-gnu-master-arm... --fail curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tk1-gnu-master-arm... --fail chmod +x artifacts/test.sh
# Reproduce the baseline build (build all pre-requisites) ./jenkins-scripts/tcwg_bmk-build.sh @@ artifacts/manifests/build-baseline.sh
# Save baseline build state (which is then restored in artifacts/test.sh) mkdir -p ./bisect rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ --exclude /gcc/ ./ ./bisect/baseline/
cd gcc
# Reproduce first_bad build git checkout --detach 2e96b5f14e4025691b57d2301d71aa6092ed44bc ../artifacts/test.sh
# Reproduce last_good build git checkout --detach e63d76234d18cac731c4f3610d513bd8b39b5520 ../artifacts/test.sh
cd .. </cut>
History of pending regressions and results: https://git.linaro.org/toolchain/ci/base-artifacts.git/log/?h=linaro-local/c...
Artifacts: https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tk1-gnu-master-arm... Build log: https://ci.linaro.org/job/tcwg_bmk_ci_gnu-bisect-tcwg_bmk_tk1-gnu-master-arm...
Full commit (up to 1000 lines): <cut> commit 2e96b5f14e4025691b57d2301d71aa6092ed44bc Author: Aldy Hernandez aldyh@redhat.com Date: Tue Jun 15 12:32:51 2021 +0200
Backwards jump threader rewrite with ranger.
This is a rewrite of the backwards threader with a ranger based solver.
The code is divided into two parts: the path solver in gimple-range-path.*, and the path discovery bits in tree-ssa-threadbackward.c.
The legacy code is still available with --param=threader-mode=legacy, but will be removed shortly after.
gcc/ChangeLog:
* Makefile.in (tree-ssa-loop-im.o-warn): New. * flag-types.h (enum threader_mode): New. * params.opt: Add entry for --param=threader-mode. * tree-ssa-threadbackward.c (THREADER_ITERATIVE_MODE): New. (class back_threader): New. (back_threader::back_threader): New. (back_threader::~back_threader): New. (back_threader::maybe_register_path): New. (back_threader::find_taken_edge): New. (back_threader::find_taken_edge_switch): New. (back_threader::find_taken_edge_cond): New. (back_threader::resolve_def): New. (back_threader::resolve_phi): New. (back_threader::find_paths_to_names): New. (back_threader::find_paths): New. (dump_path): New. (debug): New. (thread_jumps::find_jump_threads_backwards): Call ranger threader. (thread_jumps::find_jump_threads_backwards_with_ranger): New. (pass_thread_jumps::execute): Abstract out code... (try_thread_blocks): ...here. * tree-ssa-threadedge.c (jump_threader::thread_outgoing_edges): Abstract out threading candidate code to... (single_succ_to_potentially_threadable_block): ...here. * tree-ssa-threadedge.h (single_succ_to_potentially_threadable_block): New. * tree-ssa-threadupdate.c (register_jump_thread): Return boolean. * tree-ssa-threadupdate.h (class jump_thread_path_registry): Return bool from register_jump_thread.
libgomp/ChangeLog:
* testsuite/libgomp.graphite/force-parallel-4.c: Adjust for threader. * testsuite/libgomp.graphite/force-parallel-8.c: Same.
gcc/testsuite/ChangeLog:
* g++.dg/debug/dwarf2/deallocator.C: Adjust for threader. * gcc.c-torture/compile/pr83510.c: Same. * dg.dg/analyzer/pr94851-2.c: Same. * gcc.dg/loop-unswitch-2.c: Same. * gcc.dg/old-style-asm-1.c: Same. * gcc.dg/pr68317.c: Same. * gcc.dg/pr97567-2.c: Same. * gcc.dg/predict-9.c: Same. * gcc.dg/shrink-wrap-loop.c: Same. * gcc.dg/sibcall-1.c: Same. * gcc.dg/tree-ssa/builtin-sprintf-3.c: Same. * gcc.dg/tree-ssa/pr21001.c: Same. * gcc.dg/tree-ssa/pr21294.c: Same. * gcc.dg/tree-ssa/pr21417.c: Same. * gcc.dg/tree-ssa/pr21458-2.c: Same. * gcc.dg/tree-ssa/pr21563.c: Same. * gcc.dg/tree-ssa/pr49039.c: Same. * gcc.dg/tree-ssa/pr61839_1.c: Same. * gcc.dg/tree-ssa/pr61839_3.c: Same. * gcc.dg/tree-ssa/pr77445-2.c: Same. * gcc.dg/tree-ssa/split-path-4.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-11.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-12.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-14.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-18.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-6.c: Same. * gcc.dg/tree-ssa/ssa-dom-thread-7.c: Same. * gcc.dg/tree-ssa/ssa-fre-48.c: Same. * gcc.dg/tree-ssa/ssa-thread-11.c: Same. * gcc.dg/tree-ssa/ssa-thread-12.c: Same. * gcc.dg/tree-ssa/ssa-thread-14.c: Same. * gcc.dg/tree-ssa/vrp02.c: Same. * gcc.dg/tree-ssa/vrp03.c: Same. * gcc.dg/tree-ssa/vrp05.c: Same. * gcc.dg/tree-ssa/vrp06.c: Same. * gcc.dg/tree-ssa/vrp07.c: Same. * gcc.dg/tree-ssa/vrp09.c: Same. * gcc.dg/tree-ssa/vrp19.c: Same. * gcc.dg/tree-ssa/vrp20.c: Same. * gcc.dg/tree-ssa/vrp33.c: Same. * gcc.dg/uninit-pred-9_b.c: Same. * gcc.dg/uninit-pr61112.c: Same. * gcc.dg/vect/bb-slp-16.c: Same. * gcc.target/i386/avx2-vect-aggressive.c: Same. * gcc.dg/tree-ssa/ranger-threader-1.c: New test. * gcc.dg/tree-ssa/ranger-threader-2.c: New test. * gcc.dg/tree-ssa/ranger-threader-3.c: New test. * gcc.dg/tree-ssa/ranger-threader-4.c: New test. * gcc.dg/tree-ssa/ranger-threader-5.c: New test. --- gcc/flag-types.h | 7 + gcc/params.opt | 17 + gcc/testsuite/g++.dg/debug/dwarf2/deallocator.C | 3 +- gcc/testsuite/gcc.c-torture/compile/pr83510.c | 33 ++ gcc/testsuite/gcc.dg/analyzer/pr94851-2.c | 2 +- gcc/testsuite/gcc.dg/loop-unswitch-2.c | 2 +- gcc/testsuite/gcc.dg/old-style-asm-1.c | 5 +- gcc/testsuite/gcc.dg/pr68317.c | 4 +- gcc/testsuite/gcc.dg/pr97567-2.c | 2 +- gcc/testsuite/gcc.dg/predict-9.c | 4 +- gcc/testsuite/gcc.dg/shrink-wrap-loop.c | 53 +++ gcc/testsuite/gcc.dg/sibcall-1.c | 10 + gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-3.c | 25 +- gcc/testsuite/gcc.dg/tree-ssa/pr21001.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/pr21294.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/pr21417.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr21458-2.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr21563.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr49039.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr61839_1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr61839_3.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-1.c | 20 + gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-2.c | 39 ++ gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-3.c | 41 ++ gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-4.c | 83 ++++ gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-5.c | 80 ++++ gcc/testsuite/gcc.dg/tree-ssa/split-path-4.c | 4 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-11.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-12.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-14.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-18.c | 5 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c | 4 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-48.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-11.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-12.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-14.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/vrp02.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/vrp03.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/vrp05.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/vrp06.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/vrp07.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/vrp09.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/vrp19.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/vrp20.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/vrp33.c | 2 +- gcc/testsuite/gcc.dg/uninit-pr61112.c | 6 +- gcc/testsuite/gcc.dg/uninit-pred-9_b.c | 1 + gcc/testsuite/gcc.dg/vect/bb-slp-16.c | 7 + .../gcc.target/i386/avx2-vect-aggressive.c | 2 +- gcc/tree-ssa-threadbackward.c | 476 ++++++++++++++++++++- gcc/tree-ssa-threadedge.c | 20 +- gcc/tree-ssa-threadedge.h | 1 + gcc/tree-ssa-threadupdate.c | 12 +- gcc/tree-ssa-threadupdate.h | 2 +- .../testsuite/libgomp.graphite/force-parallel-4.c | 1 + .../testsuite/libgomp.graphite/force-parallel-8.c | 2 + 58 files changed, 962 insertions(+), 57 deletions(-)
diff --git a/gcc/flag-types.h b/gcc/flag-types.h index e43d1de490d..e39673f6716 100644 --- a/gcc/flag-types.h +++ b/gcc/flag-types.h @@ -454,6 +454,13 @@ enum evrp_mode EVRP_MODE_RVRP_DEBUG = EVRP_MODE_RVRP_ONLY | EVRP_MODE_DEBUG };
+/* Backwards threader mode. */ +enum threader_mode +{ + THREADER_MODE_LEGACY = 0, + THREADER_MODE_RANGER = 1 +}; + /* Modes of OpenACC 'kernels' constructs handling. */ enum openacc_kernels { diff --git a/gcc/params.opt b/gcc/params.opt index 92b003e38cb..f1f47b44215 100644 --- a/gcc/params.opt +++ b/gcc/params.opt @@ -1010,6 +1010,23 @@ Maximum depth of DFS walk used by modref escape analysis. Common Joined UInteger Var(param_modref_max_escape_points) Init(256) Param Optimization Maximum number of escape points tracked by modref per SSA-name.
+-param=threader-iterative= +Common Joined UInteger Var(param_threader_iterative) Init(0) Param Optimization +Run backwards threader in iterative mode. + +-param=threader-mode= +Common Joined Var(param_threader_mode) Enum(threader_mode) Init(THREADER_MODE_RANGER) Param Optimization +--param=threader-mode=[legacy|ranger] Specifies the mode the backwards threader should run in. + +Enum +Name(threader_mode) Type(enum threader_mode) UnknownError(unknown threader mode %qs) + +EnumValue +Enum(threader_mode) String(legacy) Value(THREADER_MODE_LEGACY) + +EnumValue +Enum(threader_mode) String(ranger) Value(THREADER_MODE_RANGER) + -param=tm-max-aggregate-size= Common Joined UInteger Var(param_tm_max_aggregate_size) Init(9) Param Optimization Size in bytes after which thread-local aggregates should be instrumented with the logging functions instead of save/restore pairs. diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/deallocator.C b/gcc/testsuite/g++.dg/debug/dwarf2/deallocator.C index d895e78e608..c1d387922ba 100644 --- a/gcc/testsuite/g++.dg/debug/dwarf2/deallocator.C +++ b/gcc/testsuite/g++.dg/debug/dwarf2/deallocator.C @@ -29,7 +29,7 @@ void foo(int i) return; } } - if (i) + if (i) // Threader makes everything after here disappear. { t test; if (i == 10) @@ -42,5 +42,4 @@ void foo(int i) } // { dg-final { scan-assembler "deallocator.C:29" } } // { dg-final { scan-assembler "deallocator.C:24" } } -// { dg-final { scan-assembler "deallocator.C:34" } } // { dg-final { scan-assembler "deallocator.C:21" } } diff --git a/gcc/testsuite/gcc.c-torture/compile/pr83510.c b/gcc/testsuite/gcc.c-torture/compile/pr83510.c index 907dd80ccd7..fc932e57f3a 100644 --- a/gcc/testsuite/gcc.c-torture/compile/pr83510.c +++ b/gcc/testsuite/gcc.c-torture/compile/pr83510.c @@ -3,6 +3,39 @@ (PR tree-optimization/83510). */
/* { dg-options "-Warray-bounds" } */ +/* { dg-xfail-if "" { "*-*-*" } { "-Os" } } */ + + +/* This test is XFAILed because thread1 threads a switch statement + such that the various cases have been split into different + independent blocks. One of these blocks exposes an arr[i_27] + which is later propagated by VRP to be arr[10]. This is an + invalid access, but the array bounds code doesn't know it is an + unreachable path. + + However, it is not until dom2 that we "know" that the value of the + switch index is such that the path to arr[10] is unreachable. For + that matter, it is not until dom3 that we remove the unreachable + path. + + + See: + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83510 + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83312 + + It's not until here that ranger "knows" that the path is + unreachable: + + thread1 + vrp1 <-- array bounds checking + dce2 + stdarg + cdce + cselim + copyprop + ifcombine + mergephi3 <-- too late +*/
extern int get_flag (void);
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94851-2.c b/gcc/testsuite/gcc.dg/analyzer/pr94851-2.c index b837451b27a..0acf48810c1 100644 --- a/gcc/testsuite/gcc.dg/analyzer/pr94851-2.c +++ b/gcc/testsuite/gcc.dg/analyzer/pr94851-2.c @@ -45,7 +45,7 @@ int pamark(void) { if (curbp->b_amark == (AMARK *)NULL) curbp->b_amark = p; else - last->m_next = p; /* { dg-warning "dereference of NULL 'last'" } */ + last->m_next = p; /* { dg-warning "dereference of NULL 'last'" "deref" { xfail *-*-* } } */ }
p->m_name = (char)c; /* { dg-bogus "leak of 'p'" "bogus leak" } */ diff --git a/gcc/testsuite/gcc.dg/loop-unswitch-2.c b/gcc/testsuite/gcc.dg/loop-unswitch-2.c index f8d314e34de..0931f6e71c3 100644 --- a/gcc/testsuite/gcc.dg/loop-unswitch-2.c +++ b/gcc/testsuite/gcc.dg/loop-unswitch-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-details" } */ +/* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-details -fdisable-tree-thread2 -fdisable-tree-thread3" } */
void foo (float **a, float **b, float *c, int n, int m, int l) { diff --git a/gcc/testsuite/gcc.dg/old-style-asm-1.c b/gcc/testsuite/gcc.dg/old-style-asm-1.c index 8af007795a7..f9406ff0a26 100644 --- a/gcc/testsuite/gcc.dg/old-style-asm-1.c +++ b/gcc/testsuite/gcc.dg/old-style-asm-1.c @@ -1,6 +1,9 @@ /* PR inline-asm/8832 */ /* { dg-do compile } */ -/* { dg-options "-O2 -dP" } */ +/* { dg-options "-O2 -dP -fdisable-tree-ethread -fdisable-tree-thread1 -fdisable-tree-thread2 -fdisable-tree-thread3 -fdisable-tree-thread4" } */ + +/* Note: Threader will duplicate BBs and replace one conditional branch by an + unconditional one. */
/* Verify that GCC doesn't optimize old style asm instructions. */ diff --git a/gcc/testsuite/gcc.dg/pr68317.c b/gcc/testsuite/gcc.dg/pr68317.c index 891d12954ba..bd053a7522b 100644 --- a/gcc/testsuite/gcc.dg/pr68317.c +++ b/gcc/testsuite/gcc.dg/pr68317.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -fdisable-tree-ethread" } */ + +/* Note: Threader will collapse loop. */
typedef int int32_t __attribute__((mode (__SI__)));
diff --git a/gcc/testsuite/gcc.dg/pr97567-2.c b/gcc/testsuite/gcc.dg/pr97567-2.c index dee31c6dc01..c3ead54eaa8 100644 --- a/gcc/testsuite/gcc.dg/pr97567-2.c +++ b/gcc/testsuite/gcc.dg/pr97567-2.c @@ -1,5 +1,5 @@ /* { dg-do compile} */ -/* { dg-options "-O2 -fdump-tree-evrp" } */ +/* { dg-options "-O2 -fdump-tree-evrp -fdisable-tree-ethread" } */
char a[2];
diff --git a/gcc/testsuite/gcc.dg/predict-9.c b/gcc/testsuite/gcc.dg/predict-9.c index f491c511bd9..cb68a218a93 100644 --- a/gcc/testsuite/gcc.dg/predict-9.c +++ b/gcc/testsuite/gcc.dg/predict-9.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdisable-tree-evrp -fdump-tree-profile_estimate -fno-finite-loops" } */ +/* { dg-options "-O2 -fdisable-tree-evrp -fdump-tree-profile_estimate -fno-finite-loops -fdisable-tree-ethread" } */ + +/* Note: Threader causes removal of for loop. */
extern int global; extern int global2; diff --git a/gcc/testsuite/gcc.dg/shrink-wrap-loop.c b/gcc/testsuite/gcc.dg/shrink-wrap-loop.c index 52dfc2790ed..ba872fa23f6 100644 --- a/gcc/testsuite/gcc.dg/shrink-wrap-loop.c +++ b/gcc/testsuite/gcc.dg/shrink-wrap-loop.c @@ -1,5 +1,58 @@ /* { dg-do compile { target { { { i?86-*-* x86_64-*-* } && lp64 } || { arm_thumb2 } } } } */ /* { dg-options "-O2 -fdump-rtl-pro_and_epilogue" } */ +// { dg-additional-options "-fdisable-tree-ethread" } + +/* +Our new threader is threading things a bit too early, and causing the +testcase in gcc.dg/shrink-wrap-loop.c to fail. + + The gist is this BB inside a loop: + + <bb 6> : + # p_2 = PHI <p2_6(D)(2), p_12(5)> + if (p_2 != 0B) + goto <bb 3>; [INV] + else + goto <bb 7>; [INV] + +Our threader can move this check outside of the loop (good). This is +done before branch probabilities are calculated and causes the probs +to be calculated as: + +<bb 2> [local count: 216361238]: + if (p2_6(D) != 0B) + goto <bb 7>; [54.59%] + else + goto <bb 6>; [45.41%] + +Logically this seems correct to me. A simple check outside of a loop +should slightly but not overwhelmingly favor a non-zero value. + +Interestingly however, the old threader couldn't get this, but the IL +ended up identical, albeit with different probabilities. What happens +is that, because the old code could not thread this, the p2 != 0 check +would remain inside the loop and probs would be calculated thusly: + + <bb 6> [local count: 1073741824]: + # p_2 = PHI <p2_6(D)(2), p_12(5)> + if (p_2 != 0B) + goto <bb 3>; [94.50%] + else + goto <bb 7>; [5.50%] + +Then when the loop header copying pass ("ch") shuffled things around, +the IL would end up identical to my early threader code, but with the +probabilities would remain as 94.5/5.5. + +The above discrepancy causes the RTL ifcvt pass to generate different +code, and by the time we get to the shrink wrapping pass, things look +sufficiently different such that the legacy code can actually shrink +wrap, whereas our new code does not. + +IMO, if the loop-ch pass moves conditionals outside of a loop, the +probabilities should be adjusted, but that does mean the shrink wrap +won't happen for this contrived testcase. + */
int foo (int *p1, int *p2);
diff --git a/gcc/testsuite/gcc.dg/sibcall-1.c b/gcc/testsuite/gcc.dg/sibcall-1.c index e8a95513d9e..367ee4374e1 100644 --- a/gcc/testsuite/gcc.dg/sibcall-1.c +++ b/gcc/testsuite/gcc.dg/sibcall-1.c @@ -7,6 +7,9 @@ /* { dg-do run } */ /* { dg-options "-O2 -foptimize-sibling-calls" } */
+/* See note in recurser_void() as to why we disable threading. */ +/* { dg-additional-options "-fdisable-tree-thread1" } */ + /* The option -foptimize-sibling-calls is the default, but serves as marker. Self-recursion tail calls are optimized for all targets, regardless of presence of sibcall patterns. */ @@ -26,6 +29,13 @@ int main () void recurser_void (int n) { + /* In some architectures like ppc64*, jump threading may thread + paths such that there are two calls into track(), one for + track(0) and one for track(7). The track(7) call can be + transformed into a jump instead of a call, which means that + different calls into track() may end up with a different + &stackpos. This is the reason we disable jump threading for this + test. */ if (n == 0 || n == 7) track (n);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-3.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-3.c index fae2a1b73ea..ec55f267318 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-3.c @@ -15,7 +15,7 @@ extern void string_lt_0_fail (); extern void string_eq_0_fail (); extern void string_gt_0_fail ();
-void test_string (char *d, const char *s) +void test_string_eq_min (char *d, const char *s) { int n = __builtin_sprintf (d, "%-s", s);
@@ -23,13 +23,36 @@ void test_string (char *d, const char *s) or INT_MAX. (This is a white box test based on knowing that the optimization computes its own values of the two constants.) */ if (n == INT_MIN) string_eq_min_fail (); +} + +void test_string_eq_max (char *d, const char *s) +{ + int n = __builtin_sprintf (d, "%-s", s); + if (n == INT_MAX) string_eq_max_fail (); +} + +void test_string_lt_0 (char *d, const char *s) +{ + int n = __builtin_sprintf (d, "%-s", s);
/* The return value could be negative when strlen(s) is in excess of 4095 (the maximum number of bytes a single directive is required to handle). */ if (n < 0) string_lt_0_fail (); +} + +void test_string_eq_0 (char *d, const char *s) +{ + int n = __builtin_sprintf (d, "%-s", s); + if (n == 0) string_eq_0_fail (); +} + +void test_string_gt_0 (char *d, const char *s) +{ + int n = __builtin_sprintf (d, "%-s", s); + if (n > 0) string_gt_0_fail (); }
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c index 719360a015f..4ea5f21addf 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21001.c @@ -6,6 +6,7 @@
/* { dg-do compile } */ /* { dg-options "-O2 -fno-tree-dominator-opts -fno-tree-fre -fdisable-tree-evrp -fdump-tree-vrp1-details" } */ +/* { dg-additional-options "-fdisable-tree-ethread -fdisable-tree-thread1" } */
int foo (int a) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21294.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21294.c index cc7d4cdf338..b9edabc6234 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21294.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21294.c @@ -5,6 +5,7 @@
/* { dg-do compile } */ /* { dg-options "-O2 -fno-tree-dominator-opts -fdisable-tree-evrp -fdump-tree-vrp1-details" } */ +/* { dg-additional-options "-fdisable-tree-ethread -fdisable-tree-thread1" } */
struct f { int i; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c index 484511978a1..fc14af4e662 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21417.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-thread4-details" } */ +/* { dg-options "-O2 -fdisable-tree-thread3 -fdump-tree-thread4-details" } */
struct tree_common { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21458-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21458-2.c index 2aee42f4c05..f8d7353fc0e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21458-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21458-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-evrp-details" } */ +/* { dg-options "-O2 -fdump-tree-evrp-details -fdisable-tree-ethread" } */
extern void g (void); extern void bar (int); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr21563.c b/gcc/testsuite/gcc.dg/tree-ssa/pr21563.c index 9c67a3acb46..72dce83ce37 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr21563.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr21563.c @@ -2,7 +2,7 @@ Make sure VRP folds the second "if" statement. */
/* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-dominator-opts -fdisable-tree-evrp -fdump-tree-vrp1-details" } */ +/* { dg-options "-O2 -fno-tree-dominator-opts -fdisable-tree-evrp -fdump-tree-vrp1-details -fdisable-tree-ethread -fdisable-tree-thread1" } */
int foo (int a) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr49039.c b/gcc/testsuite/gcc.dg/tree-ssa/pr49039.c index 4bc0a8175a0..a2044d012cc 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr49039.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr49039.c @@ -1,6 +1,6 @@ /* PR tree-optimization/49039 */ /* { dg-do compile } */ -/* { dg-options "-O2 -fdisable-tree-evrp -fdump-tree-vrp1" } */ +/* { dg-options "-O2 -fdisable-tree-evrp -fdump-tree-vrp1 -fdisable-tree-ethread -fdisable-tree-thread1" } */
extern void bar (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr61839_1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr61839_1.c index d44c7dc1882..ddc53fbfbcc 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr61839_1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr61839_1.c @@ -1,6 +1,6 @@ /* PR tree-optimization/61839. */ /* { dg-do run } */ -/* { dg-options "-O2 -fdump-tree-vrp1 -fdisable-tree-evrp -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fdump-tree-vrp1 -fdisable-tree-evrp -fdump-tree-optimized -fdisable-tree-ethread -fdisable-tree-thread1" } */ /* { dg-require-effective-target int32plus } */
__attribute__ ((noinline)) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr61839_3.c b/gcc/testsuite/gcc.dg/tree-ssa/pr61839_3.c index 5ceb0738bde..cc322d6e703 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr61839_3.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr61839_3.c @@ -1,6 +1,6 @@ /* PR tree-optimization/61839. */ /* { dg-do run } */ -/* { dg-options "-O2 -fdump-tree-vrp1 -fdump-tree-optimized" } */ +/* { dg-options "-O2 -fdump-tree-vrp1 -fdump-tree-optimized -fdisable-tree-ethread -fdisable-tree-thread1" } */
__attribute__ ((noinline)) int foo (int a, unsigned b) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c index cf74e156109..f9fc212f49e 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr77445-2.c @@ -124,7 +124,7 @@ enum STATES FMS( u8 **in , u32 *transitions) { to change decisions in switch expansion which in turn can expose new jump threading opportunities. Skip the later tests on aarch64. */ /* { dg-final { scan-tree-dump "Jumps threaded: 1[1-9]" "thread1" } } */ -/* { dg-final { scan-tree-dump-times "Invalid sum" 3 "thread1" } } */ +/* { dg-final { scan-tree-dump-times "Invalid sum" 4 "thread1" } } */ /* { dg-final { scan-tree-dump-not "optimizing for size" "thread1" } } */ /* { dg-final { scan-tree-dump-not "optimizing for size" "thread2" } } */ /* { dg-final { scan-tree-dump-not "optimizing for size" "thread3" { target { ! aarch64*-*-* } } } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-1.c new file mode 100644 index 00000000000..c3ccb5d5b7e --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-1.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-thread1-details --param logical-op-non-short-circuit=1" } */ + +// Copied from ssa-dom-thread-11.c + +static int *bb_ticks; +extern void frob (void); +void +mark_target_live_regs (int b, int block, int bb_tick) +{ + if (b == block && b != -1 && bb_tick == bb_ticks[b]) + return; + if (b != -1) + frob (); +} + +/* When the first two conditionals in the first IF are true, but + the third conditional is false, then there's a jump threading + opportunity to bypass the second IF statement. */ +/* { dg-final { scan-tree-dump-times "Registering.*jump thread" 1 "thread1"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-2.c new file mode 100644 index 00000000000..d2689b6c788 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-2.c @@ -0,0 +1,39 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-thread2-details -w" } */ + +// Copied from ssa-dom-thread-12.c. + +typedef long unsigned int size_t; +union tree_node; +typedef union tree_node *tree; +typedef union gimple_statement_d *gimple; +typedef const union gimple_statement_d *const_gimple; +union gimple_statement_d +{ + unsigned num_ops; + tree exp; +}; + +unsigned int x; +static inline tree +gimple_op (const_gimple gs, unsigned i) +{ + if (!(i < gs->num_ops)) + abort (); + return gs->exp; +} + +unsigned char +scan_function (gimple stmt) +{ + unsigned i; + for (i = 0; i < stmt->num_ops - 3 ; i++) + gimple_call_arg (stmt, i); + gimple_op (stmt, 1); +} + +/* The test which bypasses the loop is simplified prior to DOM to check + that stmt->num_ops - 3 != 0. When that test is false, we can derive + a value for stmt->num_ops. That in turn allows us to thread the jump + for the conditional at the start of the call to gimple_op. */ +/* { dg-final { scan-tree-dump-times "Registering.*jump thread" 1 "thread2"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-3.c new file mode 100644 index 00000000000..79ec067e68a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-3.c @@ -0,0 +1,41 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-ethread-details -w --param logical-op-non-short-circuit=1" } */ + +// Copied from ssa-dom-thread-14.c + +enum optab_methods +{ + OPTAB_DIRECT, + OPTAB_LIB, + OPTAB_WIDEN, + OPTAB_LIB_WIDEN, + OPTAB_MUST_WIDEN +}; +struct optab_d { }; +typedef struct optab_d *optab; +void +expand_shift_1 (int code, int unsignedp, int rotate, + optab lshift_optab, optab rshift_arith_optab) +{ + int left = (code == 42 || code == 0xde); + int attempt; + enum optab_methods methods; + if (attempt == 0) + methods = OPTAB_DIRECT; + else if (attempt == 1) + methods = OPTAB_WIDEN; + if ((!unsignedp || (!left && methods == OPTAB_WIDEN))) + { + enum optab_methods methods1 = methods; + if (unsignedp) + methods1 = OPTAB_MUST_WIDEN; + expand_binop (left ? lshift_optab : rshift_arith_optab, + unsignedp, methods1); + } +} + +/* When UNSIGNEDP is true, LEFT is false and METHOD == OPTAB_WIDEN + we will enter the TRUE arm of the conditional and we can thread + the test to compute the first first argument of the expand_binop + call if we look backwards through the boolean logicals. */ +/* { dg-final { scan-tree-dump-times "Registering.*jump thread" 1 "ethread"} } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-4.c b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-4.c new file mode 100644 index 00000000000..e8d1cfc03ac --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-4.c @@ -0,0 +1,83 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-O2 -fdump-tree-vrp-details -fdump-tree-thread1-details --param logical-op-non-short-circuit=1" } */ +/* { dg-final { scan-tree-dump-times "Registering FSM jump" 8 "thread1" } } */ + +/* Copied from ssa-thread-14. */ + +void foo (void); +void bar (void); +void blah (void); + +/* One jump threaded here. */ + +void +baz_1 (int a, int b, int c) +{ + if (a && b) + foo (); + if (!b && c) + bar (); +} + +/* One jump threaded here. */ + +void +baz_2 (int a, int b, int c) +{ + if (a && b) + foo (); + if (b || c) + bar (); +} + +/* One jump threaded here. */ + +void +baz_3 (int a, int b, int c) +{ + if (a && b > 10) + foo (); + if (b < 5 && c) + bar (); +} + +/* Two jumps threaded here. */ + +void +baz_4 (int a, int b, int c) +{ + if (a && b) + { + foo (); + if (c) + bar (); + } + if (b && c) + blah (); +} + +/* Two jumps threaded here. */ + +void +baz_5 (int a, int b, int c) +{ + if (a && b) + { + foo (); + if (c) + bar (); + } + if (!b || !c) + blah (); +} + +/* One jump threaded here. */ + +void +baz_6 (int a, int b, int c) +{ + if (a == 39 && b == 41) + foo (); + if (c == 12 || b == 41) + bar (); +} diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-5.c b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-5.c new file mode 100644 index 00000000000..b7ca99a0152 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-5.c @@ -0,0 +1,80 @@ +// { dg-do compile } +// { dg-options "-fgimple -O2 -fdump-tree-thread1-details" } + +/* This tests that we can thread BB4->BB999 coming in through the + following path: + + latch many insns + | | + V V + 6 -> 7 -> 3 -> 4 -> 999 + + The ranger based threader cannot thread this because BB4 has too + many instructions so it gives up looking back. However, if we were + able to looking further, we would notice that a profitable path + passing through the loop latch (BB7) exists. + + That is, 3->4->N in isolation is not profitable, but 6->7->3->4->N is. + + It is not clear whether handling this case in the backwards + threader is profitable, as it would increase the search space + considerably. The test is being added to note a regression from + the old backward threader code. + + This test has been distilled from libphobos/src/std/net/isemail.d. + + The ranger threader stops at the 3->4 subpath with: "did not thread + around loop and would copy too many statements". */ + + +extern void bar(); +extern int random(); + +int __GIMPLE (ssa,startwith("thread1")) +foo (int key) +{ + int context; + int _1454; + + __BB(2): + goto __BB3; + + // Loop header. + __BB(3): + context_448 = __PHI (__BB2: 0, __BB7: context_450); + if (key_5(D) > 0) + goto __BB999; + else + goto __BB4; + + __BB(4): + bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); + bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); + bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); + bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); + bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); + bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); bar(); + switch (context_448) {default: L5; case 0: L999; } + + __BB(5): + L5: + goto __BB6; + + __BB(6): + context_450 = __PHI (__BB5: 0); + _1454 = random (); + if (_1454 > 0) + goto __BB999; + else + goto __BB7; + + // Loop latch. + __BB(7): + goto __BB3; + + __BB(999): + L999: + return 5; +} + +// { dg-final { scan-tree-dump-times "Registering.*jump thread.*incoming edge; \(6, 7\) \(7, 3\) \(3, 4\) \(4, 999\) nocopy" 1 "thread1" { xfail *-*-* } } } diff --git a/gcc/testsuite/gcc.dg/tree-ssa/split-path-4.c b/gcc/testsuite/gcc.dg/tree-ssa/split-path-4.c index dac931c18d0..8ef7646282c 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/split-path-4.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/split-path-4.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fsplit-paths -fdump-tree-split-paths-details -w" } */ +/* { dg-options "-O2 -fsplit-paths -fdump-tree-split-paths-details -w -fdisable-tree-thread1 -fdisable-tree-thread2" } */ + +/* Note: Threader causes the infinite loop in val & 1 sooner. */
powi_cost (long n) { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-11.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-11.c index 5f90613263d..856ab389439 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-11.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-dom2-details --param logical-op-non-short-circuit=1" } */ +/* { dg-options "-O2 -fdump-tree-dom2-details --param logical-op-non-short-circuit=1 -fdisable-tree-thread1 -fdisable-tree-thread2" } */
static int *bb_ticks; extern void frob (void); diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-12.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-12.c index 63bd12a06a4..bad5e0a782d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-12.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-12.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-dom2-details -w" } */ +/* { dg-options "-O2 -fdump-tree-dom2-details -w -fdisable-tree-thread2" } */ typedef long unsigned int size_t; union tree_node; typedef union tree_node *tree; diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-14.c index 4e6a911506e..3bc4b3795cb 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-14.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-14.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-dom2-details -w --param logical-op-non-short-circuit=1" } */ +/* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-ethread -fdisable-tree-thread2" } */
enum optab_methods { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-18.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-18.c index d4759b8903b..03872e7a02f 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-18.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-18.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-vrp1-details -fdump-tree-dom2-details -std=gnu89 --param logical-op-non-short-circuit=0" } */ +/* { dg-options "-O2 -fdump-tree-vrp1-details -fdump-tree-thread1-details -std=gnu89 --param logical-op-non-short-circuit=0" } */
#include "ssa-dom-thread-4.c"
@@ -21,4 +21,5 @@ condition.
All the cases are picked up by VRP1 as jump threads. */ -/* { dg-final { scan-tree-dump-times "Threaded" 4 "vrp1" } } */ +/* { dg-final { scan-tree-dump-times "Registering FSM jump" 6 "thread1" } } */ +/* { dg-final { scan-tree-dump-times "Threaded" 2 "vrp1" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c index 16a9ef4e28a..c7bf867b084 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-6.c @@ -34,8 +34,8 @@ SWITCH_BB -> BBx -> BBy -> BBz -> PHI
We now know the value of the switch index at PHI. */ -/* { dg-final { scan-tree-dump-times "FSM" 6 "thread1" } } */ -/* { dg-final { scan-tree-dump-times "FSM" 1 "thread2" } } */ +/* { dg-final { scan-tree-dump-times "Registering FSM jump" 6 "thread1" } } */ +/* { dg-final { scan-tree-dump-times "Registering FSM jump" 1 "thread2" } } */
int sum0, sum1, sum2, sum3; int foo (char *s, char **ret) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c index bad5bc1d003..1c2d12aa9ea 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-7.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-thread1-stats -fdump-tree-thread2-stats -fdump-tree-dom2-stats -fdump-tree-thread3-stats -fdump-tree-dom3-stats -fdump-tree-vrp2-stats -fno-guess-branch-probability" } */ +/* { dg-additional-options "--param=threader-mode=legacy" } */
/* Here we have the same issue as was commented in ssa-dom-thread-6.c. The PHI coming into the threader has a lot more constants, so the diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-48.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-48.c index b3d610204da..5e74c78e7b0 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-48.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-fre-48.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O -fdump-tree-fre1-details" } */ +/* { dg-options "-O -fdump-tree-fre1-details -fdisable-tree-ethread" } */
int foo (int i) { diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-11.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-11.c index 67e1e89ecd3..672a54e07db 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-11.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-11.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-vrp2-details --param logical-op-non-short-circuit=1" } */ </cut>