Patchwork [testsuite] modify powerpc test for hard_float target, skip powerpc/warn-[12].c for soft-float

login
register
mail settings
Submitter Janis Johnson
Date Oct. 10, 2011, 8:19 p.m.
Message ID <4E935366.3060700@mentor.com>
Download mbox | patch
Permalink /patch/118826/
State New
Headers show

Comments

Janis Johnson - Oct. 10, 2011, 8:19 p.m.
Tests gcc.target/powerpc/warn-[12].c fail for soft-float multilibs with
the unexpected warning "-mvsx requires hardware floating point [enabled
by default]".  This patch skips those tests for soft-float multilibs and
modifies the powerpc check for a soft-float effective target to return
true for either __NO_FPRS__ or _SOFT_FLOAT being defined.

Is this OK for trunk?  I must admit that I'm not sure what all those
Power float variants are for.
2011-10-10  Janis Johnson  <janisjo@codesourcery.com>

	gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_hard_float):
	Special-case powerpc.
	* gcc.target/powerpc/warn-1.c: Skip if not hard_float.
	* gcc.target/powerpc/warn-2.c: Ditto.
Janis Johnson - Oct. 11, 2011, 6:08 p.m.
On 10/10/2011 01:19 PM, Janis Johnson wrote:
> Tests gcc.target/powerpc/warn-[12].c fail for soft-float multilibs with
> the unexpected warning "-mvsx requires hardware floating point [enabled
> by default]".  This patch skips those tests for soft-float multilibs and
> modifies the powerpc check for a soft-float effective target to return
> true for either __NO_FPRS__ or _SOFT_FLOAT being defined.
> 
> Is this OK for trunk?  I must admit that I'm not sure what all those
> Power float variants are for.

On second thought these tests should use

  /* { dg-require-effective-target powerpc_vsx_ok } */

instead of requiring hard_float, and forget about the proposed
change to effective target hard_float.  Is that OK?

Janis
Mike Stump - Oct. 11, 2011, 8:08 p.m.
On Oct 11, 2011, at 11:08 AM, Janis Johnson wrote:
> On 10/10/2011 01:19 PM, Janis Johnson wrote:
>> Tests gcc.target/powerpc/warn-[12].c fail for soft-float multilibs with
>> the unexpected warning "-mvsx requires hardware floating point [enabled
>> by default]".  This patch skips those tests for soft-float multilibs and
>> modifies the powerpc check for a soft-float effective target to return
>> true for either __NO_FPRS__ or _SOFT_FLOAT being defined.
>> 
>> Is this OK for trunk?  I must admit that I'm not sure what all those
>> Power float variants are for.
> 
> On second thought these tests should use
> 
>  /* { dg-require-effective-target powerpc_vsx_ok } */
> 
> instead of requiring hard_float, and forget about the proposed
> change to effective target hard_float.  Is that OK?

I was hoping a ppc person would chime in...  Ok.

Patch

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 179771)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -792,6 +792,14 @@ 
 	}]
     }
 
+    if { [istarget powerpc*-*-*] } {
+	return [check_no_compiler_messages hard_float assembly {
+		#if (defined _SOFT_FLOAT || defined __NO_FPRS__)
+		#error FOO
+		#endif
+	}]
+    }
+
     # This proc is actually checking the availabilty of FPU
     # support for doubles, so on the RX we must fail if the
     # 64-bit double multilib has been selected.
Index: gcc/testsuite/gcc.target/powerpc/warn-1.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/warn-1.c	(revision 179771)
+++ gcc/testsuite/gcc.target/powerpc/warn-1.c	(working copy)
@@ -1,4 +1,5 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-require-effective-target hard_float } */
 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
 /* { dg-options "-O -mvsx -mno-altivec" } */
 
Index: gcc/testsuite/gcc.target/powerpc/warn-2.c
===================================================================
--- gcc/testsuite/gcc.target/powerpc/warn-2.c	(revision 179771)
+++ gcc/testsuite/gcc.target/powerpc/warn-2.c	(working copy)
@@ -1,4 +1,5 @@ 
 /* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-require-effective-target hard_float } */
 /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
 /* { dg-options "-O -mcpu=power7 -mno-altivec" } */