summaryrefslogtreecommitdiffstats
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-02-15 06:41:25 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-02-15 06:41:25 +0000
commitb9bc495ab0a5987787affd389b864a195123d945 (patch)
treecbbb89df1716f5cad381fe699dc2d404e122403b /gcc/varasm.c
parentb599eea55b660ff12836e2fe963919c0b54628d7 (diff)
downloadppe42-gcc-b9bc495ab0a5987787affd389b864a195123d945.tar.gz
ppe42-gcc-b9bc495ab0a5987787affd389b864a195123d945.zip
* varasm.c (const_hash): Add support for SET_TYPE constructors.
(record_constant_1), (copy_constant): Likewise. (output_constant): Likewise. (Also SET_TYPE INTEGER_CSTs.) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8955 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 9091023ff4c..42cde912aa7 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2149,6 +2149,12 @@ const_hash (exp)
else if (code == COMPLEX_CST)
return const_hash (TREE_REALPART (exp)) * 5
+ const_hash (TREE_IMAGPART (exp));
+ else if (code == CONSTRUCTOR && TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
+ {
+ len = int_size_in_bytes (TREE_TYPE (exp));
+ p = (char*) alloca (len);
+ get_set_constructor_bytes (exp, (unsigned char *) p, len);
+ }
else if (code == CONSTRUCTOR)
{
register tree link;
@@ -2274,6 +2280,12 @@ compare_constant_1 (exp, p)
p = compare_constant_1 (TREE_IMAGPART (exp), p);
return p;
}
+ else if (code == CONSTRUCTOR && TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
+ {
+ len = int_size_in_bytes (TREE_TYPE (exp));
+ strp = (char*) alloca (len);
+ get_set_constructor_bytes (exp, (unsigned char *) strp, len);
+ }
else if (code == CONSTRUCTOR)
{
register tree link;
@@ -2418,6 +2430,16 @@ record_constant_1 (exp)
record_constant_1 (TREE_IMAGPART (exp));
return;
}
+ else if (code == CONSTRUCTOR && TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
+ {
+ int nbytes = int_size_in_bytes (TREE_TYPE (exp));
+ obstack_grow (&permanent_obstack, &nbytes, sizeof (nbytes));
+ obstack_blank (&permanent_obstack, nbytes);
+ get_set_constructor_bytes (exp,
+ (unsigned char *) permanent_obstack.next_free,
+ nbytes);
+ return;
+ }
else if (code == CONSTRUCTOR)
{
register tree link;
@@ -2573,6 +2595,9 @@ copy_constant (exp)
CONSTRUCTOR_ELTS (copy) = list;
for (tail = list; tail; tail = TREE_CHAIN (tail))
TREE_VALUE (tail) = copy_constant (TREE_VALUE (tail));
+ if (TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
+ for (tail = list; tail; tail = TREE_CHAIN (tail))
+ TREE_PURPOSE (tail) = copy_constant (TREE_PURPOSE (tail));
return copy;
}
@@ -3489,6 +3514,22 @@ output_constant (exp, size)
else
abort ();
return;
+
+ case SET_TYPE:
+ if (TREE_CODE (exp) == INTEGER_CST)
+ assemble_integer (expand_expr (exp, NULL_RTX,
+ VOIDmode, EXPAND_INITIALIZER),
+ byte_size, 1);
+ else if (TREE_CODE (exp) == CONSTRUCTOR)
+ {
+ unsigned char *buffer = (unsigned char *) alloca (byte_size);
+ if (get_set_constructor_bytes (constructor, buffer, byte_size))
+ abort ();
+ assemble_string (buffer, byte_size);
+ }
+ else
+ error ("unknown set constructor type");
+ return;
}
if (size > 0)
OpenPOWER on IntegriCloud