From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18123 invoked by alias); 16 Feb 2012 19:01:28 -0000 Received: (qmail 18105 invoked by uid 22791); 16 Feb 2012 19:01:26 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Feb 2012 19:00:40 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/52283] "error: case label does not reduce to an integer constant" for constant folded cast expr Date: Thu, 16 Feb 2012 19:03: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2012-02/txt/msg01695.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52283 --- Comment #7 from Jakub Jelinek 2012-02-16 19:00:28 UTC --- (In reply to comment #6) > Is this folding actually necessary for anything beyond diagnostics? I thought > it was agreed that folding in the FEs was EVIL and we should stop doing it. Yes, in various places some folding is needed for language semantics, in other places for various extensions. The C FE does far less folding then it did. > I wouldn't be surprised if the compiler got noticeably faster by removing all > early folding and all the workarounds and hacks that come with it, and The C FE these days doesn't perform the folding right away, it fully folds only when needed (for some extension, or when passing down expressions to the gimplifier). And no, the C FE isn't anywhere on the radar compile time wise on the vast majority of code (the C++ FE on the other side does still a lot of folding (some unnecessary, some needed) early, on some sources the FE already shows in compile time usage, but the folding in it doesn't).