calls.c (expand_call): Fix recognition of C++ operator new.
authorJohn Carr <jfc@mit.edu>
Wed, 29 Apr 1998 12:41:21 +0000 (12:41 +0000)
committerJohn Carr <jfc@gcc.gnu.org>
Wed, 29 Apr 1998 12:41:21 +0000 (12:41 +0000)
* calls.c (expand_call): Fix recognition of C++ operator new.
* alias.c (mode_alias_check): Disable type based alias detection.

From-SVN: r19492

gcc/ChangeLog
gcc/alias.c
gcc/calls.c

index 4cb493cd55c6773efd433c693ee674b21dfa790c..341de0045d2886e5dbfc360db30f1f9646aaa009 100644 (file)
@@ -1,3 +1,9 @@
+Wed Apr 29 15:34:40 1998  John Carr  <jfc@mit.edu>
+
+       * calls.c (expand_call): Fix recognition of C++ operator new.
+
+       * alias.c (mode_alias_check): Disable type based alias detection.
+
 Wed Apr 29 15:06:42 1998  Gavin Koch  <gavin@cygnus.com>
 
        * config/mips/elf.h (ASM_OUTPUT_DEF,ASM_WEAKEN_LABEL,
index a9024b8c98f4ab9c2c2b1321d43526ece0f468bf..148b4527345514180e22e85e456f6185dc124586 100644 (file)
@@ -859,6 +859,11 @@ mode_alias_check (x, y, varies)
      register rtx x, y;
      int (*varies) PROTO ((rtx));
 {
+#if 1
+  /* gcc rules: all type aliasing allowed  */
+  return 1;
+#else
+  /* ANSI C rules: different types do not alias. */
   enum machine_mode x_mode = GET_MODE (x), y_mode = GET_MODE (y);
   rtx x_addr = XEXP (x, 0), y_addr = XEXP (y, 0);
   int x_varies, y_varies, x_struct, y_struct;
@@ -903,6 +908,7 @@ mode_alias_check (x, y, varies)
   /* Both are varying structs or fixed scalars.  Check that they are not
      the same type.  */
   return (x_struct == y_struct);
+#endif
 }
 
 /* Read dependence: X is read after read in MEM takes place.  There can
index 5c34913937e96e0bb4b9cd1de75c46fd494295b6..51fa73b2805ae67626887f659bd3c26a7526423e 100644 (file)
@@ -901,8 +901,12 @@ expand_call (exp, target, ignore)
       else if (! strcmp (tname, "malloc")
               || ! strcmp (tname, "calloc")
               || ! strcmp (tname, "realloc")
-              || ! strcmp (tname, "__builtin_new")
-              || ! strcmp (tname, "__builtin_vec_new"))
+              /* 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;
     }