[1/4] testsuite: Filter unaligned pointer value warning

Message ID 20200720163106.27849-2-dimitar@dinux.eu
State New
Headers show
Series
  • testsuite: Add markers for default_packed targets
Related show

Commit Message

Dimitar Dimitrov July 20, 2020, 4:31 p.m.
Targets which pack structures by default will not get warnings about
unaligned access to structure members.

gcc/testsuite/ChangeLog:

	* c-c++-common/Waddress-of-packed-member-1.c: Filter dg-warning
	for targets who pack by default.
	* c-c++-common/Waddress-of-packed-member-2.c: Ditto.
	* c-c++-common/pr51628-13.c: Ditto.
	* c-c++-common/pr51628-15.c: Ditto.
	* c-c++-common/pr51628-16.c: Ditto.
	* c-c++-common/pr51628-26.c: Ditto.
	* c-c++-common/pr51628-27.c: Ditto.
	* c-c++-common/pr51628-28.c: Ditto.
	* c-c++-common/pr51628-29.c: Ditto.
	* c-c++-common/pr51628-3.c: Ditto.
	* c-c++-common/pr51628-30.c: Ditto.
	* c-c++-common/pr51628-31.c: Ditto.
	* c-c++-common/pr51628-32.c: Ditto.
	* c-c++-common/pr51628-33.c: Ditto.
	* c-c++-common/pr51628-35.c: Ditto.
	* c-c++-common/pr51628-4.c: Ditto.
	* c-c++-common/pr51628-5.c: Ditto.
	* c-c++-common/pr51628-6.c: Ditto.
	* c-c++-common/pr51628-8.c: Ditto.
	* c-c++-common/pr51628-9.c: Ditto.
	* c-c++-common/pr88664-2.c: Ditto.
	* gcc.dg/pr51628-17.c: Ditto.
	* gcc.dg/pr51628-19.c: Ditto.
	* gcc.dg/pr51628-20.c: Ditto.
	* gcc.dg/pr51628-21.c: Ditto.
	* gcc.dg/pr51628-22.c: Ditto.
	* gcc.dg/pr51628-24.c: Ditto.
	* gcc.dg/pr51628-25.c: Ditto.
	* gcc.dg/pr51628-34.c: Ditto.
	* gcc.dg/pr88928.c: Ditto.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>

---
 .../Waddress-of-packed-member-1.c             | 48 +++++++++----------
 .../Waddress-of-packed-member-2.c             | 36 +++++++-------
 gcc/testsuite/c-c++-common/pr51628-13.c       |  2 +-
 gcc/testsuite/c-c++-common/pr51628-15.c       |  2 +-
 gcc/testsuite/c-c++-common/pr51628-16.c       |  4 +-
 gcc/testsuite/c-c++-common/pr51628-26.c       |  6 +--
 gcc/testsuite/c-c++-common/pr51628-27.c       |  2 +-
 gcc/testsuite/c-c++-common/pr51628-28.c       | 10 ++--
 gcc/testsuite/c-c++-common/pr51628-29.c       |  2 +-
 gcc/testsuite/c-c++-common/pr51628-3.c        | 12 ++---
 gcc/testsuite/c-c++-common/pr51628-30.c       |  4 +-
 gcc/testsuite/c-c++-common/pr51628-31.c       |  2 +-
 gcc/testsuite/c-c++-common/pr51628-32.c       |  2 +-
 gcc/testsuite/c-c++-common/pr51628-33.c       |  2 +-
 gcc/testsuite/c-c++-common/pr51628-35.c       |  4 +-
 gcc/testsuite/c-c++-common/pr51628-4.c        | 12 ++---
 gcc/testsuite/c-c++-common/pr51628-5.c        | 12 ++---
 gcc/testsuite/c-c++-common/pr51628-6.c        | 12 ++---
 gcc/testsuite/c-c++-common/pr51628-8.c        | 14 +++---
 gcc/testsuite/c-c++-common/pr51628-9.c        | 14 +++---
 gcc/testsuite/c-c++-common/pr88664-2.c        |  4 +-
 gcc/testsuite/gcc.dg/pr51628-17.c             |  2 +-
 gcc/testsuite/gcc.dg/pr51628-19.c             |  6 +--
 gcc/testsuite/gcc.dg/pr51628-20.c             |  2 +-
 gcc/testsuite/gcc.dg/pr51628-21.c             |  2 +-
 gcc/testsuite/gcc.dg/pr51628-22.c             |  2 +-
 gcc/testsuite/gcc.dg/pr51628-24.c             |  2 +-
 gcc/testsuite/gcc.dg/pr51628-25.c             |  2 +-
 gcc/testsuite/gcc.dg/pr51628-34.c             |  8 ++--
 gcc/testsuite/gcc.dg/pr88928.c                |  2 +-
 30 files changed, 117 insertions(+), 117 deletions(-)

-- 
2.20.1

Comments

Richard Sandiford July 20, 2020, 5:51 p.m. | #1
Dimitar Dimitrov <dimitar@dinux.eu> writes:
> Targets which pack structures by default will not get warnings about

> unaligned access to structure members.

>

> gcc/testsuite/ChangeLog:

>

> 	* c-c++-common/Waddress-of-packed-member-1.c: Filter dg-warning

> 	for targets who pack by default.

> 	* c-c++-common/Waddress-of-packed-member-2.c: Ditto.

> 	* c-c++-common/pr51628-13.c: Ditto.

> 	* c-c++-common/pr51628-15.c: Ditto.

> 	* c-c++-common/pr51628-16.c: Ditto.

> 	* c-c++-common/pr51628-26.c: Ditto.

> 	* c-c++-common/pr51628-27.c: Ditto.

> 	* c-c++-common/pr51628-28.c: Ditto.

> 	* c-c++-common/pr51628-29.c: Ditto.

> 	* c-c++-common/pr51628-3.c: Ditto.

> 	* c-c++-common/pr51628-30.c: Ditto.

> 	* c-c++-common/pr51628-31.c: Ditto.

> 	* c-c++-common/pr51628-32.c: Ditto.

> 	* c-c++-common/pr51628-33.c: Ditto.

