rx.c (rx_is_ms_bitfield_layout): Return false if the record is packed.

* config/rx/rx.c (rx_is_ms_bitfield_layout): Return false if the
	record is packed.

	* gcc.target/rx/pack.c: New test.

From-SVN: r166793
This commit is contained in:
Nick Clifton 2010-11-16 09:40:02 +00:00
parent 180ed1b2bd
commit 27128fc317
4 changed files with 48 additions and 13 deletions

View File

@ -1,3 +1,8 @@
2010-11-16 Nick Clifton <nickc@redhat.com>
* config/rx/rx.c (rx_is_ms_bitfield_layout): Return false if the
record is packed.
2010-11-15 Richard Henderson <rth@redhat.com>
* fold-const.c (operand_equal_for_comparison_p): Handle FMA_EXPR,

View File

@ -2306,7 +2306,8 @@ rx_file_start (void)
static bool
rx_is_ms_bitfield_layout (const_tree record_type ATTRIBUTE_UNUSED)
{
return TRUE;
/* The packed attribute overrides the MS behaviour. */
return ! TYPE_PACKED (record_type);
}
/* Try to generate code for the "isnv" pattern which inserts bits

View File

@ -1,3 +1,7 @@
2010-11-16 Nick Clifton <nickc@redhat.com>
* gcc.target/rx/pack.c: New test.
2010-11-15 Richard Henderson <rth@redhat.com>
* gcc.dg/torture/builtin-math-2.c: Split out fma tests...

View File

@ -0,0 +1,25 @@
/* { dg-do run } */
typedef unsigned short INT16U;
typedef struct tst_2
{
INT16U f0; // [+0]
INT16U * f1; // [+2]
INT16U f2; // [+6]
INT16U * f3; // [+8]
} __attribute__ ((__packed__)) t2;
#include <stddef.h>
#include <stdlib.h>
int main (void)
{
if (offsetof (t2, f1) != 2)
abort ();
if (offsetof (t2, f2) != 6)
abort ();
if (offsetof (t2, f3) != 8)
abort ();
exit (0);
}