public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ new and aliasing
@ 1998-04-25 16:18 John Carr
  1998-04-27 19:48 ` Jim Wilson
  1998-04-28  1:54 ` Andreas Schwab
  0 siblings, 2 replies; 4+ messages in thread
From: John Carr @ 1998-04-25 16:18 UTC (permalink / raw)
  To: egcs

This patch fixes a bug in the code which tests whether a call is to
a malloc-like function.  (The alias code knows that the return value
of malloc does not alias any other memory.)


Sat Apr 25 16:38:46 1998  John Carr  <jfc@mit.edu>

	* calls.c (expand_call): Fix code to recognize C++ operator new.

*** calls.c	1998/04/09 00:44:41	1.19
--- calls.c	1998/04/25 20:40:57
*************** expand_call (exp, target, ignore)
*** 901,908 ****
        else if (! strcmp (tname, "malloc")
  	       || ! strcmp (tname, "calloc")
  	       || ! strcmp (tname, "realloc")
! 	       || ! strcmp (tname, "__builtin_new")
! 	       || ! strcmp (tname, "__builtin_vec_new"))
  	is_malloc = 1;
      }
  
--- 901,912 ----
        else if (! strcmp (tname, "malloc")
  	       || ! strcmp (tname, "calloc")
  	       || ! strcmp (tname, "realloc")
! 	       /* Note use of NAME rather than TNAME here.  These functions
! 		  are only reserved when preceded with __.  */
! 	       || ! strcmp (name, "__vn")	/* mangled __builtin_vec_new */
! 	       || ! strcmp (name, "__nw")	/* mangled __builtin_new */
! 	       || ! strcmp (name, "__builtin_new")
! 	       || ! strcmp (name, "__builtin_vec_new"))
  	is_malloc = 1;
      }
  

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

* Re: C++ new and aliasing
  1998-04-25 16:18 C++ new and aliasing John Carr
@ 1998-04-27 19:48 ` Jim Wilson
  1998-04-28  1:54 ` Andreas Schwab
  1 sibling, 0 replies; 4+ messages in thread
From: Jim Wilson @ 1998-04-27 19:48 UTC (permalink / raw)
  To: John Carr; +Cc: egcs

	* calls.c (expand_call): Fix code to recognize C++ operator new.

This is OK to install.

Jim

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

* Re: C++ new and aliasing
  1998-04-25 16:18 C++ new and aliasing John Carr
  1998-04-27 19:48 ` Jim Wilson
@ 1998-04-28  1:54 ` Andreas Schwab
  1998-04-28 17:50   ` Jim Wilson
  1 sibling, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 1998-04-28  1:54 UTC (permalink / raw)
  To: egcs

Here is another bug fix for expand_call: __builtin_vec_new has 17
characters.


1998-04-27  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* calls.c (expand_call): Bump the length limit on the specially
	recognized function names to 17.

--- egcs-2.91.25/gcc/calls.c.~1~	Thu Apr 16 00:53:17 1998
+++ egcs-2.91.25/gcc/calls.c	Mon Apr 27 21:30:17 1998
@@ -854,7 +854,7 @@
   is_longjmp = 0;
   is_malloc = 0;
 
-  if (name != 0 && IDENTIFIER_LENGTH (DECL_NAME (fndecl)) <= 15
+  if (name != 0 && IDENTIFIER_LENGTH (DECL_NAME (fndecl)) <= 17
       /* Exclude functions not at the file scope, or not `extern',
 	 since they are not the magic functions we would otherwise
 	 think they are.  */

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"
schwab@gnu.org

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

* Re: C++ new and aliasing
  1998-04-28  1:54 ` Andreas Schwab
@ 1998-04-28 17:50   ` Jim Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Jim Wilson @ 1998-04-28 17:50 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: egcs

This is OK to install.

Jim

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

end of thread, other threads:[~1998-04-28 17:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-25 16:18 C++ new and aliasing John Carr
1998-04-27 19:48 ` Jim Wilson
1998-04-28  1:54 ` Andreas Schwab
1998-04-28 17:50   ` Jim Wilson

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