> 	* c-c++-common/pr51628-35.c: Ditto.

> 	* c-c++-common/pr51628-4.c: Ditto.

> 	* c-c++-common/pr51628-5.c: Ditto.

> 	* c-c++-common/pr51628-6.c: Ditto.

> 	* c-c++-common/pr51628-8.c: Ditto.

> 	* c-c++-common/pr51628-9.c: Ditto.

> 	* c-c++-common/pr88664-2.c: Ditto.

> 	* gcc.dg/pr51628-17.c: Ditto.

> 	* gcc.dg/pr51628-19.c: Ditto.

> 	* gcc.dg/pr51628-20.c: Ditto.

> 	* gcc.dg/pr51628-21.c: Ditto.

> 	* gcc.dg/pr51628-22.c: Ditto.

> 	* gcc.dg/pr51628-24.c: Ditto.

> 	* gcc.dg/pr51628-25.c: Ditto.

> 	* gcc.dg/pr51628-34.c: Ditto.

> 	* gcc.dg/pr88928.c: Ditto.

>

> Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>


OK, thanks.

For avoidance of doubt, it's not likely that people will remember
to add this target selector to new tests, so keeping the testsuite
clean will be an ongoing problem for people who test the affected
targets.  Adding missing selectors would qualify as obvious though.

Richard

> ---

>  .../Waddress-of-packed-member-1.c             | 48 +++++++++----------

>  .../Waddress-of-packed-member-2.c             | 36 +++++++-------

>  gcc/testsuite/c-c++-common/pr51628-13.c       |  2 +-

>  gcc/testsuite/c-c++-common/pr51628-15.c       |  2 +-

>  gcc/testsuite/c-c++-common/pr51628-16.c       |  4 +-

>  gcc/testsuite/c-c++-common/pr51628-26.c       |  6 +--

>  gcc/testsuite/c-c++-common/pr51628-27.c       |  2 +-

>  gcc/testsuite/c-c++-common/pr51628-28.c       | 10 ++--

>  gcc/testsuite/c-c++-common/pr51628-29.c       |  2 +-

>  gcc/testsuite/c-c++-common/pr51628-3.c        | 12 ++---

>  gcc/testsuite/c-c++-common/pr51628-30.c       |  4 +-

>  gcc/testsuite/c-c++-common/pr51628-31.c       |  2 +-

>  gcc/testsuite/c-c++-common/pr51628-32.c       |  2 +-

>  gcc/testsuite/c-c++-common/pr51628-33.c       |  2 +-

>  gcc/testsuite/c-c++-common/pr51628-35.c       |  4 +-

>  gcc/testsuite/c-c++-common/pr51628-4.c        | 12 ++---

>  gcc/testsuite/c-c++-common/pr51628-5.c        | 12 ++---

>  gcc/testsuite/c-c++-common/pr51628-6.c        | 12 ++---

>  gcc/testsuite/c-c++-common/pr51628-8.c        | 14 +++---

>  gcc/testsuite/c-c++-common/pr51628-9.c        | 14 +++---

>  gcc/testsuite/c-c++-common/pr88664-2.c        |  4 +-

>  gcc/testsuite/gcc.dg/pr51628-17.c             |  2 +-

>  gcc/testsuite/gcc.dg/pr51628-19.c             |  6 +--

>  gcc/testsuite/gcc.dg/pr51628-20.c             |  2 +-

>  gcc/testsuite/gcc.dg/pr51628-21.c             |  2 +-

>  gcc/testsuite/gcc.dg/pr51628-22.c             |  2 +-

>  gcc/testsuite/gcc.dg/pr51628-24.c             |  2 +-

>  gcc/testsuite/gcc.dg/pr51628-25.c             |  2 +-

>  gcc/testsuite/gcc.dg/pr51628-34.c             |  8 ++--

>  gcc/testsuite/gcc.dg/pr88928.c                |  2 +-

>  30 files changed, 117 insertions(+), 117 deletions(-)

>

> diff --git a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c

> index afad603dfa2..95a376664da 100644

> --- a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c

> +++ b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c

> @@ -52,28 +52,28 @@ void foo (void)

>    f0 = *&__real__ t0.f;        /* { dg-bogus "may result in an unaligned pointer value" } */

>    f0 = *&__imag__ t0.f;        /* { dg-bogus "may result in an unaligned pointer value" } */

>    i1 = (&t0.c, (int*) 0);      /* { dg-bogus "may result in an unaligned pointer value" } */

> -  t2 = (struct t**) t10;     /* { dg-warning "may result in an unaligned pointer value" } */

> -  t2 = (struct t**) t100;    /* { dg-warning "may result in an unaligned pointer value" } */

> -  t2 = (struct t**) t1;      /* { dg-warning "may result in an unaligned pointer value" } */

> -  t2 = (struct t**) bar();   /* { dg-warning "may result in an unaligned pointer value" } */

> -  t2 = (struct t**) baz();   /* { dg-warning "may result in an unaligned pointer value" } */

> -  t2 = (struct t**) bazz();  /* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = &t0.b;                /* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = &t1->b;               /* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = &t10[0].b;            /* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = t0.d;                 /* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = t1->d;                /* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = t10[0].d;             /* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = (int*) &t10[0].e[0];  /* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = (int*) t10[0].e;      /* { dg-warning "may result in an unaligned pointer value" } */

> -  i2 = &t10[0].e[0];         /* { dg-warning "may result in an unaligned pointer value" } */

> -  i2 = t10[0].e;             /* { dg-warning "may result in an unaligned pointer value" } */

> -  i2 = &*&t0.c;              /* { dg-warning "may result in an unaligned pointer value" } */

> -  i2 = &*&*&t0.c;            /* { dg-warning "may result in an unaligned pointer value" } */

> -  f1 = &__real__ t0.f;       /* { dg-warning "may result in an unaligned pointer value" } */

> -  f1 = &__imag__ t0.f;       /* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = (0, (int*) &t0.c);    /* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = (int*) (0, &t0.c);    /* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = (0, (int*)(0, &t0.c));/* { dg-warning "may result in an unaligned pointer value" } */

