public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] Add nomips16 attributes to gcc.dg/unroll_5.c
@ 2013-01-13  8:56 Richard Sandiford
  0 siblings, 0 replies; only message in thread
From: Richard Sandiford @ 2013-01-13  8:56 UTC (permalink / raw)
  To: gcc-patches

gcc.dg/unroll_5.c fails on MIPS16 because we don't recognise the
MIPS16 XOR-based equality comparisons as being equality comparisons.
I suppose that might be worth handling in principle, but unrolling
isn't something that MIPS16 users are likely to want anyway, so it's
not really an interesting use case.

Ideally we'd XFAIL this for MIPS16, but that's difficult because
of -mflip-mips16, which will cause one function to be compiled
normally (and work) and another to be compiled as -mips16 (and fail).
In the past I've added nomips16 attributes instead, so I've done
the same here.

Tested on x86_64-linux-gnu, mipsisa64-elf and mips64-linux-gnu.  Applied.

Richard


gcc/testsuite/
	* gcc.dg/unroll_5.c: Add nomips16 attributes.

Index: gcc/testsuite/gcc.dg/unroll_5.c
===================================================================
--- gcc/testsuite/gcc.dg/unroll_5.c	2012-11-27 18:52:27.000000000 +0000
+++ gcc/testsuite/gcc.dg/unroll_5.c	2013-01-12 12:43:37.086146761 +0000
@@ -4,6 +4,11 @@
 
 void abort (void);
 int *a;
+/* Fails on MIPS16 because equality checks are implemented using XOR.
+   It's unlikely MIPS16 users would want unrolling anyway.  */
+#ifdef __mips
+__attribute__((nomips16))
+#endif
 int t()
 {
    int i;
@@ -12,6 +17,9 @@ int t()
       return 1;
   return 0;
 }
+#ifdef __mips
+__attribute__((nomips16))
+#endif
 int t2()
 {
    int i;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-13  8:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-13  8:56 [committed] Add nomips16 attributes to gcc.dg/unroll_5.c Richard Sandiford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).