diff mbox

Make pr59597 test PIC-friendly

Message ID 000b01cf226e$62945930$27bd0b90$@bolton@arm.com
State New
Headers show

Commit Message

Ian Bolton Feb. 5, 2014, 12:32 p.m. UTC
PR59597 reinstated some code to cancel unnecessary jump threading,
and brought with it a testcase to check that the cancelling happened.

http://gcc.gnu.org/ml/gcc-patches/2014-01/msg01448.html

With PIC enabled for arm and aarch64, the unnecessary jump threading
already never took place, so there is nothing to cancel, leading the
test case to fail.  My suspicion is that similar issues will happen
for other architectures too.

This patch changes the called function to be static, so that jump
threading and the resulting cancellation happen for PIC variants too.

OK for stage 4 or wait for stage 1?

Cheers,
Ian


2014-02-05  Ian Bolton  <ian.bolton@arm.com>

testsuite/
        * gcc.dg/tree-ssa/pr59597.c: Make called function static so that
        expected outcome works for PIC variants too.

Comments

Jeff Law Feb. 5, 2014, 10:35 p.m. UTC | #1
On 02/05/14 05:32, Ian Bolton wrote:
>
> 2014-02-05  Ian Bolton  <ian.bolton@arm.com>
>
> testsuite/
>          * gcc.dg/tree-ssa/pr59597.c: Make called function static so that
>          expected outcome works for PIC variants too.
This is fine for stage4.  Please install.

Thanks,
Jeff
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c b/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c
index 814d299..bc9d730 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr59597.c
@@ -8,7 +8,8 @@  typedef unsigned int u32;
 
 u32 f[NNN], t[NNN];
 
-u16 Calc_crc8(u8 data, u16 crc )
+static u16
+Calc_crc8 (u8 data, u16 crc)
 {
   u8 i=0,x16=0,carry=0;
   for (i = 0; i < 8; i++)
@@ -31,7 +32,9 @@  u16 Calc_crc8(u8 data, u16 crc )
     }
   return crc;
 }
-int main (int argc, char argv[])
+
+int
+main (int argc, char argv[])
 {
   int i, j; u16 crc;
   for (j = 0; j < 10000000; j++)