* [Bug tree-optimization/21021] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
@ 2005-04-14 13:32 ` drow at gcc dot gnu dot org
2005-04-14 13:38 ` kazu at cs dot umass dot edu
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: drow at gcc dot gnu dot org @ 2005-04-14 13:32 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From drow at gcc dot gnu dot org 2005-04-14 13:32 -------
Created an attachment (id=8630)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8630&action=view)
Test case
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
2005-04-14 13:32 ` [Bug tree-optimization/21021] " drow at gcc dot gnu dot org
@ 2005-04-14 13:38 ` kazu at cs dot umass dot edu
2005-04-14 14:00 ` kazu at cs dot umass dot edu
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-14 13:38 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |kazu at cs dot umass dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
2005-04-14 13:32 ` [Bug tree-optimization/21021] " drow at gcc dot gnu dot org
2005-04-14 13:38 ` kazu at cs dot umass dot edu
@ 2005-04-14 14:00 ` kazu at cs dot umass dot edu
2005-04-14 14:11 ` kazu at cs dot umass dot edu
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-14 14:00 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kazu at cs dot umass dot edu 2005-04-14 14:00 -------
Daniel, I have tough time reproducing this.
I get
In file included from dl-iteratephdr.c:22:
../include/errno.h:31: error: thread-local storage not supported for this target
Am I missing some options?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
` (2 preceding siblings ...)
2005-04-14 14:00 ` kazu at cs dot umass dot edu
@ 2005-04-14 14:11 ` kazu at cs dot umass dot edu
2005-04-14 14:43 ` kazu at cs dot umass dot edu
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-14 14:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kazu at cs dot umass dot edu 2005-04-14 14:11 -------
OK, I enabled HAVE_AS_TLS by hand. Now I can reproduce the ICE.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
` (3 preceding siblings ...)
2005-04-14 14:11 ` kazu at cs dot umass dot edu
@ 2005-04-14 14:43 ` kazu at cs dot umass dot edu
2005-04-14 14:52 ` [Bug tree-optimization/21021] [4.1 Regression] " pinskia at gcc dot gnu dot org
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-14 14:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kazu at cs dot umass dot edu 2005-04-14 14:42 -------
Reduced down to:
struct link_map {
struct link_map *next;
unsigned int start, end;
};
void
foo (struct link_map **array, long int cnt)
{
struct link_map *l;
const void *caller = __builtin_extract_return_addr (__builtin_return_address (0));
long int ns = 0;
for (l = array[cnt]; l; l = l->next)
{
if (caller >= (const void *) l->start
&& caller < (const void *) l->end)
ns = cnt;
}
for (l = array[ns]; l != 0; l = l->next)
;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] [4.1 Regression] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
` (4 preceding siblings ...)
2005-04-14 14:43 ` kazu at cs dot umass dot edu
@ 2005-04-14 14:52 ` pinskia at gcc dot gnu dot org
2005-04-14 14:54 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-14 14:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-14 14:52 -------
Confirmed, with Kazu's reduced testcase on i686-pc-linux.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |ice-on-valid-code
Last reconfirmed|0000-00-00 00:00:00 |2005-04-14 14:52:15
date| |
Summary|ICE in tree-vrp building |[4.1 Regression] ICE in
|glibc |tree-vrp building glibc
Target Milestone|--- |4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] [4.1 Regression] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
` (5 preceding siblings ...)
2005-04-14 14:52 ` [Bug tree-optimization/21021] [4.1 Regression] " pinskia at gcc dot gnu dot org
@ 2005-04-14 14:54 ` pinskia at gcc dot gnu dot org
2005-04-14 14:56 ` kazu at cs dot umass dot edu
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-14 14:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-04-14 14:54 -------
Here is a testcase which does not use builtins:
struct link_map {
struct link_map *next;
unsigned int start, end;
};
void *f();
void
foo (struct link_map **array, long int cnt)
{
struct link_map *l;
const void *caller =f();
long int ns = 0;
for (l = array[cnt]; l; l = l->next)
{
if (caller >= (const void *) l->start
&& caller < (const void *) l->end)
ns = cnt;
}
for (l = array[ns]; l != 0; l = l->next)
;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] [4.1 Regression] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
` (6 preceding siblings ...)
2005-04-14 14:54 ` pinskia at gcc dot gnu dot org
@ 2005-04-14 14:56 ` kazu at cs dot umass dot edu
2005-04-14 15:52 ` kazu at cs dot umass dot edu
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-14 14:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kazu at cs dot umass dot edu 2005-04-14 14:56 -------
Reduced down to:
extern void *bar (void);
int
foo (unsigned int *p, unsigned int *q)
{
const void *r = bar ();
if (r >= (const void *) *p
&& r < (const void *) *q)
return 1;
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] [4.1 Regression] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
` (7 preceding siblings ...)
2005-04-14 14:56 ` kazu at cs dot umass dot edu
@ 2005-04-14 15:52 ` kazu at cs dot umass dot edu
2005-04-14 16:19 ` kazu at cs dot umass dot edu
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-14 15:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kazu at cs dot umass dot edu 2005-04-14 15:51 -------
Before VRP (even before ASSERT_EXPR insertion), we have
const void * r;
unsigned int D.1157;
void * D.1156;
:
:
if (r_3 >= D.1157_5) goto <L0>; else goto <L5>;
Note that we already have a type-mismatched comparison - an integer
v.s. a pointer.
tree-vrp.c:maybe_add_assert_expr inserts the following ASSERT_EXPR in
the "else" branch of the "if" statement.
r_14 = ASSERT_EXPR <r_3, r_3 < D.1157_5>;
Eventually the propagation engine visits this ASSERT_EXPR with a call
tree like so.
simulate_stmt
vrp_visit_stmt
vrp_visit_assignment
extract_range_from_expr
extract_range_from_assert (ASSERT_EXPR <r_3, r_3 < D.1157_5>)
value_ranges_intersect_p ([D.1156_2, D.1156_2], [0, D.1157_5 - 1])
value_inside_range (D.1157_5 - 1, [D.1156_2, D.1156_2])
compare_values (D.1157_5 - 1, D.1156_2)
compare_values does some limited symbolic comparisons. In this case,
it checks whether D.1156_2 == INF so that if that's the case, we can
deduce that
D.1157_5 - 1 < D.1156_2
But we cannot compute TYPE_MAX_VALUE (TREE_TYPE (D.1156_2)) because
D.1156_2 is of a pointer type, causing the ICE.
The root cause of the problem is that we have a type-mismatched
comparison.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] [4.1 Regression] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
` (8 preceding siblings ...)
2005-04-14 15:52 ` kazu at cs dot umass dot edu
@ 2005-04-14 16:19 ` kazu at cs dot umass dot edu
2005-04-14 23:07 ` kazu at cs dot umass dot edu
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-14 16:19 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |21024
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] [4.1 Regression] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
` (9 preceding siblings ...)
2005-04-14 16:19 ` kazu at cs dot umass dot edu
@ 2005-04-14 23:07 ` kazu at cs dot umass dot edu
2005-04-15 1:29 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-14 23:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kazu at cs dot umass dot edu 2005-04-14 23:07 -------
Patch posted:
http://gcc.gnu.org/ml/gcc-patches/2005-04/msg01668.html
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |dnovillo at gcc dot gnu dot
| |org
AssignedTo|dnovillo at gcc dot gnu dot |kazu at cs dot umass dot edu
|org |
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] [4.1 Regression] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
` (10 preceding siblings ...)
2005-04-14 23:07 ` kazu at cs dot umass dot edu
@ 2005-04-15 1:29 ` cvs-commit at gcc dot gnu dot org
2005-04-15 1:31 ` kazu at cs dot umass dot edu
2005-04-17 1:41 ` kazu at cs dot umass dot edu
13 siblings, 0 replies; 15+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-04-15 1:29 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-04-15 01:29 -------
Subject: Bug 21021
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: kazu@gcc.gnu.org 2005-04-15 01:29:44
Modified files:
gcc : ChangeLog tree-vrp.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.c-torture/compile: pr21021.c
Log message:
gcc/
PR tree-optimization/21021
* tree-vrp.c (compare_values): Work around a bug in the front
end that produces a comparison of mismatched types.
testsuite/
PR tree-optimization/21021
* gcc.c-torture/compile/pr21021.c: New.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8297&r2=2.8298
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-vrp.c.diff?cvsroot=gcc&r1=2.7&r2=2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5350&r2=1.5351
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr21021.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] [4.1 Regression] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
` (11 preceding siblings ...)
2005-04-15 1:29 ` cvs-commit at gcc dot gnu dot org
@ 2005-04-15 1:31 ` kazu at cs dot umass dot edu
2005-04-17 1:41 ` kazu at cs dot umass dot edu
13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-15 1:31 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From kazu at cs dot umass dot edu 2005-04-15 01:31 -------
Just checked in a workaround patch.
For a real fix, keep an eye on PR 21024.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Bug tree-optimization/21021] [4.1 Regression] ICE in tree-vrp building glibc
2005-04-14 13:32 [Bug tree-optimization/21021] New: ICE in tree-vrp building glibc drow at gcc dot gnu dot org
` (12 preceding siblings ...)
2005-04-15 1:31 ` kazu at cs dot umass dot edu
@ 2005-04-17 1:41 ` kazu at cs dot umass dot edu
13 siblings, 0 replies; 15+ messages in thread
From: kazu at cs dot umass dot edu @ 2005-04-17 1:41 UTC (permalink / raw)
To: gcc-bugs
--
Bug 21021 depends on bug 21024, which changed state.
Bug 21024 Summary: fold generates a comparison of two operands whose types do not match
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21024
What |Old Value |New Value
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21021
^ permalink raw reply [flat|nested] 15+ messages in thread