* gcc.dg/ipa/ipa-1.c: Delete trailing spaces, put the call to f into
a loop.
* gcc.dg/ipa/ipa-2.c: Likewise.
* gcc.dg/ipa/ipa-3.c: Likewise.
* gcc.dg/ipa/ipa-4.c: Likewise.
* gcc.dg/ipa/ipa-5.c: Likewise.
* gcc.dg/ipa/ipa-7.c: Likewise.
* gcc.dg/ipa/ipa-6.c: Delete trailing spaces, put the call to foo into
a loop.
* gcc.dg/ipa/ipacost-2.c: Delete trailing spaces, put the call to
i_can_not_be_propagated_fully2 into a loop.
* gcc.dg/ipa/ipa-8.c: New test.
* g++.dg/ipa/iinline-1.C: Put the call to docalling into a loop.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157698
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-03-24 Martin Jambor <mjambor@suse.cz>
+
+ * gcc.dg/ipa/ipa-1.c: Delete trailing spaces, put the call to f into
+ a loop.
+ * gcc.dg/ipa/ipa-2.c: Likewise.
+ * gcc.dg/ipa/ipa-3.c: Likewise.
+ * gcc.dg/ipa/ipa-4.c: Likewise.
+ * gcc.dg/ipa/ipa-5.c: Likewise.
+ * gcc.dg/ipa/ipa-7.c: Likewise.
+ * gcc.dg/ipa/ipa-6.c: Delete trailing spaces, put the call to foo into
+ a loop.
+ * gcc.dg/ipa/ipacost-2.c: Delete trailing spaces, put the call to
+ i_can_not_be_propagated_fully2 into a loop.
+ * gcc.dg/ipa/ipa-8.c: New test.
+ * g++.dg/ipa/iinline-1.C: Put the call to docalling into a loop.
+
2010-03-24 Jakub Jelinek <jakub@redhat.com>
PR debug/19192
int main (int argc, char *argv[])
{
- int i;
- i = docalling (&String::funcOne);
+ int i = 0;
+ while (i < 1000)
+ i += docalling (&String::funcOne);
non_existent ("done", i);
return 0;
}
if (a > 0)
g (a, 3);
else
- g (a, 5);
+ g (a, 5);
}
int main ()
{
- f (7);
- return 0;
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7);
+ return 0;
}
}
int main ()
{
- f (7);
- return 0;
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7);
+ return 0;
}
int g (double b, double c)
{
t();
- return (int)(b+c);
+ return (int)(b+c);
}
int f (double a)
{
if (a > 0)
g (a, 3.1);
else
- g (a, 3.1);
+ g (a, 3.1);
}
int main ()
{
- f (7.44);
- return 0;
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7.44);
+ return 0;
}
}
int f (int a)
{
- /* First and second parameter of g gets different values. */
-
+ /* First and second parameter of g gets different values. */
+
if (a > 0)
g (a, 3);
else
- g (a+1, 5);
+ g (a+1, 5);
}
int main ()
{
- f (7);
- return 0;
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7);
+ return 0;
}
}
int main ()
{
- f (7.6);
- return 0;
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7.6);
+ return 0;
}
int
main ()
{
- foo (7);
+ int i;
+ for (i = 0; i < 100; i++)
+ foo (7);
return 0;
}
if (a > 0)
g (a, 3);
else
- g (a, 5);
-
+ g (a, 5);
+
send_addr (&a);
}
int main ()
{
- f (7);
- return 0;
+ int i;
+ for (i = 0; i < 100; i++)
+ f (7);
+ return 0;
}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-add-options bind_pic_locally } */
+
+#include <stdio.h>
+static int g (int b, int c)
+{
+ printf ("%d %d\n", b, c);
+}
+static int f (int a)
+{
+ /* Second parameter of g gets different values. */
+ if (a > 0)
+ g (a, 3);
+ else
+ g (a, 5);
+}
+int main ()
+{
+ f (7);
+ return 0;
+}
+
+
+/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp" } } */
+/* { dg-final { cleanup-ipa-dump "cp" } } */
+
+
int t(int);
-static int
+static int
i_can_be_propagated_fully (int *a)
{
int i;
t(a[i+3]);
}
}
-static int
+static int
i_can_be_propagated_fully2 (int *a)
{
i_can_be_propagated_fully (a);
i_can_be_propagated_fully (a);
i_can_be_propagated_fully (a);
}
-static int
+static int
i_can_not_be_propagated_fully (int *a)
{
int i;
t(a[i+3]);
}
}
-int
+int
i_can_not_be_propagated_fully2 (int *a)
{
i_can_not_be_propagated_fully (a);
}
main()
{
+ int i;
i_can_be_propagated_fully2 (array);
i_can_be_propagated_fully2 (array);
- i_can_not_be_propagated_fully2 (array);
+
+ for (i = 0; i < 100; i++)
+ i_can_not_be_propagated_fully2 (array);
i_can_not_be_propagated_fully2 (array);
}