diff options
author | Martin Jambor <mjambor@suse.cz> | 2019-03-07 17:42:20 +0100 |
---|---|---|
committer | Martin Jambor <jamborm@gcc.gnu.org> | 2019-03-07 17:42:20 +0100 |
commit | 59d9a0aa71e3314f6a797fdfcce44ccfe8418b8d (patch) | |
tree | 224ab2aa3b86b50bdd365b44c5235d49b1dc56ae /gcc/testsuite | |
parent | ae9b289201b6c6996b9c701109658adfb551327b (diff) | |
download | gcc-59d9a0aa71e3314f6a797fdfcce44ccfe8418b8d.zip gcc-59d9a0aa71e3314f6a797fdfcce44ccfe8418b8d.tar.gz gcc-59d9a0aa71e3314f6a797fdfcce44ccfe8418b8d.tar.bz2 |
Zero local estimated benefit for cloning extern inline function
2019-03-07 Martin Jambor <mjambor@suse.cz>
PR lto/87525
* ipa-cp.c (perform_estimation_of_a_value): Account zero time benefit
for extern inline functions.
testsuite/
* gcc.dg/ipa/ipcp-5.c: New test.
From-SVN: r269464
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipcp-5.c | 45 |
2 files changed, 50 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d0bd734..bf1546b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2019-03-07 Martin Jambor <mjambor@suse.cz> + PR lto/87525 + * gcc.dg/ipa/ipcp-5.c: New test. + +2019-03-07 Martin Jambor <mjambor@suse.cz> + PR ipa/88235 * g++.dg/ipa/pr88235.C: New test. diff --git a/gcc/testsuite/gcc.dg/ipa/ipcp-5.c b/gcc/testsuite/gcc.dg/ipa/ipcp-5.c new file mode 100644 index 0000000..6786c51 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipcp-5.c @@ -0,0 +1,45 @@ +/* Test that estimated local cloning time benefit of extern inline functions is + zero. */ + +/* { dg-do compile } */ +/* { dg-options "-O3 -fdump-ipa-cp -fno-early-inlining" } */ +/* { dg-add-options bind_pic_locally } */ + +extern int get_int (void); +extern void use_stuff (int); + +int arr[10]; + +inline void +f (int a) +{ + arr[0] += a + 5; + arr[1] += a + 50; + arr[2] += a - 3; + arr[3] += a; + arr[4] += a + 21; + arr[5] += a + 900; + arr[6] += a + 2; + arr[7] += a + 3456; + arr[8] += a + 3; + arr[9] += a + 32; + use_stuff (a); +} + + +int +entry (void) +{ + int i; + for (i = 0; i < 100; i++) + f (7); + for (i = 0; i < 100; i++) + f (get_int ()); + return 0; +} + + +/* { dg-final { scan-ipa-dump "loc_time: 0" "cp" } } */ +/* { dg-final { scan-ipa-dump-not "replacing param.*with const" "cp" } } */ + + |