summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-01 17:19:02 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-01-01 17:19:02 +0000
commitf54ef8b6bdcb2db0a3bc5c76b028df7a75fe524d (patch)
treee806db336512e949dfdcaf872571f7f2ca326623 /gcc/c-decl.c
parent50d268b3da4fb203f91986723804b0a7a24903e5 (diff)
downloadgcc-f54ef8b6bdcb2db0a3bc5c76b028df7a75fe524d.tar.gz
2010-01-01 Richard Guenther <rguenther@suse.de>
PR c/42570 * c-decl.c (grokdeclarator): For zero-size arrays force structural equality checks as layout_type does. * gcc.c-torture/execute/pr42570.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155557 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 0655197f5bc..a244a83e787 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -1,6 +1,6 @@
/* Process declarations and variables for C compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GCC.
@@ -5394,6 +5394,7 @@ grokdeclarator (const struct c_declarator *declarator,
gcc_assert (itype);
TYPE_SIZE (type) = bitsize_zero_node;
TYPE_SIZE_UNIT (type) = size_zero_node;
+ SET_TYPE_STRUCTURAL_EQUALITY (type);
}
if (array_parm_vla_unspec_p)
{
@@ -5401,6 +5402,7 @@ grokdeclarator (const struct c_declarator *declarator,
/* The type is complete. C99 6.7.5.2p4 */
TYPE_SIZE (type) = bitsize_zero_node;
TYPE_SIZE_UNIT (type) = size_zero_node;
+ SET_TYPE_STRUCTURAL_EQUALITY (type);
}
}