diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2002-11-20 10:09:01 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2002-11-20 10:09:01 +0000 |
commit | 5354730bf62ca4d1418885813585e2cf63a2b842 (patch) | |
tree | cd16a376047d475d63ad5b51c27c7e810919de7d /gcc | |
parent | 5720520fc703f006b311bdbd07bc503028c1dbbb (diff) | |
download | gcc-5354730bf62ca4d1418885813585e2cf63a2b842.zip gcc-5354730bf62ca4d1418885813585e2cf63a2b842.tar.gz gcc-5354730bf62ca4d1418885813585e2cf63a2b842.tar.bz2 |
stor-layout.c (place_field): Update rli->offset as well as rli->bitpos.
* stor-layout.c (place_field): Update rli->offset as well as
rli->bitpos.
From-SVN: r59301
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/stor-layout.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/bitfld-5.c | 12 |
4 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5961678..b644383 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2002-11-20 Richard Sandiford <rsandifo@redhat.com> + * stor-layout.c (place_field): Update rli->offset as well as + rli->bitpos. + +2002-11-20 Richard Sandiford <rsandifo@redhat.com> + * sched-deps.c (sched_analyze): Check HARD_REGNO_CALL_PART_CLOBBERED. 2002-11-20 Richard Sandiford <rsandifo@redhat.com> diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index dd37d95..db4c09f 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -1036,6 +1036,7 @@ place_field (rli, field) if (rli->remaining_in_alignment < bitsize) { /* out of bits; bump up to next 'word'. */ + rli->offset = DECL_FIELD_OFFSET (rli->prev_field); rli->bitpos = size_binop (PLUS_EXPR, type_size, DECL_FIELD_BIT_OFFSET(rli->prev_field)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aef7826..b5355d7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2002-11-20 Richard Sandiford <rsandifo@redhat.com> + * gcc.dg/bitfld-5.c: New test. + +2002-11-20 Richard Sandiford <rsandifo@redhat.com> + * gcc.c-torture/execute/20021120-3.c: New test. 2002-11-20 Richard Sandiford <rsandifo@redhat.com> diff --git a/gcc/testsuite/gcc.dg/bitfld-5.c b/gcc/testsuite/gcc.dg/bitfld-5.c new file mode 100644 index 0000000..835bbce --- /dev/null +++ b/gcc/testsuite/gcc.dg/bitfld-5.c @@ -0,0 +1,12 @@ +/* { dg-options "" } */ +#include <limits.h> + +struct s +{ + int i1 : sizeof (int) * CHAR_BIT; + int i2 : sizeof (int) * CHAR_BIT; + int i3 : sizeof (int) * CHAR_BIT; + int i4 : sizeof (int) * CHAR_BIT; +}; + +int f[sizeof (struct s) != sizeof (int) * 4 ? -1 : 1]; |