summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-28 11:52:49 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-28 11:52:49 +0000
commit9184bcae75f69ce9eb976bc5e028dc1d08d880f9 (patch)
treea418287553fdeb0344b3f722fb2b109aaed39b71 /gcc/testsuite/gcc.dg
parentdb6c28b33b873c8c925e08fe3ee1db01e09eebf2 (diff)
downloadgcc-9184bcae75f69ce9eb976bc5e028dc1d08d880f9.tar.gz
2012-06-28 Richard Guenther <rguenther@suse.de>
PR middle-end/53790 * expr.c (expand_expr_real_1): Verify if the type is complete before inspecting its size. * gcc.dg/torture/pr53790.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@189047 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr53790.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr53790.c b/gcc/testsuite/gcc.dg/torture/pr53790.c
new file mode 100644
index 00000000000..0abd3dd83c1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr53790.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+
+typedef struct s {
+ int value;
+} s_t;
+
+static inline int
+read(s_t const *var)
+{
+ return var->value;
+}
+
+int main()
+{
+ extern union u extern_var;
+ return read((s_t *)&extern_var);
+}