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...
@ -90,16 +94,16 @@
* objc.dg/property/at-property-21.m: New.
* objc.dg/property/at-property-22.m: New.
* objc.dg/property/at-property-23.m: New.
* objc.dg/property/at-property-23.m: New.
* objc.dg/property/synthesize-9.m: New.
* objc.dg/property/synthesize-10.m: New.
* objc.dg/property/synthesize-11.m: New.
* objc.dg/property/synthesize-11.m: New.
* obj-c++.dg/property/at-property-21.mm: New.
* obj-c++.dg/property/at-property-22.mm: New.
* obj-c++.dg/property/at-property-23.mm: New.
* obj-c++.dg/property/at-property-23.mm: New.
* obj-c++.dg/property/synthesize-9.mm: New.
* obj-c++.dg/property/synthesize-10.mm: New.
* obj-c++.dg/property/synthesize-11.mm: New.
* obj-c++.dg/property/synthesize-11.mm: New.
* objc.dg/property/at-property-4.m: Updated to match new compiler
where some errors have been converted into warnings and vice versa.
@ -110,14 +114,14 @@
* obj-c++.dg/property/at-property-16.mm: Same change.
* obj-c++.dg/property/at-property-18.mm: Same change.
* obj-c++.dg/property/property-neg-5.mm: Same change.
* obj-c++.dg/property/dynamic-2.mm: Enable tests that were
commented out because of testsuite problems; I found out that
using dg-warning instead of dg-message gets them to work.
* obj-c++.dg/property/property-neg-3.mm: Same change.
* obj-c++.dg/property/synthesize-6.mm: Same change.
* obj-c++.dg/property/at-property-5.mm: Same change.
* obj-c++.dg/property/at-property-14.mm: Same change.
* obj-c++.dg/property/at-property-5.mm: Same change.
* obj-c++.dg/property/at-property-14.mm: Same change.
* obj-c++.dg/property/at-property-18.mm: Same change.
* obj-c++.dg/property/at-property-16.mm: Same change (in this file,
some tests still do not work due to some other testsuite issue).
@ -152,8 +156,8 @@
Test various valid uses of typedef with Objective-C objects and
protocols instead.
* objc.dg/invalid-type-1.m: New.
* obj-c++.dg/invalid-type-1.m: New.
* obj-c++.dg/invalid-type-1.m: New.
2010-11-13 Iain Sandoe <iains@gcc.gnu.org>
* gcc.dg/darwin-segaddr.c: New test for multiple argument c/l switch.
@ -263,7 +267,7 @@
Tobias Burnus <burnus@net-b.de>
PR fortran/46325
* gfortran.dg/char_initialiser_actual.f90: Make test case valid.
* gfortran.dg/char_initialiser_actual.f90: Make test case valid.
2010-11-11 Jan Hubicka <jh@suse.cz>
@ -328,10 +332,10 @@
2010-11-11 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/property/at-property-20.m: New.
* objc.dg/property/synthesize-8.m: New.
* objc.dg/property/synthesize-8.m: New.
* obj-c++.dg/property/at-property-20.m: New.
* obj-c++.dg/property/synthesize-8.mm: New.
2010-11-11 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/cpp/warn-normalized-3.c: Update expected note text.

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);
}