Commit dfd48d76 by Neil Booth Committed by Neil Booth

c-decl.c, [...]: Revert bitfield patch.

	* c-decl.c, tree.c, tree.h, objc/objc-act.c: Revert bitfield
	patch.
	* gcc.dg/bitfld-1.c: Update.
	* gcc.dg/bitfld-2.c: Update.
	* gcc.c-torture/execute/bitfld-1.x: New.

From-SVN: r49420
parent 4a23409e
2002-02-02 Neil Booth <neil@daikokuya.demon.co.uk>
* c-decl.c, tree.c, tree.h, objc/objc-act.c: Revert bitfield
patch.
2002-02-02 Jakub Jelinek <jakub@redhat.com> 2002-02-02 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.h (CPP_CPUCOMMON_SPEC): Add missing | separators. * config/i386/i386.h (CPP_CPUCOMMON_SPEC): Add missing | separators.
......
...@@ -2393,6 +2393,13 @@ objc_copy_list (list, head) ...@@ -2393,6 +2393,13 @@ objc_copy_list (list, head)
while (list) while (list)
{ {
tail = copy_node (list); tail = copy_node (list);
/* The following statement fixes a bug when inheriting instance
variables that are declared to be bitfields. finish_struct
expects to find the width of the bitfield in DECL_INITIAL. */
if (DECL_BIT_FIELD (tail) && DECL_INITIAL (tail) == 0)
DECL_INITIAL (tail) = DECL_SIZE (tail);
newlist = chainon (newlist, tail); newlist = chainon (newlist, tail);
list = TREE_CHAIN (list); list = TREE_CHAIN (list);
} }
......
2002-02-02 Neil Booth <neil@daikokuya.demon.co.uk>
* gcc.dg/bitfld-1.c: Update.
* gcc.dg/bitfld-2.c: Update.
* gcc.c-torture/execute/bitfld-1.x: New.
2002-02-02 Jakub Jelinek <jakub@redhat.com> 2002-02-02 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/execute/20020201-1.c: New test. * gcc.c-torture/execute/20020201-1.c: New test.
......
set torture_execute_xfail "*-*-*"
return 0
...@@ -22,7 +22,7 @@ struct bf1 ...@@ -22,7 +22,7 @@ struct bf1
unsigned int : 5; unsigned int : 5;
double e: 1; /* { dg-error "invalid type" } */ double e: 1; /* { dg-error "invalid type" } */
float f: 1; /* { dg-error "invalid type" } */ float f: 1; /* { dg-error "invalid type" } */
unsigned long g: 5; /* { dg-warning "GCC extension" } */ unsigned long g: 5; /* { dg-warning "GCC extension|ISO C" } */
ui h: 5; ui h: 5;
enum foo i: 2; /* { dg-error "narrower" } */ enum foo i: 2; /* { dg-error "narrower" } */
enum foo j: 3; enum foo j: 3;
......
...@@ -11,13 +11,13 @@ struct bf ...@@ -11,13 +11,13 @@ struct bf
int b: 2; int b: 2;
}; };
struct bf p = {4, 0}; /* { dg-warning "truncated" } */ struct bf p = {4, 0}; /* { dg-warning "truncated" "" { xfail *-*-* } } */
struct bf q = {0, 2}; /* { dg-warning "overflow" } */ struct bf q = {0, 2}; /* { dg-warning "overflow" "" { xfail *-*-* } } */
struct bf r = {3, -2}; /* { dg-bogus "(truncated|overflow)" } */ struct bf r = {3, -2}; /* { dg-bogus "(truncated|overflow)" } */
void foo () void foo ()
{ {
p.a = 4, p.b = 0; /* { dg-warning "truncated" } */ p.a = 4, p.b = 0; /* { dg-warning "truncated" "" { xfail *-*-* } } */
q.a = 0, q.b = 2; /* { dg-warning "overflow" } */ q.a = 0, q.b = 2; /* { dg-warning "overflow" "" { xfail *-*-* } } */
r.a = 3, r.b = -2; /* { dg-bogus "(truncated|overflow)" } */ r.a = 3, r.b = -2; /* { dg-bogus "(truncated|overflow)" } */
} }
...@@ -3758,29 +3758,6 @@ build_index_type (maxval) ...@@ -3758,29 +3758,6 @@ build_index_type (maxval)
return itype; return itype;
} }
/* Builds a signed or unsigned integer type of precision PRECISION.
Used for C bitfields whose precision does not match that of
built-in target types. */
tree
build_nonstandard_integer_type (precision, unsignedp)
unsigned int precision;
int unsignedp;
{
tree itype = make_node (INTEGER_TYPE);
TYPE_PRECISION (itype) = precision;
if (unsignedp)
fixup_unsigned_type (itype);
else
fixup_signed_type (itype);
if (host_integerp (TYPE_MAX_VALUE (itype), 1))
return type_hash_canon (tree_low_cst (TYPE_MAX_VALUE (itype), 1), itype);
return itype;
}
/* Create a range of some discrete type TYPE (an INTEGER_TYPE, /* Create a range of some discrete type TYPE (an INTEGER_TYPE,
ENUMERAL_TYPE, BOOLEAN_TYPE, or CHAR_TYPE), with ENUMERAL_TYPE, BOOLEAN_TYPE, or CHAR_TYPE), with
low bound LOWVAL and high bound HIGHVAL. low bound LOWVAL and high bound HIGHVAL.
......
...@@ -2862,7 +2862,6 @@ extern tree getdecls PARAMS ((void)); ...@@ -2862,7 +2862,6 @@ extern tree getdecls PARAMS ((void));
/* Function to return the chain of structure tags in the current scope level. */ /* Function to return the chain of structure tags in the current scope level. */
extern tree gettags PARAMS ((void)); extern tree gettags PARAMS ((void));
extern tree build_nonstandard_integer_type PARAMS ((unsigned int, int));
extern tree build_range_type PARAMS ((tree, tree, tree)); extern tree build_range_type PARAMS ((tree, tree, tree));
/* In alias.c */ /* In alias.c */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment