Hello!

Attached testsuite patch fixes:

pr33992.c: In function ‘do_test’:
pr33992.c:11:1: error: inlining failed in call to always_inline ‘foo’:
function body can be overwritten at link time
pr33992.c:28:9: error: called from here
     foo (r);
         ^

errors through gcc and g++ testsuite when tested with -fpic.

2013-04-10  Uros Bizjak  <ubiz...@gmail.com>

    * g++.dg/ipa/devirt-c-7.C: Require nonpic effective target.
    * gcc.c-torture/execute/pr33992.c (foo): Declare as static void.
    * gcc.dg/uninit-pred-5_a.c (foo): Ditto.
    * gcc.dg/uninit-pred-5_b.c (foo): Ditto.

OK for mainline and release branches?

Uros.
Index: g++.dg/ipa/devirt-c-7.C
===================================================================
--- g++.dg/ipa/devirt-c-7.C     (revision 197646)
+++ g++.dg/ipa/devirt-c-7.C     (working copy)
@@ -1,6 +1,7 @@
 /* Verify that ipa-cp will not get confused by placement new constructing an
    object within another one when looking for dynamic type change .  */
 /* { dg-do run } */
+/* { dg-require-effective-target nonpic } */
 /* { dg-options "-O3 -Wno-attributes"  } */
 
 extern "C" void abort (void);
Index: gcc.c-torture/execute/pr33992.c
===================================================================
--- gcc.c-torture/execute/pr33992.c     (revision 197646)
+++ gcc.c-torture/execute/pr33992.c     (working copy)
@@ -7,7 +7,7 @@
     abort ();
 }
 
-void __attribute__((always_inline))
+static void __attribute__((always_inline))
 foo (unsigned long long *r)
 {
   int i;
Index: gcc.dg/uninit-pred-5_a.c
===================================================================
--- gcc.dg/uninit-pred-5_a.c    (revision 197646)
+++ gcc.dg/uninit-pred-5_a.c    (working copy)
@@ -6,8 +6,9 @@
 int blah(int);
 void t(int);
 
+static int
 __attribute__((always_inline)) 
-int foo (int n, int* v, int r)
+foo (int n, int* v, int r)
 {
   int flag = 0;
   if (r > n)
Index: gcc.dg/uninit-pred-5_b.c
===================================================================
--- gcc.dg/uninit-pred-5_b.c    (revision 197646)
+++ gcc.dg/uninit-pred-5_b.c    (working copy)
@@ -6,8 +6,9 @@
 int blah(int);
 void t(int);
 
+static int
 __attribute__((always_inline)) 
-int foo (int n, int* v, int r)
+foo (int n, int* v, int r)
 {
   int flag = 0;
   if (r > n)

Reply via email to