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
24 lines
323 B
C
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;
|
|
}
|