aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2023-07-08 23:47:38 +0200
committerJan Hubicka <jh@suse.cz>2023-07-08 23:47:38 +0200
commit3a42c79c258f54f5837d2fd54874f8b291a518fc (patch)
tree152b286cf31f9f85038d5ef1447403a6add6ce9e
parent9a2eab6172a8067e2f63e0fa2bcd5b2190656303 (diff)
downloadgcc-3a42c79c258f54f5837d2fd54874f8b291a518fc.zip
gcc-3a42c79c258f54f5837d2fd54874f8b291a518fc.tar.gz
gcc-3a42c79c258f54f5837d2fd54874f8b291a518fc.tar.bz2
Add missing profile_dump check
gcc/ChangeLog: PR tree-optimization/110600 * cfgloopmanip.cc (scale_loop_profile): Add mising profile_dump check. gcc/testsuite/ChangeLog: PR tree-optimization/110600 * gcc.c-torture/compile/pr110600.c: New test.
-rw-r--r--gcc/cfgloopmanip.cc7
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr110600.c6
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cfgloopmanip.cc b/gcc/cfgloopmanip.cc
index 5273242..5c0065b 100644
--- a/gcc/cfgloopmanip.cc
+++ b/gcc/cfgloopmanip.cc
@@ -582,9 +582,10 @@ scale_loop_profile (class loop *loop, profile_probability p,
if (exit_edge && exit_edge->src->loop_father != loop)
{
- fprintf (dump_file,
- ";; Loop exit is in inner loop;"
- " will leave exit probabilities inconsistent\n");
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file,
+ ";; Loop exit is in inner loop;"
+ " will leave exit probabilities inconsistent\n");
}
else if (exit_edge)
{
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr110600.c b/gcc/testsuite/gcc.c-torture/compile/pr110600.c
new file mode 100644
index 0000000..4b126f7
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr110600.c
@@ -0,0 +1,6 @@
+int a(int b, int c) { return (b ^ c) < 0 ? b : b - c; }
+int main() {
+ for (int e = 0; e != -1; e = a(e, 1))
+ ;
+ return 0;
+}