diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-28 11:52:49 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-28 11:52:49 +0000 |
commit | 9184bcae75f69ce9eb976bc5e028dc1d08d880f9 (patch) | |
tree | a418287553fdeb0344b3f722fb2b109aaed39b71 /gcc/testsuite/gcc.dg | |
parent | db6c28b33b873c8c925e08fe3ee1db01e09eebf2 (diff) | |
download | gcc-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.c | 17 |
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); +} |