From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21650 invoked by alias); 10 Sep 2013 07:49:34 -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 21591 invoked by uid 55); 10 Sep 2013 07:49:32 -0000 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/58346] ICE with SIGFPE at -O1 and above on x86_64-linux-gnu (affecting trunk, 4.8, 4.7, and 4.6) Date: Tue, 10 Sep 2013 07:49: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.9.0 X-Bugzilla-Keywords: accepts-invalid, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: NEW 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-09/txt/msg00653.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58346 --- Comment #6 from rguenther at suse dot de --- On Mon, 9 Sep 2013, joseph at codesourcery dot com wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58346 > > --- Comment #5 from joseph at codesourcery dot com --- > I think some of the uses of the zero-size-objects extension are ones for > which making an array of such objects is reasonable, but it makes sense to > give an error for trying to subtract pointers to such objects. A similar (runtime) error can be provoked by subtracting pointers to array elements of variable size that happen to have zero size at runtime. This all seems to be a can of worms which I'd rather shield the middle-end from. For example we assume that a[0] and a[1] never alias. Can we at least make arrays of zero-sized elements trigger undefined behavior in our extension documentation? We probably can paper over the ICEs as they occur (testing coverage is very weak of course).