From 2491d2395347515f342a64e91a15f00826dfcb31 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Thu, 29 Feb 1996 10:46:58 -0800 Subject: [PATCH] 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 --- gcc/varasm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/varasm.c b/gcc/varasm.c index f9f5dd0f0c6..9b831100124 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -2428,9 +2428,12 @@ compare_constant_1 (exp, p) } 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); 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) { @@ -2585,7 +2588,8 @@ record_constant_1 (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); + (exp, (unsigned char *) permanent_obstack.next_free-nbytes, + nbytes); return; } else -- 2.30.2