From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9650 invoked by alias); 4 Feb 2011 18:40:31 -0000 Received: (qmail 9630 invoked by uid 22791); 4 Feb 2011 18:40:30 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 Feb 2011 18:40:26 +0000 From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/46941] [trans-mem] new/delete operator are unsafe X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aldyh at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 04 Feb 2011 18:40:00 -0000 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: 2011-02/txt/msg00676.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46941 --- Comment #12 from Aldy Hernandez 2011-02-04 18:40:09 UTC --- Patrick, the reason memory allocated by the C++ new operator does not get optimized by the TM-memopt pass is not because of a missing ECF_MALLOC attribute, but because the alias oracle in GCC considers the chunk of memory as possibly able to escape from the current function. That is, the following hunk of code returns true in the TM-memopt pass: if (ptr_deref_may_alias_global_p (x)) Apparently, since new/delete operators may be overridden by class specific hooks, the memory must be considered escaped. So, this is not a TM bug, but a "feature" of the alias oracle in GCC.