From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 379 invoked by alias); 12 May 2007 09:48:08 -0000 Received: (qmail 32457 invoked by uid 48); 12 May 2007 09:47:54 -0000 Date: Sat, 12 May 2007 09:48:00 -0000 Message-ID: <20070512094754.32456.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libstdc++/29286] [4.0/4.1/4.2/4.3 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-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-05/txt/msg00889.txt.bz2 ------- Comment #51 from rguenth at gcc dot gnu dot org 2007-05-12 10:47 ------- This looks indeed very promising. I'll give it a spin on tramp3d. The only thing I noticed is that + case CHANGE_DYNAMIC_TYPE_EXPR: + /* We can access the location with the given type. We don't + track pointers in RTL, so we handle this by assuming that any + reference to one type can alias any reference to the other + type across the whole function. No code is generated. */ + { + tree type = CHANGE_DYNAMIC_TYPE_NEW_TYPE (exp); + tree ptr = CHANGE_DYNAMIC_TYPE_LOCATION (exp); + tree ptr_type = TREE_TYPE (ptr); + + gcc_assert (TREE_CODE (type) == POINTER_TYPE); + gcc_assert (TREE_CODE (ptr_type) == POINTER_TYPE); + merge_alias_sets_in_function (cfun, + get_alias_set (TREE_TYPE (type)), + get_alias_set (TREE_TYPE (ptr_type))); + return const0_rtx; + } doesn't seem to handle the case the original pointed to type is not the old dynamic type (which you rightfully were concerned about in comment #47). So it looks like (in absence of points-to information) we need to make the new dynamic type alias everything? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286