From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6254 invoked by alias); 27 Jun 2013 17:04:19 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 6218 invoked by uid 55); 27 Jun 2013 17:04:14 -0000 From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/57725] conflicting language extensions Date: Thu, 27 Jun 2013 17:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg01692.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57725 --- Comment #8 from joseph at codesourcery dot com --- On Thu, 27 Jun 2013, jbeulich at novell dot com wrote: > That's why I gave the example of where this is coming from - the code obviously > wants to be able to determine whether the data block between the two labels is > empty. And no, using asm()-s for this sort of thing is about the last thing I'd > consider acceptable. But that doesn't explain why it matters whether it's empty - why you aren't e.g. just iterating over objects between the labels (with an iteration that happens to do nothing if it's empty) or some such operation involving the difference between the labels (that happens to do nothing if the difference is 0). It never matters whether __init_array_start and __init_array_end are the same, or whether they compare equal or not, for example, because code that uses them naturally iterates over an array between them. I suppose such iterations use an ordered comparison with the end pointer, and comparing whether one pointer is less than another would work for you if you know the order the pointers would go in if unequal (but the compiler doesn't). It's intrinsic to using empty objects that it *doesn't matter to your code* when odd things happen about objects at the same address. If it matters whether addresses derived from different objects compare distinct (including whether it's determinate whether they compare distinct), don't use empty objects.