Commit 1e06efb6 by Martin Jambor Committed by Martin Jambor

ipa-1.c: Delete trailing spaces, put the call to f into a loop.

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.

From-SVN: r157698
parent b98aa20c
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
......
......@@ -38,8 +38,9 @@ int docalling (int (String::* f)(int delim) const)
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;
}
......
......@@ -13,12 +13,14 @@ int f (int a)
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;
}
......
......@@ -15,8 +15,10 @@ int f (int a)
}
int main ()
{
f (7);
return 0;
int i;
for (i = 0; i < 100; i++)
f (7);
return 0;
}
......
......@@ -10,19 +10,21 @@ void t(void);
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;
}
......
......@@ -9,17 +9,19 @@ int g (int b, int c)
}
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;
}
......
......@@ -20,8 +20,10 @@ int f (float a)
}
int main ()
{
f (7.6);
return 0;
int i;
for (i = 0; i < 100; i++)
f (7.6);
return 0;
}
......
......@@ -23,7 +23,9 @@ foo (int a)
int
main ()
{
foo (7);
int i;
for (i = 0; i < 100; i++)
foo (7);
return 0;
}
......
......@@ -13,14 +13,16 @@ int f (int a)
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;
}
......
/* { 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" } } */
......@@ -6,7 +6,7 @@ int array[100];
int t(int);
static int
static int
i_can_be_propagated_fully (int *a)
{
int i;
......@@ -18,14 +18,14 @@ i_can_be_propagated_fully (int *a)
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;
......@@ -37,7 +37,7 @@ i_can_not_be_propagated_fully (int *a)
t(a[i+3]);
}
}
int
int
i_can_not_be_propagated_fully2 (int *a)
{
i_can_not_be_propagated_fully (a);
......@@ -46,9 +46,12 @@ i_can_not_be_propagated_fully2 (int *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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment