]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PR ipa/69044] Do not clone for param removal when not possible
authorMartin Jambor <mjambor@suse.cz>
Mon, 11 Jan 2016 10:09:17 +0000 (11:09 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Mon, 11 Jan 2016 10:09:17 +0000 (11:09 +0100)
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

gcc/ChangeLog
gcc/ipa-cp.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/chkp-pr69044.c [new file with mode: 0644]

index d78db3bc3173aa64bba3499e5f9a797bf3e35eaa..f28cf448312aff96692af03a95900e748c80123f 100644 (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
index e17cc57f20c220bd6f6d4e777f4e5437091d6dfb..5900d4d91584237a598264e7d92cc7ae48178c61 100644 (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;
index a160ed095174e405c4b225d6c85d9f5c64c05728..69f589f281c584e4f9c482feef9d8b3c2c069607 100644 (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
diff --git a/gcc/testsuite/gcc.target/i386/chkp-pr69044.c b/gcc/testsuite/gcc.target/i386/chkp-pr69044.c
new file mode 100644 (file)
index 0000000..933e88a
--- /dev/null
@@ -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++;
+}