diff options
author | Ilya Enkovich <ilya.enkovich@intel.com> | 2015-04-06 10:41:55 +0000 |
---|---|---|
committer | Ilya Enkovich <ienkovich@gcc.gnu.org> | 2015-04-06 10:41:55 +0000 |
commit | 71671f5d5259f40720b0636625b1edd11fb11f18 (patch) | |
tree | 7a83ac87b8e0b11931890da884f8cb2ddebdd348 /gcc | |
parent | f1e5203841c2610c6bd33770354d3a8cf7b4e37c (diff) | |
download | gcc-71671f5d5259f40720b0636625b1edd11fb11f18.zip gcc-71671f5d5259f40720b0636625b1edd11fb11f18.tar.gz gcc-71671f5d5259f40720b0636625b1edd11fb11f18.tar.bz2 |
ipa-chkp.c (chkp_maybe_create_clone): Reset cdtor flags for instrumentation thunk.
gcc/
* ipa-chkp.c (chkp_maybe_create_clone): Reset cdtor
flags for instrumentation thunk.
(chkp_produce_thunks): Likewise.
gcc/testsuite/
* gcc.dg/lto/chkp-ctor-merge_0.c: New.
From-SVN: r221877
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ipa-chkp.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/chkp-ctor-merge_0.c | 23 |
4 files changed, 39 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f9cb04c..847c532 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-04-06 Ilya Enkovich <ilya.enkovich@intel.com> + + * ipa-chkp.c (chkp_maybe_create_clone): Reset cdtor + flags for instrumentation thunk. + (chkp_produce_thunks): Likewise. + 2015-04-05 Martin Liska <mliska@suse.cz> PR ipa/65665 diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c index 3218d42..03abab5 100644 --- a/gcc/ipa-chkp.c +++ b/gcc/ipa-chkp.c @@ -550,6 +550,9 @@ chkp_maybe_create_clone (tree fndecl) clone->thunk.thunk_p = true; clone->thunk.add_pointer_bounds_args = true; clone->create_edge (node, NULL, 0, CGRAPH_FREQ_BASE); + /* Thunk shouldn't be a cdtor. */ + DECL_STATIC_CONSTRUCTOR (clone->decl) = 0; + DECL_STATIC_DESTRUCTOR (clone->decl) = 0; } else { @@ -714,6 +717,9 @@ chkp_produce_thunks (bool early) 0, CGRAPH_FREQ_BASE); node->create_reference (node->instrumented_version, IPA_REF_CHKP, NULL); + /* Thunk shouldn't be a cdtor. */ + DECL_STATIC_CONSTRUCTOR (node->decl) = 0; + DECL_STATIC_DESTRUCTOR (node->decl) = 0; } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bb7d971..9849363 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-04-06 Ilya Enkovich <ilya.enkovich@intel.com> + + * gcc.dg/lto/chkp-ctor-merge_0.c: New. + 2015-04-04 Vladimir Makarov <vmakarov@redhat.com> PR target/65647 diff --git a/gcc/testsuite/gcc.dg/lto/chkp-ctor-merge_0.c b/gcc/testsuite/gcc.dg/lto/chkp-ctor-merge_0.c new file mode 100644 index 0000000..ac4095b --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/chkp-ctor-merge_0.c @@ -0,0 +1,23 @@ +/* { dg-lto-do run } */ +/* { dg-require-effective-target mpx } */ +/* { dg-lto-options { { -O2 -flto -fcheck-pointer-bounds -mmpx -nodefaultlibs -lc } } } */ + +int glob = 1; + +void __attribute__((constructor)) +ctor1 () +{ + glob += 1; +} + + +void __attribute__((constructor)) +ctor2 () +{ + glob -= 2; +} + +int main (int argc, const char **argv) +{ + return glob; +} |