[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
This commit is contained in:
Martin Jambor 2016-01-11 11:09:17 +01:00 committed by Martin Jambor
parent fa59e957b4
commit dcf89d5780
4 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -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;

View File

@ -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

View File

@ -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++;
}