This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Nov 2007 11:50:24 -0000
- Subject: [Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed
- References: <bug-34029-15329@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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