From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3678 invoked by alias); 14 Apr 2014 18:16:22 -0000 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 Received: (qmail 3666 invoked by uid 89); 14 Apr 2014 18:16:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 14 Apr 2014 18:16:19 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 10137116176; Mon, 14 Apr 2014 14:16:18 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id RnUN7AkxkGzm; Mon, 14 Apr 2014 14:16:18 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id D13F5116111; Mon, 14 Apr 2014 14:16:17 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 64E2FE02C0; Mon, 14 Apr 2014 11:16:23 -0700 (PDT) Date: Mon, 14 Apr 2014 18:16:00 -0000 From: Joel Brobecker To: Eric Christopher Cc: David Blaikie , gdb-patches Subject: Re: [patch] [gdb/testsuite] include a use of the definition of a type to cause clang to emit debug info Message-ID: <20140414181623.GS4250@adacore.com> References: <20140414131050.GR4250@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-04/txt/msg00278.txt.bz2 > > The gdb11479.exp is obvious and can be pushed. The change to gdb11479.c, > > on the other hand, changes the test, and I don't think we want that, > > because I disagree with the outcome of Clang's optimization here. > > If Clang doesn't want to fix the problem, best to just xfail the test > > with Clang, and write a new one that provides the type definition as > > Clang wants it. > > Could you describe your objection here? In particular, as it relates > to Dave's analysis of a similar gcc optimization. (Also a few people > have been interested in implementing this same behavior in gcc). The fact is, at the moment, that GCC generates the necessary debugging information, without the need to create a typedef. If it stops working thanks to a GCC "optimization", I would like to know about it (personally). In this particular case, the type is used locally, albeit as a pointer, and it would seem unfriendly to me that the user not be able to either print the pointed object's size, or any of the enum's element, just because it is only used via a pointer. I also seems strange to me that an unused typedef is enough to trigger full debug info generation, while a variable indirectly referencing a type is not. That's why I suggested that we keep the current testcase as is, with an xfail with clang, and create a new one if we want to, that tests the behavior with the proposed work around. That's only my opinion, however; it would be fine for the change to go in if other maintainers disagree with me and approve the change. -- Joel