From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32311 invoked by alias); 17 Jul 2014 22:19:24 -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 32260 invoked by uid 89); 17 Jul 2014 22:19:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 17 Jul 2014 22:19:20 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6HMJIF1027417 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Jul 2014 18:19:18 -0400 Received: from [10.36.116.97] (ovpn-116-97.ams2.redhat.com [10.36.116.97]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6HMJGQB018622; Thu, 17 Jul 2014 18:19:17 -0400 Subject: Re: [PATCH] DWARFv5 DW_TAG_aligned_type. From: Mark Wielaard To: Joel Brobecker Cc: gdb-patches@sourceware.org, Tom Tromey In-Reply-To: <20140711144227.GB4888@adacore.com> References: <1404944457-4500-1-git-send-email-mjw@redhat.com> <20140711144227.GB4888@adacore.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 17 Jul 2014 22:25:00 -0000 Message-ID: <1405635556.17759.205.camel@bordewijk.wildebeest.org> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00485.txt.bz2 On Fri, 2014-07-11 at 07:42 -0700, Joel Brobecker wrote: > My only question is regarding the checks for alignments to be stricter > than the alignment of their base types. Why are they needed? I am asking > because, in Ada, it is allowed to be specifying an alignment which is > less strict than the standard alignment. We can ask for byte-aligned > integers, for instance. If I understand your patch correctly, the base > type will have no alignment attribute, and therefore the 1-byte > alignment attribute will be accepted. So my guess is that those checks > are implementing requirements of the proposed DWARF extension. This > leads me to ask why that's necessary? Shouldn't the compiler be able > to provide the actual alignement allowing consumers to just follow it > blindly? They do that because it assumes the proposed DWARF extension requires interpreting "layered" user alignments as if they follow C semantics. But you are right that should not be necessary. I just hadn't considered anything else than the C semantics when writing the code. Sorry. We do need to specify what it means when you have a type that is wrapped in multiple (different) user alignment tags. We could either say that has to be resolved by the consumer based on the semantics dictated by the DW_AT_language of the compile unit. Or we could say that a producer is responsible for interpreting the language semantics by making sure that the "outer" user alignment overrides any other user alignment tags (so in the C case, the producer would NOT add an extra user alignment tag, unless it was stricter than any existing ones for the underlying type). I think my preference is to do the second, make the producer responsible. What do you think? Thanks, Mark