public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re:  A patch for g++
@ 1998-05-07 17:39 Andrew Macleod
  1998-05-07 21:59 ` No prototype for is_java_type H.J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Macleod @ 1998-05-07 17:39 UTC (permalink / raw)
  To: hjl; +Cc: egcs

>> Hi,
>> 
>> Your change:
>> 
>> Tue May  5 18:24:13 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
>>  
>> 	* method.c: Add a call to build_type_variant to get the right type.
>> 
>> breaks c++. A testcase is enclosed here. The patch below seems to fix
>> the bug for me. Can you take a look at it?

It was already broken.. this fixed some of it, but apparently not all, and
caused other things to break. Figures :-)

Thanks for the testcase and the patch. I elected to change the area where
the other TREE_USED flags are zeroed out instead, so its all done in
one place. I have applied the patch to egcs.

Andrew


>> BTW, is_java_type () is not declared anywhere.
>> 

It should be defined on line 1142 of method.c:

int
is_java_type (type)
     tree type;
{
...



(btw I applied the following:)
Index: method.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/cp/method.c,v
retrieving revision 1.190
diff -c -p -r1.190 method.c
*** method.c    1998/05/05 22:31:48     1.190
--- method.c    1998/05/07 21:24:26
*************** build_decl_overload_real (dname, parms,
*** 1620,1626 ****
            typevec = NULL;
            while (t)
              {
!               TREE_USED (TREE_VALUE (t)) = 0;
                t = TREE_CHAIN (t);
              }
          }
--- 1620,1631 ----
            typevec = NULL;
            while (t)
              {
!               tree temp = TREE_VALUE (t);
!               TREE_USED (temp) = 0;
!               /* clear out the type variant in case we used it */
!               temp = build_type_variant (TYPE_MAIN_VARIANT (temp),
!                     TYPE_READONLY (temp), TYPE_VOLATILE (temp));
!               TREE_USED (temp) = 0;
                t = TREE_CHAIN (t);
              }
          }


^ permalink raw reply	[flat|nested] 8+ messages in thread
* A patch for g++
@ 1998-05-07 15:31 H.J. Lu
  0 siblings, 0 replies; 8+ messages in thread
From: H.J. Lu @ 1998-05-07 15:31 UTC (permalink / raw)
  To: amacleod; +Cc: egcs

Hi,

Your change:

Tue May  5 18:24:13 EDT 1998  Andrew MacLeod  <amacleod@cygnus.com>
 
	* method.c: Add a call to build_type_variant to get the right type.

breaks c++. A testcase is enclosed here. The patch below seems to fix
the bug for me. Can you take a look at it?

BTW, is_java_type () is not declared anywhere.

Thanks.

-- 
H.J. Lu (hjl@gnu.org)
---
Thu May  7 07:36:26 1998  H.J. Lu  (hjl@gnu.org)

	* method.c (build_mangled_name): Clear the TREE_USED bit when
	it is used for the first time for the current function.

Index: method.c
===================================================================
RCS file: /home/work/cvs/gnu/egcs/gcc/cp/method.c,v
retrieving revision 1.1.1.26
diff -u -p -r1.1.1.26 method.c
--- method.c	1998/05/06 21:01:08	1.1.1.26
+++ method.c	1998/05/07 18:32:47
@@ -1051,6 +1051,17 @@ build_mangled_name (parmtypes, begin, en
         else 
           if (!nofold && typevec)
             {
+	      int i;
+
+	      /* Since we use build_type_variant () to get parmtype now,
+		 we may use an old one. We have to clear the TREE_USED
+		 bit when we first use it for this function. */
+	      for (i = 0; i < maxtype; i++)
+		if (typevec[i] == parmtype)
+		  break;
+	      if (i == maxtype)
+		TREE_USED (parmtype) = 0;
+
               /* Every argument gets counted.  */
               typevec[maxtype++] = parmtype;
 
--foo.cc---
typedef void (*Fix16_peh)(short&);
typedef void (*Fix24_peh)(int&);
typedef void (*Fix48_peh)(char&);
extern Fix16_peh set_Fix16_overflow_handler(Fix16_peh);
extern Fix24_peh set_Fix24_overflow_handler(Fix24_peh);
extern Fix48_peh set_Fix48_overflow_handler(Fix48_peh);

void
set_overflow_handler (Fix16_peh handler16, Fix24_peh handler24)
{
}

void
set_overflow_handler (Fix24_peh handler24, Fix48_peh handler48)
{
}

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1998-05-10  2:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-05-07 17:39 A patch for g++ Andrew Macleod
1998-05-07 21:59 ` No prototype for is_java_type H.J. Lu
1998-05-07 23:40   ` Jeffrey A Law
1998-05-08  7:55     ` H.J. Lu
1998-05-08  9:29       ` Jeffrey A Law
1998-05-08  9:29         ` H.J. Lu
1998-05-10  2:05           ` Jeffrey A Law
  -- strict thread matches above, loose matches on Subject: below --
1998-05-07 15:31 A patch for g++ H.J. Lu

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).