mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-15 17:00:25 +08:00
stor-layout.c (bit_field_mode_iterator::bit_field_mode_iterator): Deal with degenerate cases where the bitsize isn't positive.
* stor-layout.c (bit_field_mode_iterator::bit_field_mode_iterator): Deal with degenerate cases where the bitsize isn't positive. Rework comment. From-SVN: r194009
This commit is contained in:
parent
d5651dcfe8
commit
a37d67b621
@ -1,3 +1,8 @@
|
||||
2012-11-30 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* stor-layout.c (bit_field_mode_iterator::bit_field_mode_iterator): Deal
|
||||
with degenerate cases where the bitsize isn't positive. Rework comment.
|
||||
|
||||
2012-11-30 David Edelsohn <dje.gcc@gmail.com>
|
||||
|
||||
* xcoffout.c (xcoff_tls_data_section_name): Define.
|
||||
|
@ -2648,10 +2648,14 @@ bit_field_mode_iterator
|
||||
{
|
||||
if (!bitregion_end_)
|
||||
{
|
||||
/* We can assume that any aligned chunk of UNITS bits that overlaps
|
||||
the bitfield is mapped and won't trap. */
|
||||
unsigned HOST_WIDE_INT units = MIN (align, MAX (BIGGEST_ALIGNMENT,
|
||||
BITS_PER_WORD));
|
||||
/* We can assume that any aligned chunk of ALIGN bits that overlaps
|
||||
the bitfield is mapped and won't trap, provided that ALIGN isn't
|
||||
too large. The cap is the biggest required alignment for data,
|
||||
or at least the word size. And force one such chunk at least. */
|
||||
unsigned HOST_WIDE_INT units
|
||||
= MIN (align, MAX (BIGGEST_ALIGNMENT, BITS_PER_WORD));
|
||||
if (bitsize <= 0)
|
||||
bitsize = 1;
|
||||
bitregion_end_ = bitpos + bitsize + units - 1;
|
||||
bitregion_end_ -= bitregion_end_ % units + 1;
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
2012-11-30 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gnat.dg/specs/pack9.ads: New test.
|
||||
|
||||
2012-11-30 Martin Jambor <mjambor@suse.cz>
|
||||
|
||||
PR middle-end/52890
|
||||
|
15
gcc/testsuite/gnat.dg/specs/pack9.ads
Normal file
15
gcc/testsuite/gnat.dg/specs/pack9.ads
Normal file
@ -0,0 +1,15 @@
|
||||
-- { dg-do compile }
|
||||
|
||||
package Pack9 is
|
||||
|
||||
subtype Zero is Natural range 0 .. 0;
|
||||
|
||||
type Rec (D : Boolean) is record
|
||||
case D is
|
||||
when True => Z : Zero;
|
||||
when False => null;
|
||||
end case;
|
||||
end record;
|
||||
pragma Pack (Rec);
|
||||
|
||||
end Pack9;
|
Loading…
Reference in New Issue
Block a user