From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23430 invoked by alias); 10 Feb 2009 00:59:47 -0000 Received: (qmail 23420 invoked by uid 22791); 10 Feb 2009 00:59:46 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,HK_OBFDOM,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Feb 2009 00:59:40 +0000 Received: from spaceape9.eur.corp.google.com (spaceape9.eur.corp.google.com [172.28.16.143]) by smtp-out.google.com with ESMTP id n1A0xbai020164 for ; Tue, 10 Feb 2009 00:59:37 GMT Received: from localhost (elbrus.corp.google.com [172.18.116.17]) by spaceape9.eur.corp.google.com with ESMTP id n1A0xYhd018232; Mon, 9 Feb 2009 16:59:35 -0800 Received: by localhost (Postfix, from userid 74925) id 610323A6B80; Mon, 9 Feb 2009 16:59:34 -0800 (PST) To: gdb-patches@sourceware.org Subject: [patch][commit] Fix gdb.cp/cpcompletion.exp failure with GCC-4.4.0 Message-Id: <20090210005934.610323A6B80@localhost> Date: Tue, 10 Feb 2009 00:59:00 -0000 From: ppluzhnikov@google.com (Paul Pluzhnikov) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-02/txt/msg00212.txt.bz2 Greetings, gdb.cp/cpcompletion.exp fails under GCC-4.4.0, because compiler optimizes out the 'a' variable: <1><50d>: Abbrev Number: 32 (DW_TAG_subprogram) <50e> DW_AT_external : 1 <50f> DW_AT_name : (indirect string, offset: 0xcd): main <513> DW_AT_decl_file : 1 <514> DW_AT_decl_line : 42 <515> DW_AT_type : <33c> <519> DW_AT_low_pc : 0x400370 <521> DW_AT_high_pc : 0x4003b0 <529> DW_AT_frame_base : 0xfc (location list) <52d> DW_AT_sibling : <569> <2><531>: Abbrev Number: 33 (DW_TAG_structure_type) <532> DW_AT_name : (indirect string, offset: 0x246): <536> DW_AT_byte_size : 1 <537> DW_AT_decl_file : 1 <538> DW_AT_decl_line : 45 <539> DW_AT_sibling : <551> <3><53d>: Abbrev Number: 34 (DW_TAG_subprogram) <53e> DW_AT_name : get <542> DW_AT_decl_file : 1 <543> DW_AT_decl_line : 46 <544> DW_AT_type : <33c> <548> DW_AT_declaration : 1 <4><549>: Abbrev Number: 6 (DW_TAG_formal_parameter) <54a> DW_AT_type : <569> <54e> DW_AT_artificial : 1 <2><551>: Abbrev Number: 35 (DW_TAG_variable) <552> DW_AT_name : a <554> DW_AT_decl_file : 1 <555> DW_AT_decl_line : 47 <556> DW_AT_type : <531> <<<< Missing DW_AT_location <2><55a>: Abbrev Number: 36 (DW_TAG_variable) <55b> DW_AT_name : (indirect string, offset: 0xb7): foo1 Committed as obvious. -- Paul Pluzhnikov testsuite/ChangeLog: 2009-02-06 Paul Pluzhnikov * gdb.cp/pr9594.cc: Prevent GCC from optimizing 'a' out. Index: gdb.cp/pr9594.cc =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/pr9594.cc,v retrieving revision 1.1 diff -u -p -u -r1.1 pr9594.cc --- gdb.cp/pr9594.cc 3 Feb 2009 01:09:01 -0000 1.1 +++ gdb.cp/pr9594.cc 10 Feb 2009 00:56:59 -0000 @@ -47,5 +47,6 @@ int main () } a; Foo foo1; foo1.set_foo (42); // Set breakpoint here. + a.get(); // Prevent compiler from throwing 'a' away. return 0; }