From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31397 invoked by alias); 12 Oct 2005 17:53:54 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 31372 invoked by uid 22791); 12 Oct 2005 17:53:51 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 12 Oct 2005 17:53:51 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j9CHrnPC022575; Wed, 12 Oct 2005 13:53:50 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j9CHrnV18171; Wed, 12 Oct 2005 13:53:49 -0400 Received: from theseus.home..redhat.com (vpn26-6.sfbay.redhat.com [172.16.26.6]) by devserv.devel.redhat.com (8.12.11/8.12.11) with ESMTP id j9CHrlAo005250; Wed, 12 Oct 2005 13:53:48 -0400 To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: RFC: Relax checking of garbage struct return values References: <200510092032.j99KWGYO030371@elgar.sibelius.xs4all.nl> From: Jim Blandy Date: Wed, 12 Oct 2005 17:53:00 -0000 In-Reply-To: <200510092032.j99KWGYO030371@elgar.sibelius.xs4all.nl> (Mark Kettenis's message of "Sun, 9 Oct 2005 22:32:16 +0200 (CEST)") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-10/txt/msg00112.txt.bz2 Mark Kettenis writes: >> From: Jim Blandy >> Date: Thu, 06 Oct 2005 10:44:29 -0700 >> >> The comments are supposed to have the story. Tested on >> x86_64-pc-linux-gnu. >> >> 2005-10-05 Jim Blandy >> >> * gdb.base/structs.exp (any): New function. >> (test_struct_returns): Don't make any assumptions at all about >> what value the function returns when GDB can't set the return >> value. > > I remember having a discussion about this with Andrew some time ago. > I believe Andrew argued that if the compiler doesn't pass L as the > buffer, this should be considered a compiler bug. I don't agree with that at all. The compiler is free to generate any code it pleases, as long as the machine code behaves the way the semantics of C require it to. An ordinary assignment of one int to another could go through seven temporaries, get xor'd with 55 twice, pushed on the stack, and then popped into its destination, and that's correct. It's just lousy code. > Anyway, there is another case where things fail. Some compilers use a > "static" buffer to store function values. On those systems these > tests fail too. It's a pretty losing convention, because it isn't reentrant. But I know of such a compiler, too. > I think your patch is ok: gdb is not a compiler testsuite. Okay --- thanks for the review.