8sa1-gcc/gcc/testsuite/gcc.c-torture/execute/zero-struct-1.c
Andrew Pinski 412f898605 re PR middle-end/23463 (va-arg-22.c execution fails)
2005-08-27  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/23463
        * gimplify.c (gimplify_modify_expr_rhs): Remove check for zero sized
        types.
        (gimplify_modify_expr): Check for zero sized types and gimplify the
        rhs and lhs as statements.

2005-08-27  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/23463
        * gcc.c-torture/execute/zero-struct-1.c: New test.

From-SVN: r103571
2005-08-27 14:37:53 -07:00

24 lines
323 B
C

struct g{};
char y[3];
char *f = &y[0];
char *ff = &y[0];
void h(void)
{
struct g t;
*((struct g*)(f++)) = *((struct g*)(ff++));
*((struct g*)(f++)) = (struct g){};
t = *((struct g*)(ff++));
}
void abort (void);
int main(void)
{
h();
if (f != &y[2])
abort();
if (ff != &y[2])
abort();
return 0;
}