> -  i1 = (int*)(0, 1, (void*)(2, 3, (int*)(4, 5, &t0.c)));/* { dg-warning "may result in an unaligned pointer value" } */

> +  t2 = (struct t**) t10;     /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  t2 = (struct t**) t100;    /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  t2 = (struct t**) t1;      /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  t2 = (struct t**) bar();   /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  t2 = (struct t**) baz();   /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  t2 = (struct t**) bazz();  /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = &t0.b;                /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = &t1->b;               /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = &t10[0].b;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = t0.d;                 /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = t1->d;                /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = t10[0].d;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = (int*) &t10[0].e[0];  /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = (int*) t10[0].e;      /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i2 = &t10[0].e[0];         /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i2 = t10[0].e;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i2 = &*&t0.c;              /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i2 = &*&*&t0.c;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  f1 = &__real__ t0.f;       /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  f1 = &__imag__ t0.f;       /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = (0, (int*) &t0.c);    /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = (int*) (0, &t0.c);    /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = (0, (int*)(0, &t0.c));/* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i1 = (int*)(0, 1, (void*)(2, 3, (int*)(4, 5, &t0.c)));/* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c

> index 65ec5140c9c..5dbcb89ffbc 100644

> --- a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c

> +++ b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c

> @@ -24,24 +24,24 @@ int *i0;

>  

>  void foo (void)

>  {

> -  i0 = s0.p.a;               /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = t0.p.a;               /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = s0.p.b[0];            /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = t0.p.b[0];            /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = &s0.p.a[0];           /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = &t0.p.a[0];           /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = &s0.p.b[0][0];        /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = &t0.p.b[0][0];        /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = *s0.p.b;              /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = *t0.p.b;              /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = &**s0.p.b;            /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = &**t0.p.b;            /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = **&s0.p.b;            /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = **&t0.p.b;            /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = &*s0.p.a;             /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = &*t0.p.a;             /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = *&s0.p.a;             /* { dg-warning "may result in an unaligned pointer value" } */

> -  i0 = *&t0.p.a;             /* { dg-warning "may result in an unaligned pointer value" } */

> +  i0 = s0.p.a;               /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = t0.p.a;               /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = s0.p.b[0];            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = t0.p.b[0];            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = &s0.p.a[0];           /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = &t0.p.a[0];           /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = &s0.p.b[0][0];        /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = &t0.p.b[0][0];        /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = *s0.p.b;              /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = *t0.p.b;              /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = &**s0.p.b;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = &**t0.p.b;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = **&s0.p.b;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = **&t0.p.b;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = &*s0.p.a;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = &*t0.p.a;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = *&s0.p.a;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

> +  i0 = *&t0.p.a;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */

>    i0 = t0.u.a;                 /* { dg-bogus "may result in an unaligned pointer value" } */

>    i0 = t0.u.b[0];              /* { dg-bogus "may result in an unaligned pointer value" } */

>    i0 = &t0.u.a[0];             /* { dg-bogus "may result in an unaligned pointer value" } */

> diff --git a/gcc/testsuite/c-c++-common/pr51628-13.c b/gcc/testsuite/c-c++-common/pr51628-13.c

> index 0edd5e7f84d..b77e16c408f 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-13.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-13.c

> @@ -6,4 +6,4 @@ struct B { int i; };

>  struct C { struct B b; } __attribute__ ((packed));

>  

>  int* h4 (struct C *p) { return &p->b.i; }

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

> diff --git a/gcc/testsuite/c-c++-common/pr51628-15.c b/gcc/testsuite/c-c++-common/pr51628-15.c

> index bcac6d70ad5..2ce3406481f 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-15.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-15.c

> @@ -10,5 +10,5 @@ int*

>  f (struct A *p, int *q)

