]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (record_builtin_java_type): Use canonicalized integer types.
authorAlexandre Oliva <aoliva@redhat.com>
Fri, 6 Mar 2009 09:10:46 +0000 (09:10 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Fri, 6 Mar 2009 09:10:46 +0000 (09:10 +0000)
* decl.c (record_builtin_java_type): Use canonicalized integer
types.

From-SVN: r144664

gcc/cp/ChangeLog
gcc/cp/decl.c

index 31a626bc1ade710344b879261415e2f3675e348a..720663918d41f903610a466915d1b2a92adc9d14 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-06  Alexandre Oliva  <aoliva@redhat.com>
+
+       * decl.c (record_builtin_java_type): Use canonicalized integer
+       types.
+
 2009-03-04  Jason Merrill  <jason@redhat.com>
 
        PR c++/38908
index ddd133ae2ea68085f630edb2ede2c74f40945d86..4ed342514b84b52b9c29a216be4a527316b5498a 100644 (file)
@@ -3168,10 +3168,18 @@ record_builtin_java_type (const char* name, int size)
 {
   tree type, decl;
   if (size > 0)
-    type = make_signed_type (size);
+    type = build_nonstandard_integer_type (size, 0);
   else if (size > -32)
-    { /* "__java_char" or ""__java_boolean".  */
-      type = make_unsigned_type (-size);
+    {
+      tree stype;
+      /* "__java_char" or ""__java_boolean".  */
+      type = build_nonstandard_integer_type (-size, 1);
+      /* Get the signed type cached and attached to the unsigned type,
+        so it doesn't get garbage-collected at "random" times,
+        causing potential codegen differences out of different UIDs
+        and different alias set numbers.  */
+      stype = build_nonstandard_integer_type (-size, 0);
+      TREE_CHAIN (type) = stype;
       /*if (size == -1)        TREE_SET_CODE (type, BOOLEAN_TYPE);*/
     }
   else