/* PR c/33238 */
|
/* PR c/33238 */
|
|
|
typedef __SIZE_TYPE__ size_t;
|
typedef __SIZE_TYPE__ size_t;
|
int memcmp (const void *, const void *, size_t);
|
int memcmp (const void *, const void *, size_t);
|
void abort (void);
|
void abort (void);
|
|
|
void
|
void
|
__attribute__((noinline))
|
__attribute__((noinline))
|
bar (void *x, void *y)
|
bar (void *x, void *y)
|
{
|
{
|
struct S { char w[8]; } *p = x, *q = y;
|
struct S { char w[8]; } *p = x, *q = y;
|
if (memcmp (p->w, "zyxwvut", 8) != 0)
|
if (memcmp (p->w, "zyxwvut", 8) != 0)
|
abort ();
|
abort ();
|
if (memcmp (q[0].w, "abcdefg", 8) != 0)
|
if (memcmp (q[0].w, "abcdefg", 8) != 0)
|
abort ();
|
abort ();
|
if (memcmp (q[1].w, "ABCDEFG", 8) != 0)
|
if (memcmp (q[1].w, "ABCDEFG", 8) != 0)
|
abort ();
|
abort ();
|
if (memcmp (q[2].w, "zyxwvut", 8) != 0)
|
if (memcmp (q[2].w, "zyxwvut", 8) != 0)
|
abort ();
|
abort ();
|
if (memcmp (q[3].w, "zyxwvut", 8) != 0)
|
if (memcmp (q[3].w, "zyxwvut", 8) != 0)
|
abort ();
|
abort ();
|
}
|
}
|
|
|
void
|
void
|
__attribute__((noinline))
|
__attribute__((noinline))
|
foo (void *x, int y)
|
foo (void *x, int y)
|
{
|
{
|
struct S { char w[y]; } *p = x, a;
|
struct S { char w[y]; } *p = x, a;
|
int i;
|
int i;
|
a = ({ struct S b; b = p[2]; p[3] = b; });
|
a = ({ struct S b; b = p[2]; p[3] = b; });
|
bar (&a, x);
|
bar (&a, x);
|
}
|
}
|
|
|
int
|
int
|
main (void)
|
main (void)
|
{
|
{
|
struct S { char w[8]; } p[4]
|
struct S { char w[8]; } p[4]
|
= { "abcdefg", "ABCDEFG", "zyxwvut", "ZYXWVUT" };
|
= { "abcdefg", "ABCDEFG", "zyxwvut", "ZYXWVUT" };
|
foo (p, 8);
|
foo (p, 8);
|
return 0;
|
return 0;
|
}
|
}
|
|
|