This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, testsuite] New effective target long_neq_int
- From: "William J. Schmidt" <wschmidt at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: bergner at vnet dot ibm dot com, janis_johnson at mentor dot com
- Date: Thu, 09 Aug 2012 20:46:36 -0500
- Subject: [PATCH, testsuite] New effective target long_neq_int
As suggested by Janis regarding testsuite/gcc.dg/tree-ssa/slsr-30.c,
this patch adds a new effective target for machines having long and int
of differing sizes.
Tested on powerpc64-unknown-linux-gnu, where the test passes for -m64
and is skipped for -m32. Ok for trunk?
Thanks,
Bill
doc:
2012-08-09 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* sourcebuild.texi: Document long_neq_int effective target.
testsuite:
2012-08-09 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* lib/target-supports.exp (check_effective_target_long_neq_int): New.
* gcc.dg/tree-ssa/slsr-30.c: Check for long_neq_int effective target.
Index: gcc/doc/sourcebuild.texi
===================================================================
--- gcc/doc/sourcebuild.texi (revision 190260)
+++ gcc/doc/sourcebuild.texi (working copy)
@@ -1303,6 +1303,9 @@ Target has @code{int} that is at 32 bits or longer
@item int16
Target has @code{int} that is 16 bits or shorter.
+@item long_neq_int
+Target has @code{int} and @code{long} with different sizes.
+
@item large_double
Target supports @code{double} that is longer than @code{float}.
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp (revision 190260)
+++ gcc/testsuite/lib/target-supports.exp (working copy)
@@ -1689,6 +1689,15 @@ proc check_effective_target_llp64 { } {
}]
}
+# Return 1 if long and int have different sizes,
+# 0 otherwise.
+
+proc check_effective_target_long_neq_int { } {
+ return [check_no_compiler_messages long_ne_int object {
+ int dummy[sizeof (int) != sizeof (long) ? 1 : -1];
+ }]
+}
+
# Return 1 if the target supports long double larger than double,
# 0 otherwise.
Index: gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c (revision 190260)
+++ gcc/testsuite/gcc.dg/tree-ssa/slsr-30.c (working copy)
@@ -1,7 +1,7 @@
/* Verify straight-line strength reduction fails for simple integer addition
with casts thrown in when -fwrapv is used. */
-/* { dg-do compile { target { ! { ilp32 } } } } */
+/* { dg-do compile { target { long_neq_int } } } */
/* { dg-options "-O3 -fdump-tree-dom2 -fwrapv" } */
long