Message ID | 20110420.065937.283599352.kkojima@rr.iij4u.or.jp |
---|---|
State | New |
Headers | show |
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*-*-* } "*" "" } */
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
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 -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)