From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11096 invoked by alias); 29 Sep 2006 16:25:07 -0000 Received: (qmail 10823 invoked by uid 48); 29 Sep 2006 16:24:53 -0000 Date: Fri, 29 Sep 2006 16:25:00 -0000 Message-ID: <20060929162453.10822.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/29286] [4.2 Regression] placement new does not change the dynamic type as it should In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-09/txt/msg02768.txt.bz2 List-Id: ------- Comment #11 from rguenth at gcc dot gnu dot org 2006-09-29 16:24 ------- I don't really know. But for this issue I would like to introduce middle-end no-op builtins __builtin_clobber (void*) clobber the pointer argument alias set like we do for malloc/free (and other calls): int foo(void) { int i, *p, *q; p = malloc(4); *p = 0; free(p); q = malloc(4); *q = 1; i = *q; free(q); return i; } : # HEAP.4_10 = V_MAY_DEF ; # HEAP.5_11 = V_MAY_DEF ; D.1530_1 = malloc (4); p_2 = (int *) D.1530_1; # HEAP.4_12 = V_MAY_DEF ; *p_2 = 0; # HEAP.4_13 = V_MAY_DEF ; # HEAP.5_14 = V_MAY_DEF ; free (p_2); # HEAP.4_15 = V_MAY_DEF ; # HEAP.5_16 = V_MAY_DEF ; D.1531_3 = malloc (4); q_4 = (int *) D.1531_3; # HEAP.5_17 = V_MAY_DEF ; *q_4 = 1; # VUSE ; i_5 = *q_4; # HEAP.4_18 = V_MAY_DEF ; # HEAP.5_19 = V_MAY_DEF ; free (q_4); D.1532_6 = i_5; return D.1532_6; or even just a way to add a VUSE of the pointer alias sets, or even void * __builtin_new_object (void *p) which would do # VUSE

# HEAP.n = V_MAY_DEF p = __builtin_new_object (p) i.e. associate a new alias tag with the return value. Can you benchmark the workaround in the library? -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dberlin at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286