diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-08 08:20:45 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-08 08:20:45 +0000 |
commit | 5949e0492163d97190c344b08a435b01c9a2ae34 (patch) | |
tree | e0980eeaca11a9f476d545834ecfe14de6369efe /gcc/tree-ssa-structalias.c | |
parent | 07018da0131fb14947fa2f76060d46aaf6779bb0 (diff) | |
download | gcc-5949e0492163d97190c344b08a435b01c9a2ae34.tar.gz |
2008-05-08 Richard Guenther <rguenther@suse.de>
PR middle-end/36154
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Make
sure to create a representative for trailing arrays for PTA.
* gcc.c-torture/compile/pr36154.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135071 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index ddcf4982690..d58478ebeb2 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -4160,11 +4160,15 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack, (DECL_NONADDRESSABLE_P (field) ? addressable_type : TREE_TYPE (field)))) - && DECL_SIZE (field) - && !integer_zerop (DECL_SIZE (field))) - /* Empty structures may have actual size, like in C++. So + && ((DECL_SIZE (field) + && !integer_zerop (DECL_SIZE (field))) + || (!DECL_SIZE (field) + && TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE))) + /* Empty structures may have actual size, like in C++. So see if we didn't push any subfields and the size is - nonzero, push the field onto the stack */ + nonzero, push the field onto the stack. Trailing flexible + array members also need a representative to be able to + treat taking their address in PTA. */ push = true; if (push) |