From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27113 invoked by alias); 4 Dec 2001 11:26:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 27072 invoked by uid 71); 4 Dec 2001 11:26:02 -0000 Resent-Date: 4 Dec 2001 11:26:02 -0000 Resent-Message-ID: <20011204112602.27071.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, richard@ex-parrot.com Received:(qmail 24199 invoked by uid 61); 4 Dec 2001 11:16:02 -0000 Message-Id:<20011204111601.24198.qmail@sources.redhat.com> Date: Tue, 04 Dec 2001 03:26:00 -0000 From: richard@ex-parrot.com Reply-To: richard@ex-parrot.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.2 (1.1.1.1.2.21) Subject: optimization/5006: Multiple temporary objects created on stack in the same location. X-SW-Source: 2001-12/txt/msg00300.txt.bz2 List-Id: >Number: 5006 >Category: optimization >Synopsis: Multiple temporary objects created on stack in the same location. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Tue Dec 04 03:26:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Richard Smith >Release: 3.0.2 (and 3.0.1) >Organization: >Environment: i686-pc-linux-gnu >Description: When compiling with -O, the compiler creates a temporary object of type auto_ptr on the stack. It then overwrites this with a temporary of type A before calling the destructor on the original auto_ptr. This tries to call ::operator delete() on what it thinks is the heap-allocated pointer owned by the auto_ptr but is actually a string literal owned by A. Depending on the exact memory layout, a segv sometimes results. >How-To-Repeat: Build with -O to duplicate the bug. A run-time segv (usually) results. >Fix: >Release-Note: >Audit-Trail: >Unformatted: