diff mbox

[testsuite,committed] Skip gcc.dg/torture/pr37868.c on sh

Message ID 20110420.065937.283599352.kkojima@rr.iij4u.or.jp
State New
Headers show

Commit Message

Kaz Kojima April 19, 2011, 9:59 p.m. UTC
Hi,

gcc.dg/torture/pr37868.c fails on SH because of unaligned accesses.
The patch below skips the test as is done for sparc targets.
It's tested with bootstrap and regtest on i686-pc-linux-gnu.
Applied on trunk.

Regards,
	kaz
--
2011-04-19  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR testsuite/48676
	* gcc.dg/torture/pr37868.c: Skip on sh*-*-*.

Comments

Mike Stump April 20, 2011, 5:23 a.m. UTC | #1
On Apr 19, 2011, at 2:59 PM, Kaz Kojima wrote:
> gcc.dg/torture/pr37868.c fails on SH because of unaligned accesses.
> The patch below skips the test as is done for sparc targets.

I'd pre-approve hoisting these up into the lib/.exp files and checking a generic target requirement...  :-)

> -/* { dg-skip-if "unaligned access" { sparc*-*-* } "*" "" } */
> +/* { dg-skip-if "unaligned access" { sparc*-*-* sh*-*-* } "*" "" } */
Kaz Kojima April 20, 2011, 12:22 p.m. UTC | #2
Mike Stump <mikestump@comcast.net> wrote:
> I'd pre-approve hoisting these up into the lib/.exp files and checking a generic target requirement...  :-)
> 
>> -/* { dg-skip-if "unaligned access" { sparc*-*-* } "*" "" } */
>> +/* { dg-skip-if "unaligned access" { sparc*-*-* sh*-*-* } "*" "" } */

I've thought the same thing when reading the recent HP's comment
about changes of testcases for avr, but gave up after grepping
STRICT_ALIGNMENT in gcc/config/*/*.h.  It seems that it isn't that
easy to write something like check_effective_target_unaligned_access
for lib/target-supports.exp with my poor knowledge for the various
targets.

Regards,
	kaz
Mike Stump April 20, 2011, 11:14 p.m. UTC | #3
On Apr 20, 2011, at 5:22 AM, Kaz Kojima wrote:
> Mike Stump <mikestump@comcast.net> wrote:
>> I'd pre-approve hoisting these up into the lib/.exp files and checking a generic target requirement...  :-)
>> 
>>> -/* { dg-skip-if "unaligned access" { sparc*-*-* } "*" "" } */
>>> +/* { dg-skip-if "unaligned access" { sparc*-*-* sh*-*-* } "*" "" } */
> 
> I've thought the same thing when reading the recent HP's comment
> about changes of testcases for avr, but gave up after grepping
> STRICT_ALIGNMENT in gcc/config/*/*.h.

Oh, I had even less work in mind.  If the test makes non-portable assumptions about alignment, just tag it as unportable due to alignment, and then for sparc and sh, just set that flag.  As others find other testcases for other machines that suffer the same general problem, they eventually would find and switch to the more maintainable form.  As someone did a new port, and saw the testcase fail, they would glance at it, see the non-portable due to alignment, say, yeah, that applies to me a well, and then just add their port to the list.  Once they did this, then presto, all the testcases would suddenly turn off, which is what they want to happen.
diff mbox

Patch

diff -up ORIG/trunk/gcc/testsuite/gcc.dg/torture/pr37868.c trunk/gcc/testsuite/gcc.dg/torture/pr37868.c
--- ORIG/trunk/gcc/testsuite/gcc.dg/torture/pr37868.c	2009-11-25 09:25:00.000000000 +0900
+++ trunk/gcc/testsuite/gcc.dg/torture/pr37868.c	2011-04-19 14:02:12.000000000 +0900
@@ -1,6 +1,6 @@ 
 /* { dg-do run } */
 /* { dg-options "-fno-strict-aliasing" } */
-/* { dg-skip-if "unaligned access" { sparc*-*-* } "*" "" } */
+/* { dg-skip-if "unaligned access" { sparc*-*-* sh*-*-* } "*" "" } */
 
 extern void abort (void);
 #if (__SIZEOF_INT__ <= 2)