From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31432 invoked by alias); 16 Feb 2012 17:32:46 -0000 Received: (qmail 31417 invoked by uid 22791); 16 Feb 2012 17:32:45 -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 17:31:58 +0000 From: "manu 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 17:56: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: manu 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: CC 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" Content-Transfer-Encoding: quoted-printable 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/msg01683.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D52283 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #4 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez 2012-02-16 17:31:04 UTC --- (In reply to comment #3) > On Thu, 16 Feb 2012, jakub at gcc dot gnu.org wrote: >=20 > > I hope we'll eventually extend TREE_NO_WARNING to be a bit that thise t= ree > > should be looked up in some hash table on what warnings should be suppr= essed on > > it, so that TREE_NO_WARNING does only disable warnings that it wants to. >=20 > That won't help with the issue of not being able to set it on shared=20 > trees, of course; you'll need separate trees for each use of a constant o= r=20 > declaration for that. What I don't understand is how Clang can track every constant / declaration separately and still consume ten times less memory than GCC. What is it that GCC is storing that takes so much space? In any case TREE_NO_WARNING is almost always a bad idea. It is indiscrimina= te, it silences any warning. It is unrelated to the warning code that it is try= ing to silence, so one has to track the logs to see why it was added. It impose= s an overload that for most code is unnecessary (since most code is warning free= ). And many of its uses are a hack to workaround corner cases of other hacks, = when the diagnostic code should just be smarter. What is the problem with stripping the nops *before giving the error* and i= f it still fails, give an error?