From bf5f0e909897688eec9f4f70eb88a805764675f1 Mon Sep 17 00:00:00 2001 From: John Carr Date: Wed, 29 Apr 1998 12:41:21 +0000 Subject: [PATCH] calls.c (expand_call): Fix recognition of C++ operator new. * 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 | 6 ++++++ gcc/alias.c | 6 ++++++ gcc/calls.c | 8 ++++++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4cb493cd55c..341de0045d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Wed Apr 29 15:34:40 1998 John Carr + + * 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 * config/mips/elf.h (ASM_OUTPUT_DEF,ASM_WEAKEN_LABEL, diff --git a/gcc/alias.c b/gcc/alias.c index a9024b8c98f..148b4527345 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -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 diff --git a/gcc/calls.c b/gcc/calls.c index 5c34913937e..51fa73b2805 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -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; } -- 2.30.2