diff options
author | Martin Jambor <mjambor@suse.cz> | 2016-01-11 11:09:17 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2016-01-11 11:09:17 +0100 |
commit | dcf89d578058ed538e3dcf4e151d99a267e81bf4 (patch) | |
tree | 086f88caa72ec423d6a48e38183d429a5fd6f9dc | |
parent | fa59e957b430b7fd33737f35b0b176d576bb9230 (diff) | |
download | gcc-dcf89d578058ed538e3dcf4e151d99a267e81bf4.zip gcc-dcf89d578058ed538e3dcf4e151d99a267e81bf4.tar.gz gcc-dcf89d578058ed538e3dcf4e151d99a267e81bf4.tar.bz2 |
[PR ipa/69044] Do not clone for param removal when not possible
2016-01-11 Martin Jambor <mjambor@suse.cz>
PR ipa/69044
* ipa-cp.c (estimate_local_effects): Do not clone for removal of
useless parameters if we cannot change function signature.
testsuite/
* gcc.target/i386/chkp-pr69044.c: New test.
From-SVN: r232215
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ipa-cp.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/chkp-pr69044.c | 11 |
4 files changed, 24 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d78db3b..f28cf44 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2016-01-11 Martin Jambor <mjambor@suse.cz> + PR ipa/69044 + * ipa-cp.c (estimate_local_effects): Do not clone for removal of + useless parameters if we cannot change function signature. + +2016-01-11 Martin Jambor <mjambor@suse.cz> + PR ipa/66616 * cgraphclones.c (duplicate_thunk_for_node): Copy can_change_signature flag. diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index e17cc57..5900d4d 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -2518,7 +2518,8 @@ estimate_local_effects (struct cgraph_node *node) known_aggs_ptrs = agg_jmp_p_vec_for_t_vec (known_aggs); int devirt_bonus = devirtualization_time_bonus (node, known_csts, known_contexts, known_aggs_ptrs); - if (always_const || devirt_bonus || removable_params_cost) + if (always_const || devirt_bonus + || (removable_params_cost && node->local.can_change_signature)) { struct caller_statistics stats; inline_hints hints; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a160ed0..69f589f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-01-11 Martin Jambor <mjambor@suse.cz> + + PR ipa/69044 + * gcc.target/i386/chkp-pr69044.c: New test. + 2016-01-11 Tom de Vries <tom@codesourcery.com> PR tree-optimization/69109 diff --git a/gcc/testsuite/gcc.target/i386/chkp-pr69044.c b/gcc/testsuite/gcc.target/i386/chkp-pr69044.c new file mode 100644 index 0000000..933e88a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/chkp-pr69044.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target mpx } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */ + +int i; +int strncasecmp (char *p1, char *p2, long p3) { return 0; } +int special_command () +{ + if (strncasecmp (0, 0, 0)) + i++; +} |