From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15108 invoked by alias); 20 Nov 2007 11:50:38 -0000 Received: (qmail 15038 invoked by uid 48); 20 Nov 2007 11:50:24 -0000 Date: Tue, 20 Nov 2007 11:50:00 -0000 Message-ID: <20071120115024.15037.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" 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: 2007-11/txt/msg01899.txt.bz2 ------- Comment #5 from jakub at gcc dot gnu dot org 2007-11-20 11:50 ------- While it would be nice if that got folded, I believe the problem is elsewhere. Consider: static const char s[] = "ab.cd.efghijk"; static const char t[] = "abcde"; long foo (const char *x) { const char *a; long b = 0; a = __builtin_strchr (s, '.'); return ((long) a) + (1 - (long) t); } (ok, not really kosher code, because there are two unrelated pointers involved). This ICEs the same way, and really fold can't fold &s[2] p+ (1 - (long int) &t[0]) to anything meaningful (well, perhaps it could avoid creating the ADDR_EXPR. The problem is IMHO in is_gimple_min_invariant blindly allowing any ADDR_EXPRs with TREE_INVARIANT set, yet the checking code in verify_expr insists that also TREE_OPERAND (addr_ref, 1) is is_gimple_val. Either the checking code should be made less stricter and allow any TREE_INVARIANT ADDR_EXPRs (likely very bad idea), or is_gimple_min_invariant should enforce it: case ADDR_EXPR: return TREE_INVARIANT (t) && is_gimple_val (TREE_OPERAND (t, 1)); -- jakub at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amacleod at redhat dot com, | |dnovillo at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34029