varasm.c (struct constant_descriptor): Put CONTENTS inside a union to make it well-aligned.

* varasm.c (struct constant_descriptor): Put CONTENTS inside a
union to make it well-aligned.  Update all uses.

From-SVN: r37422
This commit is contained in:
Richard Earnshaw 2000-11-13 13:35:26 +00:00 committed by Richard Earnshaw
parent 26d4fec72e
commit 373577962c
2 changed files with 20 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2000-11-13 Richard Earnshaw <rearnsha@arm.com>
* varasm.c (struct constant_descriptor): Put CONTENTS inside a
union to make it well-aligned. Update all uses.
2000-11-13 Joseph S. Myers <jsm28@cam.ac.uk>
* c-parse.in (initelt): Give appropriate pedantic warnings,

View File

@ -2327,7 +2327,16 @@ struct constant_descriptor
struct constant_descriptor *next;
char *label;
rtx rtl;
unsigned char contents[1];
/* Make sure the data is reasonably aligned. */
union
{
unsigned char contents[1];
#ifdef HAVE_LONG_DOUBLE
long double d;
#else
double d;
#endif
} u;
};
#define HASHBITS 30
@ -2477,7 +2486,7 @@ compare_constant (exp, desc)
tree exp;
struct constant_descriptor *desc;
{
return 0 != compare_constant_1 (exp, desc->contents);
return 0 != compare_constant_1 (exp, desc->u.contents);
}
/* Compare constant expression EXP with a substring P of a constant descriptor.
@ -3475,7 +3484,7 @@ compare_constant_rtx (mode, x, desc)
rtx x;
struct constant_descriptor *desc;
{
register int *p = (int *) desc->contents;
register int *p = (int *) desc->u.contents;
register int *strp;
register int len;
struct rtx_const value;
@ -3503,10 +3512,9 @@ record_constant_rtx (mode, x)
struct constant_descriptor *ptr;
ptr = ((struct constant_descriptor *)
xcalloc (1,
(sizeof (struct constant_descriptor)
+ sizeof (struct rtx_const) - 1)));
decode_rtx_const (mode, x, (struct rtx_const *) ptr->contents);
xcalloc (1, (offsetof (struct constant_descriptor, u)
+ sizeof (struct rtx_const))));
decode_rtx_const (mode, x, (struct rtx_const *) ptr->u.contents);
return ptr;
}