public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>,
	        Java Patch List <java-patches@gcc.gnu.org>,
	        Richard Guenther <rguenther@suse.de>
Subject: PR c++/35469: Revert previous jboolean patches
Date: Tue, 11 Mar 2008 10:53:00 -0000	[thread overview]
Message-ID: <47D66485.10802@redhat.com> (raw)

CNI is broken because of some changes that attempted to make jboolean
behave the same way as C++ boolean.  In hindsight this was misguided,
and should not have been done.  The most catastrophic breakage is that
it is no longer possible to declare arrays of jboolean.

The only reasonable way to fix this severe regression is to back out
the earlier changes altogether.  This has the unfortunate consequence
that jboolean does not behave in precisely the same way as boolean, but
that only requires a small change to CNI documentation.

Andrew. 


2008-03-11  Andrew Haley  <aph@redhat.com>
	    
	    PR c++/35469
	    Revert:

  2008-02-04  Richard Guenther  <rguenther@suse.de>
  
          PR java/35035
          * decl.c (record_builtin_java_type): Make jboolean a
          integer type again where its mode doesn't match that of bool.
  
  2008-01-25  Richard Guenther  <rguenther@suse.de>
  
          PR c++/33887
          * decl.c (record_builtin_java_type): Make __java_boolean
          a variant of bool.
          * typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
          after TYPE_MAIN_VARIANT check. 

Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 132095)
+++ cp/decl.c	(revision 132094)
@@ -3161,13 +3161,7 @@
     type = make_signed_type (size);
   else if (size == -1)
     { /* "__java_boolean".  */
-      if ((TYPE_MODE (boolean_type_node)
-	   == smallest_mode_for_size (1, MODE_INT)))
-        type = build_variant_type_copy (boolean_type_node);
-      else
-	/* ppc-darwin has SImode bool, make jboolean a 1-bit
-	   integer type without boolean semantics there.  */
-	type = make_unsigned_type (1);
+      type = build_variant_type_copy (boolean_type_node);
     }
   else if (size > -32)
     { /* "__java_char".  */
Index: cp/typeck.c
===================================================================
--- cp/typeck.c	(revision 131840)
+++ cp/typeck.c	(revision 131839)
@@ -962,6 +962,8 @@
   if (TREE_CODE (t1) != ARRAY_TYPE
       && TYPE_QUALS (t1) != TYPE_QUALS (t2))
     return false;
+  if (TYPE_FOR_JAVA (t1) != TYPE_FOR_JAVA (t2))
+    return false;
 
   /* Allow for two different type nodes which have essentially the same
      definition.  Note that we already checked for equality of the type
@@ -971,9 +973,6 @@
       && TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2))
     return true;
 
-  if (TYPE_FOR_JAVA (t1) != TYPE_FOR_JAVA (t2))
-    return false;
-
   /* Compare the types.  Break out if they could be the same.  */
   switch (TREE_CODE (t1))
     {
Index: cp/decl.c
===================================================================
--- cp/decl.c	(revision 131840)
+++ cp/decl.c	(revision 131839)
@@ -3159,13 +3159,10 @@
   tree type, decl;
   if (size > 0)
     type = make_signed_type (size);
-  else if (size == -1)
-    { /* "__java_boolean".  */
-      type = build_variant_type_copy (boolean_type_node);
-    }
   else if (size > -32)
-    { /* "__java_char".  */
+    { /* "__java_char" or ""__java_boolean".  */
       type = make_unsigned_type (-size);
+      /*if (size == -1)	TREE_SET_CODE (type, BOOLEAN_TYPE);*/
     }
   else
     { /* "__java_float" or ""__java_double".  */

                 reply	other threads:[~2008-03-11 10:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47D66485.10802@redhat.com \
    --to=aph@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=java-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).