On Wed, Jun 08, 2011 at 01:03:53PM -0700, Steve Ellcey wrote:
> 2011-06-08 Steve Ellcey <[email protected]>
>
> PR middle-end/49191
> * lib/target-supports.exp (check_effective_target_strict_align): New.
> * gcc.dg/memcpy-3.c: Add dg-require-effective-target strict_align.
Isn't the test backwards, i.e. doesn't
{ dg-require-effective-target strict_align }
actually mean !STRICT_ALIGNMENT?
> Index: lib/target-supports.exp
> ===================================================================
> --- lib/target-supports.exp (revision 174336)
> +++ lib/target-supports.exp (working copy)
> @@ -3901,3 +3901,11 @@
> return 1
> }
>
> +proc check_effective_target_strict_align {} {
> + return [check_no_compiler_messages strict_align assembly {
> + char *y;
> + typedef char __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) c;
> + c *z;
> + void foo(void) { z = (c *) y; }
> + } "-Wcast-align"]
> +}
> Index: gcc.dg/memcpy-3.c
> ===================================================================
> --- gcc.dg/memcpy-3.c (revision 174336)
> +++ gcc.dg/memcpy-3.c (working copy)
> @@ -1,5 +1,6 @@
> /* { dg-do compile } */
> /* { dg-options "-O -fdump-tree-optimized" } */
> +/* { dg-require-effective-target strict_align } */
>
> int get_int(const void *p)
> {
Jakub