aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>2016-11-23 09:49:25 +0000
committerSenthil Kumar Selvaraj <saaadhu@gcc.gnu.org>2016-11-23 09:49:25 +0000
commitbaf53c4739a68b3307ce28bfeffc903fa641b946 (patch)
treeefd67d5b026281797943f4c7287fc36442421d04
parenta80504892ef9696ffe81248667798f1ac7d5a678 (diff)
downloadgcc-baf53c4739a68b3307ce28bfeffc903fa641b946.zip
gcc-baf53c4739a68b3307ce28bfeffc903fa641b946.tar.gz
gcc-baf53c4739a68b3307ce28bfeffc903fa641b946.tar.bz2
Fix bogus failure of uninit-19.c for avr
The test fails for avr because fn1 does not get inlined into fn2. Inlining occurs for x86_64 because fn1's computed size equals call_stmt_size. For the avr, 32 bit memory moves are more expensive, and b[3] = p10[a] results in a bigger size for fn1, preventing the inlining. Add -finline-small-functions to force early inliner to inline fn1. gcc/testsuite/ 2016-11-23 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> * gcc.dg/uninit-19.c: Add -finline-small-functions for avr. From-SVN: r242742
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/uninit-19.c9
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 92acce2..55644cd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2016-11-23 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
+
+ * gcc.dg/uninit-19.c: Add -finline-small-functions for avr.
+
2016-11-23 Jakub Jelinek <jakub@redhat.com>
PR target/78451
diff --git a/gcc/testsuite/gcc.dg/uninit-19.c b/gcc/testsuite/gcc.dg/uninit-19.c
index b138a2c..aa1b3fb 100644
--- a/gcc/testsuite/gcc.dg/uninit-19.c
+++ b/gcc/testsuite/gcc.dg/uninit-19.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-O -Wuninitialized" } */
+/* { dg-additional-options "-finline-small-functions" { target avr-*-* } } */
int a, l, m;
float *b;
@@ -10,7 +11,7 @@ fn1 (int p1, float *f1, float *f2, float *f3, unsigned char *c1, float *f4,
unsigned char *c2, float *p10)
{
if (p1 & 8)
- b[3] = p10[a]; /* 13. */
+ b[3] = p10[a]; /* 14. */
}
void
@@ -19,8 +20,8 @@ fn2 ()
float *n;
if (l & 6)
n = &c + m;
- fn1 (l, &d, &e, &g, &i, &h, &k, n); /* 22. */
+ fn1 (l, &d, &e, &g, &i, &h, &k, n); /* 23. */
}
-/* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } 13 } */
-/* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } 22 } */
+/* { dg-warning "may be used uninitialized" "" { target { { nonpic } || { hppa*64*-*-* } } } 14 } */
+/* { dg-warning "may be used uninitialized" "" { target { ! { { nonpic } || { hppa*64*-*-* } } } } 23 } */