Commit 2491d239 by Per Bothner

varasm.c (compare_constant_1): For a SET_TYPE CONSTRUCTOR, first extract and…

varasm.c (compare_constant_1): For a SET_TYPE CONSTRUCTOR, first extract and compare the set length.

* varasm.c (compare_constant_1):  For a SET_TYPE CONSTRUCTOR,
first extract and compare the set length.
* varasm.c (record_constant_1):  For SET_TYPE CONSTRUCTOR,
permanent_obstack.next_free is *end* of available space.

From-SVN: r11385
parent c3d4f633
...@@ -2428,9 +2428,12 @@ compare_constant_1 (exp, p) ...@@ -2428,9 +2428,12 @@ compare_constant_1 (exp, p)
} }
else if (code == CONSTRUCTOR && TREE_CODE (TREE_TYPE (exp)) == SET_TYPE) else if (code == CONSTRUCTOR && TREE_CODE (TREE_TYPE (exp)) == SET_TYPE)
{ {
len = int_size_in_bytes (TREE_TYPE (exp)); int xlen = len = int_size_in_bytes (TREE_TYPE (exp));
strp = (char*) alloca (len); strp = (char*) alloca (len);
get_set_constructor_bytes (exp, (unsigned char *) strp, len); get_set_constructor_bytes (exp, (unsigned char *) strp, len);
if (bcmp ((char *) &xlen, p, sizeof xlen))
return 0;
p += sizeof xlen;
} }
else if (code == CONSTRUCTOR) else if (code == CONSTRUCTOR)
{ {
...@@ -2585,7 +2588,8 @@ record_constant_1 (exp) ...@@ -2585,7 +2588,8 @@ record_constant_1 (exp)
obstack_grow (&permanent_obstack, &nbytes, sizeof (nbytes)); obstack_grow (&permanent_obstack, &nbytes, sizeof (nbytes));
obstack_blank (&permanent_obstack, nbytes); obstack_blank (&permanent_obstack, nbytes);
get_set_constructor_bytes get_set_constructor_bytes
(exp, (unsigned char *) permanent_obstack.next_free, nbytes); (exp, (unsigned char *) permanent_obstack.next_free-nbytes,
nbytes);
return; return;
} }
else else
......
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