This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What is gdb.base/structs2.exp actually testing?


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]