From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24770 invoked by alias); 8 Mar 2004 15:07:01 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 24738 invoked from network); 8 Mar 2004 15:07:00 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 8 Mar 2004 15:07:00 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu-dmz.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i28F6xST025005 for ; Mon, 8 Mar 2004 10:06:59 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i28F6wM18737 for ; Mon, 8 Mar 2004 10:06:58 -0500 Received: from cygbert.vinschen.de (vpn50-16.rdu.redhat.com [172.16.50.16]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id i28F6pR24132 for ; Mon, 8 Mar 2004 07:06:54 -0800 Received: by cygbert.vinschen.de (Postfix, from userid 500) id 26FE6580E2; Mon, 8 Mar 2004 16:06:23 +0100 (CET) Date: Mon, 08 Mar 2004 15:07:00 -0000 From: Corinna Vinschen To: gdb@sources.redhat.com Subject: Re: What is gdb.base/structs2.exp actually testing? Message-ID: <20040308150623.GA23993@cygbert.vinschen.de> Reply-To: gdb@sources.redhat.com Mail-Followup-To: gdb@sources.redhat.com References: <20040308144154.GE11141@cygbert.vinschen.de> <20040308145454.GA16299@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040308145454.GA16299@nevyn.them.org> User-Agent: Mutt/1.4.2i X-RedHat-Spam-Score: -4.9 X-SW-Source: 2004-03/txt/msg00045.txt.bz2 On Mar 8 09:54, Daniel Jacobowitz wrote: > On Mon, Mar 08, 2004 at 03:41:54PM +0100, Corinna Vinschen wrote: > > Hi, > > > > the subject already contains the question. What is the structs2 test > > good for? It's really not clear to me. There's a PR 13536 mentioned > > in the first line of structs2.c but this is a PRMS number and searching > > the gdb-patches archive didn't give me any useful hint. Is PRMS still > > accessible somewhere? > > > > The problem with this test is that it is based on the assumption, that > > GCC would not optimize away unused variables. The register arguments > > to param_reg are not reallyused, instead they only get values assigned. > > GCC is able to recognize this and to optimize away these assignments > > entirely, even in the non-optimize case! This happens for example on > > the SH target. > > > > The consequence of this fact is that the binary doesn't contain any > > debug information for the given register variables, so GDB doesn't know > > about them. In turn the testcase has two fails: > > > > FAIL: gdb.base/structs2.exp: structs2 continue1 (PRMS 13536) > > FAIL: gdb.base/structs2.exp: structs2 continue2 (PRMS 13536) > > > > due to the fact that the arguments are not printed, when the breakpoint > > is hit: > > > > Breakpoint 2, param_reg () at ... > > > > Are these tests really useful or shouldn't they either be dropped or > > modified to accomodate the above case? > > Personally, that seems like a very dubious optimization for GCC to be > making at -O0... we can't change the calling convention at -O0, so the > arguments are there, so GCC ought to emit enough information for us to > find them. You didn't mention what compiler version you're testing > with... It happened with 3.4 and a 3.5.0 snapshot. Corinna -- Corinna Vinschen Cygwin Developer Red Hat, Inc.