------- Comment #3 from rguenth at gcc dot gnu dot org 2008-02-04 17:12 ------- Really reduced testcase, the key is that pthread_mutex_t is a union:
typedef union
{
int __lock;
} pthread_mutex_t;
extern void abort (void);
int main(int c, char **v)
{
struct { int c; pthread_mutex_t m; } r = { .m = 0 };
if (r.c != 0)
abort ();
return 0;
}
in practice the testcase doesn't abort because the stack is zeroed anyway.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33631