>  {

>    return q ? q : &p->i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-16.c b/gcc/testsuite/c-c++-common/pr51628-16.c

> index cd502fe76b8..b02cd8df1fc 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-16.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-16.c

> @@ -8,6 +8,6 @@ struct B {

>  } b;

>  

>  int *p = (int*)&b.a.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  int *q = (int*)&b.a;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

> diff --git a/gcc/testsuite/c-c++-common/pr51628-26.c b/gcc/testsuite/c-c++-common/pr51628-26.c

> index 2042379860a..5ca381dba5d 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-26.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-26.c

> @@ -15,19 +15,19 @@ void

>  foo1 (void)

>  {

>    addr = (i = -1, &p.i);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

>  

>  void

>  foo2 (void)

>  {

>    addr = (i = -1, j = -2, &p.i);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

>  

>  void

>  foo3 (void)

>  {

>    addr = (i = -1, (j = -2, &p.i));

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-27.c b/gcc/testsuite/c-c++-common/pr51628-27.c

> index 9ae1efd7afb..016a68f6549 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-27.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-27.c

> @@ -9,4 +9,4 @@ struct C { struct B b; };

>  extern struct C *p;

>  

>  int* g8 (void) { return &p->b.a.i; }

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

> diff --git a/gcc/testsuite/c-c++-common/pr51628-28.c b/gcc/testsuite/c-c++-common/pr51628-28.c

> index 3cc1fec1f71..80d0c605670 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-28.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-28.c

> @@ -11,9 +11,9 @@ foo3 (struct A *p1, int *q1, int *q2, struct A *p2)

>  {

>    return (q1 

>  	  ? &p1->i

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  	  : (q2 ? &p2->i : q2));

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

>  

>  int*

> @@ -21,11 +21,11 @@ foo4 (struct A *p1, int **q1, int *q2, int *q3, struct A *p2)

>  {

>    return (q1

>  	  ? (*q1 = q2, &p1->i)

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  	  : (q2

>  	     ? (*q1 = &p1->i,

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  		*q2 = 2, &p2->i)

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  	     : q2));

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-29.c b/gcc/testsuite/c-c++-common/pr51628-29.c

> index 94b3722d2c8..a3e77455b6b 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-29.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-29.c

> @@ -12,5 +12,5 @@ int*

>  g8 (void)

>  {

>    return &p->b.a.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-3.c b/gcc/testsuite/c-c++-common/pr51628-3.c

> index 0ea94c845a0..805ce7d0509 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-3.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-3.c

> @@ -13,7 +13,7 @@ extern int *x;

>  extern void bar (int *);

>  

>  int *addr = &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  

>  int *

>  foo (void)

> @@ -21,15 +21,15 @@ foo (void)

>    struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };

>    int *p0, *p1;

>    p0 = &arr[0].i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p0);

>    p1 = &arr[1].i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p1);

>    bar (&p.i);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    x = &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    return &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-30.c b/gcc/testsuite/c-c++-common/pr51628-30.c

> index 578edf4e8f9..b31e73ec036 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-30.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-30.c

> @@ -12,12 +12,12 @@ int*

>  foo1 (void)

>  {

>    return &__real(p->b.a.i);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

>  

>  int*

>  foo2 (void)

>  {

>    return &__imag(p->b.a.i);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-31.c b/gcc/testsuite/c-c++-common/pr51628-31.c

> index 9730f53f582..b2963581dcb 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-31.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-31.c

> @@ -12,5 +12,5 @@ int *

>  foo()

>  {

>    return &x.x[1];

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-32.c b/gcc/testsuite/c-c++-common/pr51628-32.c

> index a62e57d5b46..52f5e543ab7 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-32.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-32.c

> @@ -16,4 +16,4 @@ struct B

>  struct B b;

>  

>  int *p = &b.ar[1].i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

> diff --git a/gcc/testsuite/c-c++-common/pr51628-33.c b/gcc/testsuite/c-c++-common/pr51628-33.c

> index 0092f32202f..6b5e277b7c6 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-33.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-33.c

> @@ -15,5 +15,5 @@ void

>  foo (struct pair_t *p)

>  {

>    bar (p ? p->i : (int *) 0);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-35.c b/gcc/testsuite/c-c++-common/pr51628-35.c

> index 20877792fd8..fa37d99beb7 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-35.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-35.c

> @@ -12,12 +12,12 @@ long *

>  foo1 (void)

>  {

>    return (long *) p;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

>  

>  long *

>  foo2 (void)

>  {

>    return (long *) bar ();

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-4.c b/gcc/testsuite/c-c++-common/pr51628-4.c

> index c4c1fb72d6d..ba88f5d0a39 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-4.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-4.c

> @@ -13,7 +13,7 @@ extern int *x;

>  extern void bar (int *);

>  

>  int *addr = &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  

>  int *

>  foo (void)

> @@ -21,15 +21,15 @@ foo (void)

>    struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };

>    int *p0, *p1;

>    p0 = &arr[0].i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p0);

>    p1 = &arr[1].i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p1);

>    bar (&p.i);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    x = &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    return &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-5.c b/gcc/testsuite/c-c++-common/pr51628-5.c

> index 9d7c309a0ef..86d01e9f3b3 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-5.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-5.c

> @@ -13,7 +13,7 @@ extern int *x;

>  extern void bar (int *);

>  

>  int *addr = &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  

>  int *

>  foo (void)

> @@ -21,15 +21,15 @@ foo (void)

>    struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };

>    int *p0, *p1;

>    p0 = &arr[0].i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p0);

>    p1 = &arr[1].i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p1);

>    bar (&p.i);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    x = &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    return &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-6.c b/gcc/testsuite/c-c++-common/pr51628-6.c

> index 52aa07a4cf3..e7be7fbffc5 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-6.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-6.c

> @@ -13,7 +13,7 @@ extern int *x;

>  extern void bar (int *);

>  

>  int *addr = &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  

>  int *

>  foo (void)

> @@ -21,15 +21,15 @@ foo (void)

>    struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };

>    int *p0, *p1;

>    p0 = &arr[0].i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p0);

>    p1 = &arr[1].i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p1);

>    bar (&p.i);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    x = &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    return &p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-8.c b/gcc/testsuite/c-c++-common/pr51628-8.c

> index cc2dae096ae..dd4f1904c11 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-8.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-8.c

> @@ -13,24 +13,24 @@ extern int *x;

>  extern void bar (int *);

>  

>  int *addr = p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  

>  int *

>  foo (struct pair_t *p)

>  {

>    int *p0, *p1;

>    p0 = p->i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p0);

>    p1 = &p->i[1];

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p1);

>    bar (p->i);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (&p->i[2]);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    x = p->i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    return &p->i[3];

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr51628-9.c b/gcc/testsuite/c-c++-common/pr51628-9.c

> index 0470aa3b93d..aa3d5292d43 100644

> --- a/gcc/testsuite/c-c++-common/pr51628-9.c

> +++ b/gcc/testsuite/c-c++-common/pr51628-9.c

> @@ -13,24 +13,24 @@ extern int *x;

>  extern void bar (int *);

>  

>  int *addr = p.i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  

>  int *

>  foo (struct pair_t *p)

>  {

>    int *p0, *p1;

>    p0 = p->i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p0);

>    p1 = &p->i[1];

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (p1);

>    bar (p->i);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    bar (&p->i[2]);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    x = p->i;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    return &p->i[3];

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/c-c++-common/pr88664-2.c b/gcc/testsuite/c-c++-common/pr88664-2.c

> index d2d880a66d7..9a81b751802 100644

> --- a/gcc/testsuite/c-c++-common/pr88664-2.c

> +++ b/gcc/testsuite/c-c++-common/pr88664-2.c

> @@ -11,12 +11,12 @@ void **

>  fun1 (struct data *p)

