From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24939 invoked by alias); 1 Aug 2011 09:06:32 -0000 Received: (qmail 24753 invoked by uid 22791); 1 Aug 2011 09:06:31 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_TM 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; Mon, 01 Aug 2011 09:06:17 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/49911] SRA + DOM + VRP + -fstrict-enums incorrectly remove predicate X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW 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 Date: Mon, 01 Aug 2011 09:06:00 -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 X-SW-Source: 2011-08/txt/msg00013.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49911 --- Comment #9 from Richard Guenther 2011-08-01 09:05:38 UTC --- verifier patch that would catch at least computation results (but not loads): Index: gcc/tree-cfg.c =================================================================== --- gcc/tree-cfg.c (revision 176998) +++ gcc/tree-cfg.c (working copy) @@ -3241,6 +3314,16 @@ verify_gimple_assign_unary (gimple stmt) return true; } + if (INTEGRAL_TYPE_P (lhs_type) + && (!tree_int_cst_equal (TYPE_MIN_VALUE (lhs_type), + lower_bound_in_type (lhs_type, lhs_type)) + || !tree_int_cst_equal (TYPE_MAX_VALUE (lhs_type), + upper_bound_in_type (lhs_type, lhs_type)))) + { + error ("register with non-canonical bounds"); + return true; + } + /* First handle conversions. */ switch (rhs_code) { @@ -3397,6 +3480,16 @@ verify_gimple_assign_binary (gimple stmt return true; } + if (INTEGRAL_TYPE_P (lhs_type) + && (!tree_int_cst_equal (TYPE_MIN_VALUE (lhs_type), + lower_bound_in_type (lhs_type, lhs_type)) + || !tree_int_cst_equal (TYPE_MAX_VALUE (lhs_type), + upper_bound_in_type (lhs_type, lhs_type)))) + { + error ("register with non-canonical bounds"); + return true; + } + /* First handle operations that involve different types. */ switch (rhs_code) { shows that the IL after SRA is broken: t.ii: In function 'void jsop_setelem(bool, int)': t.ii:32:6: error: register with non-canonical bounds D.1816_11 = (RegisterID) z_3(D); t.ii:32:6: internal compiler error: verify_gimple failed Please submit a full bug report, with preprocessed source if appropriate. See for instructions.