diff options
| author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-10-25 15:23:35 +0000 |
|---|---|---|
| committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-10-25 15:23:35 +0000 |
| commit | 0887bad70bc7a33848ba2fde1fe70aeaab648f7e (patch) | |
| tree | 0a345c9b3a03c725f874056b490d13d0a38deea0 | |
| parent | 8baf0ad48cd883786145460912f7c59e562e1278 (diff) | |
| download | ppe42-gcc-0887bad70bc7a33848ba2fde1fe70aeaab648f7e.tar.gz ppe42-gcc-0887bad70bc7a33848ba2fde1fe70aeaab648f7e.zip | |
* stor-layout.c (layout_type): If TYPE_ALIAS_SET was already set on the
incomplete type force it into alias set 0.
* gcc.c-torture/execute/20001024-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37052 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/stor-layout.c | 8 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20001024-1.c | 34 |
4 files changed, 51 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e9e2a1c9144..79a9fc2d555 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-10-25 Jakub Jelinek <jakub@redhat.com> + + * stor-layout.c (layout_type): If TYPE_ALIAS_SET was already set on the + incomplete type force it into alias set 0. + Wed Oct 25 01:02:44 EDT 2000 John Wehle (john@feith.com) * alias.c: Include basic-block.h. diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 797b4cea17d..8d41cd18221 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1504,6 +1504,14 @@ layout_type (type) record it so set_sizetype can fix it up. */ if (! sizetype_set) early_type_list = tree_cons (NULL_TREE, type, early_type_list); + + /* If an alias set has been set for this aggregate when it was incomplete, + force it into alias set 0. + This is too conservative, but we cannot call record_component_aliases + here because some frontends still change the aggregates after + layout_type. */ + if (AGGREGATE_TYPE_P (type) && TYPE_ALIAS_SET_KNOWN_P (type)) + TYPE_ALIAS_SET (type) = 0; } /* Create and return a type for signed integers of PRECISION bits. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ac355b2d191..f61fb4eac02 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2000-10-25 Jakub Jelinek <jakub@redhat.com> + + * gcc.c-torture/execute/20001024-1.c: New test. + 2000-10-24 Jakub Jelinek <jakub@redhat.com> * g++.old-deja/g++.other/sibcall1.C: New test. diff --git a/gcc/testsuite/gcc.c-torture/execute/20001024-1.c b/gcc/testsuite/gcc.c-torture/execute/20001024-1.c new file mode 100644 index 00000000000..42be8abca6a --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/20001024-1.c @@ -0,0 +1,34 @@ +struct a; + +extern int baz (struct a *__restrict x); + +struct a { + long v; + long w; +}; + +struct b { + struct a c; + struct a d; +}; + +int bar (int x, const struct b *__restrict y, struct b *__restrict z) +{ + if (y->c.v || y->c.w != 250000 || y->d.v || y->d.w != 250000) + abort(); +} + +void foo(void) +{ + struct b x; + x.c.v = 0; + x.c.w = 250000; + x.d = x.c; + bar(0, &x, ((void *)0)); +} + +int main() +{ + foo(); + exit(0); +} |