>  {

>    return &p->ptr;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

>  

>  int *

>  fun2 (struct data *p, int *x)

>  {

>    return p ? (*x = 1, (int *) &p->ptr) : (int *) 0;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/gcc.dg/pr51628-17.c b/gcc/testsuite/gcc.dg/pr51628-17.c

> index 0be95b2294e..42dc9d745dc 100644

> --- a/gcc/testsuite/gcc.dg/pr51628-17.c

> +++ b/gcc/testsuite/gcc.dg/pr51628-17.c

> @@ -7,4 +7,4 @@ struct A {

>  } __attribute__ ((packed));

>  

>  long* f8 (struct A *p) { return &p->i; }

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

> diff --git a/gcc/testsuite/gcc.dg/pr51628-19.c b/gcc/testsuite/gcc.dg/pr51628-19.c

> index 7ff03e85cea..91ff39abc88 100644

> --- a/gcc/testsuite/gcc.dg/pr51628-19.c

> +++ b/gcc/testsuite/gcc.dg/pr51628-19.c

> @@ -16,11 +16,11 @@ bar (int n, int k, void *ptr)

>  

>    int *p0, *p1;

>    p0 = p->x;

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    foo (p0);

>    p1 = &p->x[1];

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>    foo (p1);

>    return &p->x[1];

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/gcc.dg/pr51628-20.c b/gcc/testsuite/gcc.dg/pr51628-20.c

> index bcdbff1e554..2249d85098b 100644

> --- a/gcc/testsuite/gcc.dg/pr51628-20.c

> +++ b/gcc/testsuite/gcc.dg/pr51628-20.c

> @@ -8,4 +8,4 @@ struct C { struct B b; } __attribute__ ((packed));

>  extern struct C *p;

>  

>  long* g8 (void) { return p; }

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

> diff --git a/gcc/testsuite/gcc.dg/pr51628-21.c b/gcc/testsuite/gcc.dg/pr51628-21.c

> index 0c7fab75d8a..f1adbe64002 100644

> --- a/gcc/testsuite/gcc.dg/pr51628-21.c

> +++ b/gcc/testsuite/gcc.dg/pr51628-21.c

> @@ -8,4 +8,4 @@ struct C { struct B b; } __attribute__ ((packed));

>  extern struct C p[];

>  

>  long* g8 (void) { return p; }

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

> diff --git a/gcc/testsuite/gcc.dg/pr51628-22.c b/gcc/testsuite/gcc.dg/pr51628-22.c

> index 1bd5d791639..25ac36cf0a2 100644

> --- a/gcc/testsuite/gcc.dg/pr51628-22.c

> +++ b/gcc/testsuite/gcc.dg/pr51628-22.c

> @@ -6,4 +6,4 @@ struct B { int i; };

>  struct C { struct B b; } __attribute__ ((packed));

>  

>  int* g4 (struct C *p) { return &p->b; }

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

> diff --git a/gcc/testsuite/gcc.dg/pr51628-24.c b/gcc/testsuite/gcc.dg/pr51628-24.c

> index 3ad99cd2f16..1e454a1dc0e 100644

> --- a/gcc/testsuite/gcc.dg/pr51628-24.c

> +++ b/gcc/testsuite/gcc.dg/pr51628-24.c

> @@ -7,4 +7,4 @@ struct A {

>  } __attribute__ ((packed));

>  

>  short* f2 (struct A *p) { return &p->i; }

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

> diff --git a/gcc/testsuite/gcc.dg/pr51628-25.c b/gcc/testsuite/gcc.dg/pr51628-25.c

> index 94a3a8fbaf2..f00d9b1bcac 100644

> --- a/gcc/testsuite/gcc.dg/pr51628-25.c

> +++ b/gcc/testsuite/gcc.dg/pr51628-25.c

> @@ -6,4 +6,4 @@ struct B { int i; };

>  struct C { struct B b; } __attribute__ ((packed));

>  

>  long* g8 (struct C *p) { return p; }

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

> diff --git a/gcc/testsuite/gcc.dg/pr51628-34.c b/gcc/testsuite/gcc.dg/pr51628-34.c

> index 51d4b26a114..0f6ae34fb96 100644

> --- a/gcc/testsuite/gcc.dg/pr51628-34.c

> +++ b/gcc/testsuite/gcc.dg/pr51628-34.c

> @@ -9,9 +9,9 @@ baz (int x, struct S *p)

>  {

>    return (x

>  	  ? &p->a 

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  	  : &p->b);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

>  

>  short *

> @@ -19,7 +19,7 @@ qux (int x, struct S *p)

>  {

>    return (short *) (x

>  		    ?  &p->a

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  		    : &p->b);

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

>  }

> diff --git a/gcc/testsuite/gcc.dg/pr88928.c b/gcc/testsuite/gcc.dg/pr88928.c

> index c0a1f766cb0..0b6c1d70f05 100644

> --- a/gcc/testsuite/gcc.dg/pr88928.c

> +++ b/gcc/testsuite/gcc.dg/pr88928.c

> @@ -3,4 +3,4 @@

>  struct a { } __attribute__((__packed__));

>  void c (struct a **);

>  void d (const struct a *b) { c ((struct a **) b); }

> -/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */

> +/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */

Patch

diff --git a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c
index afad603dfa2..95a376664da 100644
--- a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c
+++ b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-1.c
@@ -52,28 +52,28 @@  void foo (void)
   f0 = *&__real__ t0.f;        /* { dg-bogus "may result in an unaligned pointer value" } */
   f0 = *&__imag__ t0.f;        /* { dg-bogus "may result in an unaligned pointer value" } */
   i1 = (&t0.c, (int*) 0);      /* { dg-bogus "may result in an unaligned pointer value" } */
-  t2 = (struct t**) t10;     /* { dg-warning "may result in an unaligned pointer value" } */
-  t2 = (struct t**) t100;    /* { dg-warning "may result in an unaligned pointer value" } */
-  t2 = (struct t**) t1;      /* { dg-warning "may result in an unaligned pointer value" } */
-  t2 = (struct t**) bar();   /* { dg-warning "may result in an unaligned pointer value" } */
-  t2 = (struct t**) baz();   /* { dg-warning "may result in an unaligned pointer value" } */
-  t2 = (struct t**) bazz();  /* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = &t0.b;                /* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = &t1->b;               /* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = &t10[0].b;            /* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = t0.d;                 /* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = t1->d;                /* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = t10[0].d;             /* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = (int*) &t10[0].e[0];  /* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = (int*) t10[0].e;      /* { dg-warning "may result in an unaligned pointer value" } */
-  i2 = &t10[0].e[0];         /* { dg-warning "may result in an unaligned pointer value" } */
-  i2 = t10[0].e;             /* { dg-warning "may result in an unaligned pointer value" } */
-  i2 = &*&t0.c;              /* { dg-warning "may result in an unaligned pointer value" } */
-  i2 = &*&*&t0.c;            /* { dg-warning "may result in an unaligned pointer value" } */
-  f1 = &__real__ t0.f;       /* { dg-warning "may result in an unaligned pointer value" } */
-  f1 = &__imag__ t0.f;       /* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = (0, (int*) &t0.c);    /* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = (int*) (0, &t0.c);    /* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = (0, (int*)(0, &t0.c));/* { dg-warning "may result in an unaligned pointer value" } */
-  i1 = (int*)(0, 1, (void*)(2, 3, (int*)(4, 5, &t0.c)));/* { dg-warning "may result in an unaligned pointer value" } */
+  t2 = (struct t**) t10;     /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  t2 = (struct t**) t100;    /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  t2 = (struct t**) t1;      /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  t2 = (struct t**) bar();   /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  t2 = (struct t**) baz();   /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  t2 = (struct t**) bazz();  /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = &t0.b;                /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = &t1->b;               /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = &t10[0].b;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = t0.d;                 /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = t1->d;                /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = t10[0].d;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = (int*) &t10[0].e[0];  /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = (int*) t10[0].e;      /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i2 = &t10[0].e[0];         /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i2 = t10[0].e;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i2 = &*&t0.c;              /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i2 = &*&*&t0.c;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  f1 = &__real__ t0.f;       /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  f1 = &__imag__ t0.f;       /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = (0, (int*) &t0.c);    /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = (int*) (0, &t0.c);    /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = (0, (int*)(0, &t0.c));/* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i1 = (int*)(0, 1, (void*)(2, 3, (int*)(4, 5, &t0.c)));/* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
 }
diff --git a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c
index 65ec5140c9c..5dbcb89ffbc 100644
--- a/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c
+++ b/gcc/testsuite/c-c++-common/Waddress-of-packed-member-2.c
@@ -24,24 +24,24 @@  int *i0;
 
 void foo (void)
 {
-  i0 = s0.p.a;               /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = t0.p.a;               /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = s0.p.b[0];            /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = t0.p.b[0];            /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = &s0.p.a[0];           /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = &t0.p.a[0];           /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = &s0.p.b[0][0];        /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = &t0.p.b[0][0];        /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = *s0.p.b;              /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = *t0.p.b;              /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = &**s0.p.b;            /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = &**t0.p.b;            /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = **&s0.p.b;            /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = **&t0.p.b;            /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = &*s0.p.a;             /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = &*t0.p.a;             /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = *&s0.p.a;             /* { dg-warning "may result in an unaligned pointer value" } */
-  i0 = *&t0.p.a;             /* { dg-warning "may result in an unaligned pointer value" } */
+  i0 = s0.p.a;               /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = t0.p.a;               /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = s0.p.b[0];            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = t0.p.b[0];            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = &s0.p.a[0];           /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = &t0.p.a[0];           /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = &s0.p.b[0][0];        /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = &t0.p.b[0][0];        /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = *s0.p.b;              /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = *t0.p.b;              /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = &**s0.p.b;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = &**t0.p.b;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = **&s0.p.b;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = **&t0.p.b;            /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = &*s0.p.a;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = &*t0.p.a;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = *&s0.p.a;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
+  i0 = *&t0.p.a;             /* { dg-warning "may result in an unaligned pointer value" ""  { target { ! default_packed } } } */
   i0 = t0.u.a;                 /* { dg-bogus "may result in an unaligned pointer value" } */
   i0 = t0.u.b[0];              /* { dg-bogus "may result in an unaligned pointer value" } */
   i0 = &t0.u.a[0];             /* { dg-bogus "may result in an unaligned pointer value" } */
diff --git a/gcc/testsuite/c-c++-common/pr51628-13.c b/gcc/testsuite/c-c++-common/pr51628-13.c
index 0edd5e7f84d..b77e16c408f 100644
--- a/gcc/testsuite/c-c++-common/pr51628-13.c
+++ b/gcc/testsuite/c-c++-common/pr51628-13.c
@@ -6,4 +6,4 @@  struct B { int i; };
 struct C { struct B b; } __attribute__ ((packed));
 
 int* h4 (struct C *p) { return &p->b.i; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/c-c++-common/pr51628-15.c b/gcc/testsuite/c-c++-common/pr51628-15.c
index bcac6d70ad5..2ce3406481f 100644
--- a/gcc/testsuite/c-c++-common/pr51628-15.c
+++ b/gcc/testsuite/c-c++-common/pr51628-15.c
@@ -10,5 +10,5 @@  int*
 f (struct A *p, int *q)
 {
   return q ? q : &p->i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-16.c b/gcc/testsuite/c-c++-common/pr51628-16.c
index cd502fe76b8..b02cd8df1fc 100644
--- a/gcc/testsuite/c-c++-common/pr51628-16.c
+++ b/gcc/testsuite/c-c++-common/pr51628-16.c
@@ -8,6 +8,6 @@  struct B {
 } b;
 
 int *p = (int*)&b.a.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 int *q = (int*)&b.a;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/c-c++-common/pr51628-26.c b/gcc/testsuite/c-c++-common/pr51628-26.c
index 2042379860a..5ca381dba5d 100644
--- a/gcc/testsuite/c-c++-common/pr51628-26.c
+++ b/gcc/testsuite/c-c++-common/pr51628-26.c
@@ -15,19 +15,19 @@  void
 foo1 (void)
 {
   addr = (i = -1, &p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
 
 void
 foo2 (void)
 {
   addr = (i = -1, j = -2, &p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
 
 void
 foo3 (void)
 {
   addr = (i = -1, (j = -2, &p.i));
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-27.c b/gcc/testsuite/c-c++-common/pr51628-27.c
index 9ae1efd7afb..016a68f6549 100644
--- a/gcc/testsuite/c-c++-common/pr51628-27.c
+++ b/gcc/testsuite/c-c++-common/pr51628-27.c
@@ -9,4 +9,4 @@  struct C { struct B b; };
 extern struct C *p;
 
 int* g8 (void) { return &p->b.a.i; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/c-c++-common/pr51628-28.c b/gcc/testsuite/c-c++-common/pr51628-28.c
index 3cc1fec1f71..80d0c605670 100644
--- a/gcc/testsuite/c-c++-common/pr51628-28.c
+++ b/gcc/testsuite/c-c++-common/pr51628-28.c
@@ -11,9 +11,9 @@  foo3 (struct A *p1, int *q1, int *q2, struct A *p2)
 {
   return (q1 
 	  ? &p1->i
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 	  : (q2 ? &p2->i : q2));
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
 
 int*
@@ -21,11 +21,11 @@  foo4 (struct A *p1, int **q1, int *q2, int *q3, struct A *p2)
 {
   return (q1
 	  ? (*q1 = q2, &p1->i)
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 	  : (q2
 	     ? (*q1 = &p1->i,
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 		*q2 = 2, &p2->i)
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 	     : q2));
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-29.c b/gcc/testsuite/c-c++-common/pr51628-29.c
index 94b3722d2c8..a3e77455b6b 100644
--- a/gcc/testsuite/c-c++-common/pr51628-29.c
+++ b/gcc/testsuite/c-c++-common/pr51628-29.c
@@ -12,5 +12,5 @@  int*
 g8 (void)
 {
   return &p->b.a.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-3.c b/gcc/testsuite/c-c++-common/pr51628-3.c
index 0ea94c845a0..805ce7d0509 100644
--- a/gcc/testsuite/c-c++-common/pr51628-3.c
+++ b/gcc/testsuite/c-c++-common/pr51628-3.c
@@ -13,7 +13,7 @@  extern int *x;
 extern void bar (int *);
 
 int *addr = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 
 int *
 foo (void)
@@ -21,15 +21,15 @@  foo (void)
   struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };
   int *p0, *p1;
   p0 = &arr[0].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p0);
   p1 = &arr[1].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p1);
   bar (&p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   x = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   return &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-30.c b/gcc/testsuite/c-c++-common/pr51628-30.c
index 578edf4e8f9..b31e73ec036 100644
--- a/gcc/testsuite/c-c++-common/pr51628-30.c
+++ b/gcc/testsuite/c-c++-common/pr51628-30.c
@@ -12,12 +12,12 @@  int*
 foo1 (void)
 {
   return &__real(p->b.a.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
 
 int*
 foo2 (void)
 {
   return &__imag(p->b.a.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-31.c b/gcc/testsuite/c-c++-common/pr51628-31.c
index 9730f53f582..b2963581dcb 100644
--- a/gcc/testsuite/c-c++-common/pr51628-31.c
+++ b/gcc/testsuite/c-c++-common/pr51628-31.c
@@ -12,5 +12,5 @@  int *
 foo()
 {
   return &x.x[1];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-32.c b/gcc/testsuite/c-c++-common/pr51628-32.c
index a62e57d5b46..52f5e543ab7 100644
--- a/gcc/testsuite/c-c++-common/pr51628-32.c
+++ b/gcc/testsuite/c-c++-common/pr51628-32.c
@@ -16,4 +16,4 @@  struct B
 struct B b;
 
 int *p = &b.ar[1].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/c-c++-common/pr51628-33.c b/gcc/testsuite/c-c++-common/pr51628-33.c
index 0092f32202f..6b5e277b7c6 100644
--- a/gcc/testsuite/c-c++-common/pr51628-33.c
+++ b/gcc/testsuite/c-c++-common/pr51628-33.c
@@ -15,5 +15,5 @@  void
 foo (struct pair_t *p)
 {
   bar (p ? p->i : (int *) 0);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-35.c b/gcc/testsuite/c-c++-common/pr51628-35.c
index 20877792fd8..fa37d99beb7 100644
--- a/gcc/testsuite/c-c++-common/pr51628-35.c
+++ b/gcc/testsuite/c-c++-common/pr51628-35.c
@@ -12,12 +12,12 @@  long *
 foo1 (void)
 {
   return (long *) p;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
 
 long *
 foo2 (void)
 {
   return (long *) bar ();
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-4.c b/gcc/testsuite/c-c++-common/pr51628-4.c
index c4c1fb72d6d..ba88f5d0a39 100644
--- a/gcc/testsuite/c-c++-common/pr51628-4.c
+++ b/gcc/testsuite/c-c++-common/pr51628-4.c
@@ -13,7 +13,7 @@  extern int *x;
 extern void bar (int *);
 
 int *addr = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 
 int *
 foo (void)
@@ -21,15 +21,15 @@  foo (void)
   struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };
   int *p0, *p1;
   p0 = &arr[0].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p0);
   p1 = &arr[1].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p1);
   bar (&p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   x = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   return &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-5.c b/gcc/testsuite/c-c++-common/pr51628-5.c
index 9d7c309a0ef..86d01e9f3b3 100644
--- a/gcc/testsuite/c-c++-common/pr51628-5.c
+++ b/gcc/testsuite/c-c++-common/pr51628-5.c
@@ -13,7 +13,7 @@  extern int *x;
 extern void bar (int *);
 
 int *addr = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 
 int *
 foo (void)
@@ -21,15 +21,15 @@  foo (void)
   struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };
   int *p0, *p1;
   p0 = &arr[0].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p0);
   p1 = &arr[1].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p1);
   bar (&p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   x = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   return &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-6.c b/gcc/testsuite/c-c++-common/pr51628-6.c
index 52aa07a4cf3..e7be7fbffc5 100644
--- a/gcc/testsuite/c-c++-common/pr51628-6.c
+++ b/gcc/testsuite/c-c++-common/pr51628-6.c
@@ -13,7 +13,7 @@  extern int *x;
 extern void bar (int *);
 
 int *addr = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 
 int *
 foo (void)
@@ -21,15 +21,15 @@  foo (void)
   struct pair_t arr[2] = { { 1, 10 }, { 2, 20 } };
   int *p0, *p1;
   p0 = &arr[0].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p0);
   p1 = &arr[1].i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p1);
   bar (&p.i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   x = &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   return &p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-8.c b/gcc/testsuite/c-c++-common/pr51628-8.c
index cc2dae096ae..dd4f1904c11 100644
--- a/gcc/testsuite/c-c++-common/pr51628-8.c
+++ b/gcc/testsuite/c-c++-common/pr51628-8.c
@@ -13,24 +13,24 @@  extern int *x;
 extern void bar (int *);
 
 int *addr = p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 
 int *
 foo (struct pair_t *p)
 {
   int *p0, *p1;
   p0 = p->i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p0);
   p1 = &p->i[1];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p1);
   bar (p->i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (&p->i[2]);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   x = p->i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   return &p->i[3];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr51628-9.c b/gcc/testsuite/c-c++-common/pr51628-9.c
index 0470aa3b93d..aa3d5292d43 100644
--- a/gcc/testsuite/c-c++-common/pr51628-9.c
+++ b/gcc/testsuite/c-c++-common/pr51628-9.c
@@ -13,24 +13,24 @@  extern int *x;
 extern void bar (int *);
 
 int *addr = p.i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 
 int *
 foo (struct pair_t *p)
 {
   int *p0, *p1;
   p0 = p->i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p0);
   p1 = &p->i[1];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (p1);
   bar (p->i);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   bar (&p->i[2]);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   x = p->i;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   return &p->i[3];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/c-c++-common/pr88664-2.c b/gcc/testsuite/c-c++-common/pr88664-2.c
index d2d880a66d7..9a81b751802 100644
--- a/gcc/testsuite/c-c++-common/pr88664-2.c
+++ b/gcc/testsuite/c-c++-common/pr88664-2.c
@@ -11,12 +11,12 @@  void **
 fun1 (struct data *p)
 {
   return &p->ptr;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
 
 int *
 fun2 (struct data *p, int *x)
 {
   return p ? (*x = 1, (int *) &p->ptr) : (int *) 0;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/gcc.dg/pr51628-17.c b/gcc/testsuite/gcc.dg/pr51628-17.c
index 0be95b2294e..42dc9d745dc 100644
--- a/gcc/testsuite/gcc.dg/pr51628-17.c
+++ b/gcc/testsuite/gcc.dg/pr51628-17.c
@@ -7,4 +7,4 @@  struct A {
 } __attribute__ ((packed));
 
 long* f8 (struct A *p) { return &p->i; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-19.c b/gcc/testsuite/gcc.dg/pr51628-19.c
index 7ff03e85cea..91ff39abc88 100644
--- a/gcc/testsuite/gcc.dg/pr51628-19.c
+++ b/gcc/testsuite/gcc.dg/pr51628-19.c
@@ -16,11 +16,11 @@  bar (int n, int k, void *ptr)
 
   int *p0, *p1;
   p0 = p->x;
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   foo (p0);
   p1 = &p->x[1];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
   foo (p1);
   return &p->x[1];
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/gcc.dg/pr51628-20.c b/gcc/testsuite/gcc.dg/pr51628-20.c
index bcdbff1e554..2249d85098b 100644
--- a/gcc/testsuite/gcc.dg/pr51628-20.c
+++ b/gcc/testsuite/gcc.dg/pr51628-20.c
@@ -8,4 +8,4 @@  struct C { struct B b; } __attribute__ ((packed));
 extern struct C *p;
 
 long* g8 (void) { return p; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-21.c b/gcc/testsuite/gcc.dg/pr51628-21.c
index 0c7fab75d8a..f1adbe64002 100644
--- a/gcc/testsuite/gcc.dg/pr51628-21.c
+++ b/gcc/testsuite/gcc.dg/pr51628-21.c
@@ -8,4 +8,4 @@  struct C { struct B b; } __attribute__ ((packed));
 extern struct C p[];
 
 long* g8 (void) { return p; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-22.c b/gcc/testsuite/gcc.dg/pr51628-22.c
index 1bd5d791639..25ac36cf0a2 100644
--- a/gcc/testsuite/gcc.dg/pr51628-22.c
+++ b/gcc/testsuite/gcc.dg/pr51628-22.c
@@ -6,4 +6,4 @@  struct B { int i; };
 struct C { struct B b; } __attribute__ ((packed));
 
 int* g4 (struct C *p) { return &p->b; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-24.c b/gcc/testsuite/gcc.dg/pr51628-24.c
index 3ad99cd2f16..1e454a1dc0e 100644
--- a/gcc/testsuite/gcc.dg/pr51628-24.c
+++ b/gcc/testsuite/gcc.dg/pr51628-24.c
@@ -7,4 +7,4 @@  struct A {
 } __attribute__ ((packed));
 
 short* f2 (struct A *p) { return &p->i; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-25.c b/gcc/testsuite/gcc.dg/pr51628-25.c
index 94a3a8fbaf2..f00d9b1bcac 100644
--- a/gcc/testsuite/gcc.dg/pr51628-25.c
+++ b/gcc/testsuite/gcc.dg/pr51628-25.c
@@ -6,4 +6,4 @@  struct B { int i; };
 struct C { struct B b; } __attribute__ ((packed));
 
 long* g8 (struct C *p) { return p; }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/pr51628-34.c b/gcc/testsuite/gcc.dg/pr51628-34.c
index 51d4b26a114..0f6ae34fb96 100644
--- a/gcc/testsuite/gcc.dg/pr51628-34.c
+++ b/gcc/testsuite/gcc.dg/pr51628-34.c
@@ -9,9 +9,9 @@  baz (int x, struct S *p)
 {
   return (x
 	  ? &p->a 
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 	  : &p->b);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
 
 short *
@@ -19,7 +19,7 @@  qux (int x, struct S *p)
 {
   return (short *) (x
 		    ?  &p->a
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 		    : &p->b);
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */
 }
diff --git a/gcc/testsuite/gcc.dg/pr88928.c b/gcc/testsuite/gcc.dg/pr88928.c
index c0a1f766cb0..0b6c1d70f05 100644
--- a/gcc/testsuite/gcc.dg/pr88928.c
+++ b/gcc/testsuite/gcc.dg/pr88928.c
@@ -3,4 +3,4 @@ 
 struct a { } __attribute__((__packed__));
 void c (struct a **);
 void d (const struct a *b) { c ((struct a **) b); }
-/* { dg-warning "may result in an unaligned pointer value" "" { target *-*-* } .-1 } */
+/* { dg-warning "may result in an unaligned pointer value" "" { target { ! default_packed } } .-1 } */