aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2017-01-30 16:35:57 +0100
committerMartin Liska <marxin@gcc.gnu.org>2017-01-30 15:35:57 +0000
commit37731134c71cc81ed8245d583e1fbbfab879fa5f (patch)
tree3d626a4862a93b559113fcd051f64f20bfe8f2de /gcc
parent8fd23c8e9ff446200401354d810a9c144ee72e65 (diff)
downloadgcc-37731134c71cc81ed8245d583e1fbbfab879fa5f.zip
gcc-37731134c71cc81ed8245d583e1fbbfab879fa5f.tar.gz
gcc-37731134c71cc81ed8245d583e1fbbfab879fa5f.tar.bz2
Fix profile corruption with -O1 (PR gcov-profile/79259)
2017-01-30 Martin Liska <mliska@suse.cz> PR gcov-profile/79259 * opts.c (common_handle_option): Enable flag_ipa_bit_cp w/ -fprofile-generate. 2017-01-30 Martin Liska <mliska@suse.cz> PR gcov-profile/79259 * g++.dg/tree-prof/pr79259.C: New test. From-SVN: r245031
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/opts.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/tree-prof/pr79259.C20
4 files changed, 33 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 620c4b0..206b8a5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2017-01-30 Martin Liska <mliska@suse.cz>
+ PR gcov-profile/79259
+ * opts.c (common_handle_option): Enable flag_ipa_bit_cp w/
+ -fprofile-generate.
+
+2017-01-30 Martin Liska <mliska@suse.cz>
+
PR bootstrap/78985
* config/aarch64/cortex-a57-fma-steering.c (func_fma_steering::analyze):
Initialize variables with NULL value.
diff --git a/gcc/opts.c b/gcc/opts.c
index 5f573a1..b38e9b4 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -2150,6 +2150,8 @@ common_handle_option (struct gcc_options *opts,
opts->x_flag_profile_values = value;
if (!opts_set->x_flag_inline_functions)
opts->x_flag_inline_functions = value;
+ if (!opts_set->x_flag_ipa_bit_cp)
+ opts->x_flag_ipa_bit_cp = value;
/* FIXME: Instrumentation we insert makes ipa-reference bitmaps
quadratic. Disable the pass until better memory representation
is done. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 33f0248..cbab69f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2017-01-30 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/79259
+ * g++.dg/tree-prof/pr79259.C: New test.
+
2017-01-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/79276
diff --git a/gcc/testsuite/g++.dg/tree-prof/pr79259.C b/gcc/testsuite/g++.dg/tree-prof/pr79259.C
new file mode 100644
index 0000000..a55172b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/tree-prof/pr79259.C
@@ -0,0 +1,20 @@
+/* { dg-options "-O1" } */
+
+inline bool
+a (int b)
+{
+ return (b & 5) != b;
+}
+int c;
+int
+fn2 ()
+{
+ if (a (c == 0))
+ return 0;
+}
+
+int main()
+{
+ fn2();
+}
+