[Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed

2008-01-04 Thread rguenth at gcc dot gnu dot org


--- Comment #8 from rguenth at gcc dot gnu dot org  2008-01-04 13:32 ---
Mine.  We'll stop the verifier from complaining.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
   |dot org |org
 Status|NEW |ASSIGNED
   Last reconfirmed|2007-11-10 22:25:22 |2008-01-04 13:32:46
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34029



[Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed

2008-01-04 Thread rguenth at gcc dot gnu dot org


--- Comment #9 from rguenth at gcc dot gnu dot org  2008-01-04 13:33 ---
Which also means this is a checking-only ICE.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords||ice-checking


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34029



[Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed

2008-01-04 Thread rguenth at gcc dot gnu dot org


--- Comment #10 from rguenth at gcc dot gnu dot org  2008-01-04 15:57 
---
Subject: Bug 34029

Author: rguenth
Date: Fri Jan  4 15:56:41 2008
New Revision: 131325

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=131325
Log:
2008-01-04  Richard Guenther  [EMAIL PROTECTED]

PR middle-end/34029
* tree-cfg.c (verify_expr): Do not look inside ADDR_EXPRs
for verifying purposes if they are is_gimple_min_invariant.

* gcc.c-torture/compile/pr34029-1.c: New testcase.
* gcc.c-torture/compile/pr34029-2.c: Likewise.

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr34029-1.c
trunk/gcc/testsuite/gcc.c-torture/compile/pr34029-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-cfg.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34029



[Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed

2008-01-04 Thread rguenth at gcc dot gnu dot org


--- Comment #11 from rguenth at gcc dot gnu dot org  2008-01-04 15:59 
---
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34029



[Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed

2008-01-03 Thread rguenth at gcc dot gnu dot org


--- Comment #6 from rguenth at gcc dot gnu dot org  2008-01-03 16:23 ---
I will test the following

bool
is_gimple_min_invariant (const_tree t)
{
  switch (TREE_CODE (t))
{
case ADDR_EXPR:
  /* We do not allow arbitrary invariant expressions as gimple
 such as a[1 - b], but only allow constant array indices
 inside the otherwise TREE_INVARIANT expression.  */
  if (!TREE_INVARIANT (t))
return false;
  t = TREE_OPERAND (t, 0);
  while (handled_component_p (t))
{
  if ((TREE_CODE (t) == ARRAY_REF
   || TREE_CODE (t) == ARRAY_RANGE_REF)
   TREE_CODE (TREE_OPERAND (t, 1)) != INTEGER_CST)
return false;
  t = TREE_OPERAND (t, 0);
}
  return true;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34029



[Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed

2008-01-03 Thread pinskia at gcc dot gnu dot org


--- Comment #7 from pinskia at gcc dot gnu dot org  2008-01-03 16:23 ---
I don't have time to work on this any more.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|pinskia at gcc dot gnu dot  |unassigned at gcc dot gnu
   |org |dot org
 Status|ASSIGNED|NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34029



[Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed

2007-11-27 Thread mmitchel at gcc dot gnu dot org


-- 

mmitchel at gcc dot gnu dot org changed:

   What|Removed |Added

   Priority|P3  |P1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34029



[Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed

2007-11-20 Thread jakub 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



[Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed

2007-11-08 Thread pinskia at gcc dot gnu dot org


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu dot
   ||org
   Keywords||ice-on-valid-code
Summary|internal compiler error:|[4.3 Regression] internal
   |verify_stmts failed |compiler error: verify_stmts
   ||failed
   Target Milestone|--- |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34029



[Bug tree-optimization/34029] [4.3 Regression] internal compiler error: verify_stmts failed

2007-11-08 Thread jakub at gcc dot gnu dot org


--- Comment #2 from jakub at gcc dot gnu dot org  2007-11-08 20:27 ---
Slightly reduced:
static const char s[] = ab.cd.efghijk;

int
foo (const char *x)
{
  const char *a;
  int b = 0;

  a = __builtin_strchr (s, '.');
  if (a == 0)
b = 1;
  else if ((a = __builtin_strchr (a + 1, '.')) == 0)
b = 1;
  else if (__builtin_strncmp (s, x, a - s))
b = 1;
  else if (__builtin_strncmp (a + 1, x + (a - s + 1), 4)  0)
b = 1;

  if (b)
return 4;
  return 0;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34029