[PATCH, testsuite] Skip two tests for MIPS

Richard Sandiford rdsandiford@googlemail.com
Thu Jan 15 22:28:00 GMT 2009


gcc.dg/tree-ssa/ssa-store-ccp-3.c fails on traditional MIPS GNU/Linux
targets[*] because code is PIC by default.  In other words, __PIC__
isn't a reliable test of whether shared-library semantics are in
effect.  The same is true for IRIX.

We already skip the test for Darwin and HPPA for the same reason.
Is it OK to do the same for MIPS?

gcc.dg/tree-ssa/vrp47.c fails for MIPS targets because we define
LOGICAL_OP_NON_SHORT_CIRCUIT to 0.  This prevents the usual conversion
of branches to setcc operations, so the VRP optimisation doesn't trigger.

The only other target to define LOGICAL_OP_NON_SHORT_CIRCUIT is PowerPC,
and gcc-testresults has similar failures there.  So is it OK to skip
this test for MIPS?  (I'll leave PowerPC to someone who can test it.)

[ I'm not entirely convinced we _should_ be defining L_O_N_S_C to 0,
  at least not unconditionally.  I can see it makes sense for MIPS16,
  which is really set up for branches instead of setcc operations.
  And I can see that for:

      (a == b) || (c == d)

  the branch implementation (two two-register branches) is smaller
  than the setcc version, assuming we can fill the delay slots.
  But when optimising for speed, I would have expected setcc
  sequences to be faster than branch sequences on many targets.
  That's even more true for Octeon, which has SEQ and SNE
  instructions.

  That's all for another day though. ]

Tested on mips64el-linux-gnu.  OK to install?

Richard

[*] i.e. those without --with-mips-plt.


gcc/testsuite/
	* gcc.dg/tree-ssa/ssa-store-ccp-3.c: Skip for mips*-*-linux*
	and mips*-*-irix*.
	* gcc.dg/tree-ssa/vrp47.c: Skip for all MIPS targets.

Index: gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c	2009-01-14 22:57:56.000000000 +0000
+++ gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c	2009-01-14 23:00:14.000000000 +0000
@@ -1,5 +1,7 @@
 /* { dg-do compile } */
-/* { dg-skip-if "" { *-*-darwin* hppa*64*-*-* } { "*" } { "" } } */
+/* Skipped on MIPS GNU/Linux and IRIX target because __PIC__ can be
+   defined for executables as well as shared libraries.  */
+/* { dg-skip-if "" { *-*-darwin* hppa*64*-*-* mips*-*-linux* mips*-*-irix* } { "*" } { "" } } */
 /* { dg-options "-O2 -fno-common -fdump-tree-optimized" } */
 
 const int conststaticvariable;
Index: gcc/testsuite/gcc.dg/tree-ssa/vrp47.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/vrp47.c	2009-01-14 23:15:14.000000000 +0000
+++ gcc/testsuite/gcc.dg/tree-ssa/vrp47.c	2009-01-14 23:27:31.000000000 +0000
@@ -1,4 +1,6 @@
-/* { dg-do compile } */
+/* Skip on MIPS, where LOGICAL_OP_NON_SHORT_CIRCUIT inhibits the setcc
+   optimizations that expose the VRP opportunity.  */
+/* { dg-do compile { target { ! mips*-*-* } } } */
 /* { dg-options "-O2 -fdump-tree-vrp -fdump-tree-dom" } */
 
 int h(int x, int y)



More information about the Gcc-patches mailing list