summaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-13 13:35:26 +0000
committerrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-13 13:35:26 +0000
commitf3751ef0be33148e3a5435722c822bed24db8062 (patch)
tree43f40ee6c0644a2670e655822e337fdf50fb05d6 /gcc/varasm.c
parent31bd149b296eeb1cc7ba1c5c1984dcc31f5ced30 (diff)
downloadgcc-f3751ef0be33148e3a5435722c822bed24db8062.tar.gz
* varasm.c (struct constant_descriptor): Put CONTENTS inside a
union to make it well-aligned. Update all uses. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37422 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index c4229037ed1..a6e65fd2400 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -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;
}