OSDN Git Service

* varasm.c (compare_constant_1): For a SET_TYPE CONSTRUCTOR,
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 29 Feb 1996 18:46:58 +0000 (18:46 +0000)
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 29 Feb 1996 18:46:58 +0000 (18:46 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@11385 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/varasm.c

index f9f5dd0..9b83110 100644 (file)
@@ -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