* [Bug tree-optimization/18291] [4.0 Regression]: ICE in merge_alias_info
2004-11-03 20:43 [Bug tree-optimization/18291] New: 4.0: ICE in merge_alias_info gcc-bugzilla at gcc dot gnu dot org
@ 2004-11-03 21:02 ` pinskia at gcc dot gnu dot org
2004-11-03 21:13 ` dnovillo at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-03 21:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-03 21:02 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org, dnovillo at gcc dot gnu
| |dot org
Severity|normal |critical
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |ice-on-valid-code
Last reconfirmed|0000-00-00 00:00:00 |2004-11-03 21:02:25
date| |
Summary|4.0: ICE in merge_alias_info|[4.0 Regression]: ICE in
| |merge_alias_info
Target Milestone|--- |4.0.0
Version|0.0 |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18291
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/18291] [4.0 Regression]: ICE in merge_alias_info
2004-11-03 20:43 [Bug tree-optimization/18291] New: 4.0: ICE in merge_alias_info gcc-bugzilla at gcc dot gnu dot org
2004-11-03 21:02 ` [Bug tree-optimization/18291] [4.0 Regression]: " pinskia at gcc dot gnu dot org
@ 2004-11-03 21:13 ` dnovillo at gcc dot gnu dot org
2004-11-06 22:13 ` reichelt at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-11-03 21:13 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |dnovillo at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18291
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/18291] [4.0 Regression]: ICE in merge_alias_info
2004-11-03 20:43 [Bug tree-optimization/18291] New: 4.0: ICE in merge_alias_info gcc-bugzilla at gcc dot gnu dot org
2004-11-03 21:02 ` [Bug tree-optimization/18291] [4.0 Regression]: " pinskia at gcc dot gnu dot org
2004-11-03 21:13 ` dnovillo at gcc dot gnu dot org
@ 2004-11-06 22:13 ` reichelt at gcc dot gnu dot org
2004-11-06 23:24 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-11-06 22:13 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-11-06 22:13 -------
Here's a C testcase:
================================
inline int foo() { return 0; }
void bar(int*);
void baz()
{
int i, j, *p = &i+1;
if (foo())
{
bar(p);
p = &j;
}
bar(p);
}
================================
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Keywords| |monitored
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18291
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/18291] [4.0 Regression]: ICE in merge_alias_info
2004-11-03 20:43 [Bug tree-optimization/18291] New: 4.0: ICE in merge_alias_info gcc-bugzilla at gcc dot gnu dot org
` (2 preceding siblings ...)
2004-11-06 22:13 ` reichelt at gcc dot gnu dot org
@ 2004-11-06 23:24 ` pinskia at gcc dot gnu dot org
2004-11-06 23:30 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-06 23:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-06 23:24 -------
Here is a C example which is not undefined:
void bar(int*);
int foo1(void);
int baz()
{
int i, j, *p = &i, k, k1 = 0;
if (foo1()) p = &j;
if (k1)
{
*p = 0 ;
p = &k;
}
bar(p);
return *p;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18291
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/18291] [4.0 Regression]: ICE in merge_alias_info
2004-11-03 20:43 [Bug tree-optimization/18291] New: 4.0: ICE in merge_alias_info gcc-bugzilla at gcc dot gnu dot org
` (3 preceding siblings ...)
2004-11-06 23:24 ` pinskia at gcc dot gnu dot org
@ 2004-11-06 23:30 ` pinskia at gcc dot gnu dot org
2004-11-26 22:11 ` dberlin at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-06 23:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-11-06 23:30 -------
One where we only depend on no extern functions:
int baz(int k2)
{
int i, j, *p, k = 1, k1 = 0;
if (k2)
p = &j;
else
p = &i;
if (k1)
*p = 0 , p = &k;
*p = 1;
return k;
}
In fact this should optimize to just return 0;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18291
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/18291] [4.0 Regression]: ICE in merge_alias_info
2004-11-03 20:43 [Bug tree-optimization/18291] New: 4.0: ICE in merge_alias_info gcc-bugzilla at gcc dot gnu dot org
` (4 preceding siblings ...)
2004-11-06 23:30 ` pinskia at gcc dot gnu dot org
@ 2004-11-26 22:11 ` dberlin at gcc dot gnu dot org
2004-11-26 22:50 ` dnovillo at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: dberlin at gcc dot gnu dot org @ 2004-11-26 22:11 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dberlin at gcc dot gnu dot org 2004-11-26 22:11 -------
The real bug here is that may_propagate_copy (op, val) returns true, but we
abort when domopts calls propagate_value with the same arguments.
We think something has gone wrong horribly wrong with regards to flow-sensitive
alias info because the block with the &k in it became dead, allowing us to copy
propagate p_1 into p_2.
However, p_2 still has the name tag that includes k (which is now gone
completely), and p_1 doesn't, because alias info hasn't been rebuilt since
CCP+DCE removed the block with &k in it.
There are a couple options, i'll leave it to diego to decide what is best:
1. Make may_propagate_copy return false (conservatively) when we are trying to
propagate and the name tags don't match. The propagation will still happen
later after alias info gets rebuilt again.
2. Allow the propagation anyway, and just choose the "best" name tag (the one
with the smallest number of pt_vars), under the assumption that we know what the
heck we are doing :)
Diego, if you are too busy, just let me know which you prefer and i'll implement it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18291
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/18291] [4.0 Regression]: ICE in merge_alias_info
2004-11-03 20:43 [Bug tree-optimization/18291] New: 4.0: ICE in merge_alias_info gcc-bugzilla at gcc dot gnu dot org
` (5 preceding siblings ...)
2004-11-26 22:11 ` dberlin at gcc dot gnu dot org
@ 2004-11-26 22:50 ` dnovillo at gcc dot gnu dot org
2004-11-26 22:53 ` Diego Novillo
2004-11-26 22:53 ` dnovillo at redhat dot com
` (2 subsequent siblings)
9 siblings, 1 reply; 12+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-11-26 22:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at gcc dot gnu dot org 2004-11-26 22:50 -------
(In reply to comment #6)
> Diego, if you are too busy, just let me know which you prefer and i'll
implement it.
>
I'll take a look, but in principle it seems to me that NMT.1 and NMT.2 should
actually be the same name tag. They have overlapping points-to sets, after all.
I'm not sure at the moment what would be the best approach.
Diego.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18291
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bug tree-optimization/18291] [4.0 Regression]: ICE in merge_alias_info
2004-11-26 22:50 ` dnovillo at gcc dot gnu dot org
@ 2004-11-26 22:53 ` Diego Novillo
0 siblings, 0 replies; 12+ messages in thread
From: Diego Novillo @ 2004-11-26 22:53 UTC (permalink / raw)
To: gcc-bugzilla; +Cc: gcc-bugs
On Fri, 2004-11-26 at 22:50 +0000, dnovillo at gcc dot gnu dot org
wrote:
> ------- Additional Comments From dnovillo at gcc dot gnu dot org 2004-11-26 22:50 -------
> (In reply to comment #6)
>
> > Diego, if you are too busy, just let me know which you prefer and i'll
> implement it.
> >
> I'll take a look, but in principle it seems to me that NMT.1 and NMT.2 should
> actually be the same name tag. They have overlapping points-to sets, after all.
> I'm not sure at the moment what would be the best approach.
>
By which, I mean:
$ cvs diff -dup tree-ssa-alias.c
Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.57
diff -d -u -p -r2.57 tree-ssa-alias.c
--- tree-ssa-alias.c 25 Nov 2004 03:54:07 -0000 2.57
+++ tree-ssa-alias.c 26 Nov 2004 22:52:46 -0000
@@ -771,7 +771,7 @@ create_name_tags (struct alias_info *ai)
if (qi
&& qi->pt_vars
&& qi->name_mem_tag
- && bitmap_equal_p (pi->pt_vars, qi->pt_vars))
+ && bitmap_intersect_p (pi->pt_vars, qi->pt_vars))
{
pi->name_mem_tag = qi->name_mem_tag;
break;
But that may be too pessimistic.
Diego.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/18291] [4.0 Regression]: ICE in merge_alias_info
2004-11-03 20:43 [Bug tree-optimization/18291] New: 4.0: ICE in merge_alias_info gcc-bugzilla at gcc dot gnu dot org
` (6 preceding siblings ...)
2004-11-26 22:50 ` dnovillo at gcc dot gnu dot org
@ 2004-11-26 22:53 ` dnovillo at redhat dot com
2004-12-01 18:54 ` cvs-commit at gcc dot gnu dot org
2004-12-01 19:19 ` dnovillo at gcc dot gnu dot org
9 siblings, 0 replies; 12+ messages in thread
From: dnovillo at redhat dot com @ 2004-11-26 22:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at redhat dot com 2004-11-26 22:53 -------
Subject: Re: [4.0 Regression]: ICE in
merge_alias_info
On Fri, 2004-11-26 at 22:50 +0000, dnovillo at gcc dot gnu dot org
wrote:
> ------- Additional Comments From dnovillo at gcc dot gnu dot org 2004-11-26 22:50 -------
> (In reply to comment #6)
>
> > Diego, if you are too busy, just let me know which you prefer and i'll
> implement it.
> >
> I'll take a look, but in principle it seems to me that NMT.1 and NMT.2 should
> actually be the same name tag. They have overlapping points-to sets, after all.
> I'm not sure at the moment what would be the best approach.
>
By which, I mean:
$ cvs diff -dup tree-ssa-alias.c
Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.57
diff -d -u -p -r2.57 tree-ssa-alias.c
--- tree-ssa-alias.c 25 Nov 2004 03:54:07 -0000 2.57
+++ tree-ssa-alias.c 26 Nov 2004 22:52:46 -0000
@@ -771,7 +771,7 @@ create_name_tags (struct alias_info *ai)
if (qi
&& qi->pt_vars
&& qi->name_mem_tag
- && bitmap_equal_p (pi->pt_vars, qi->pt_vars))
+ && bitmap_intersect_p (pi->pt_vars, qi->pt_vars))
{
pi->name_mem_tag = qi->name_mem_tag;
break;
But that may be too pessimistic.
Diego.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18291
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/18291] [4.0 Regression]: ICE in merge_alias_info
2004-11-03 20:43 [Bug tree-optimization/18291] New: 4.0: ICE in merge_alias_info gcc-bugzilla at gcc dot gnu dot org
` (7 preceding siblings ...)
2004-11-26 22:53 ` dnovillo at redhat dot com
@ 2004-12-01 18:54 ` cvs-commit at gcc dot gnu dot org
2004-12-01 19:19 ` dnovillo at gcc dot gnu dot org
9 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-01 18:54 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-12-01 18:54 -------
Subject: Bug 18291
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: dnovillo@gcc.gnu.org 2004-12-01 18:54:05
Modified files:
gcc : ChangeLog tree-ssa-copy.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.c-torture/compile: pr18291.c
Log message:
PR tree-optimization/18291
* tree-ssa-copy.c (merge_alias_info): Fix merging of
flow-sensitive alias information. If the new pointer has no
name tag, copy it from the original pointer. Otherwise, make
sure that the pointed-to sets have a common intersection.
testsuite/ChangeLog
PR tree-optimization/18291
* testsuite/gcc.c-torture/compile/pr18291.c: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6663&r2=2.6664
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-copy.c.diff?cvsroot=gcc&r1=2.20&r2=2.21
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4699&r2=1.4700
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/compile/pr18291.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18291
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug tree-optimization/18291] [4.0 Regression]: ICE in merge_alias_info
2004-11-03 20:43 [Bug tree-optimization/18291] New: 4.0: ICE in merge_alias_info gcc-bugzilla at gcc dot gnu dot org
` (8 preceding siblings ...)
2004-12-01 18:54 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-01 19:19 ` dnovillo at gcc dot gnu dot org
9 siblings, 0 replies; 12+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-12-01 19:19 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dnovillo at gcc dot gnu dot org 2004-12-01 19:19 -------
Fix: http://gcc.gnu.org/ml/gcc-patches/2004-12/msg00058.html
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18291
^ permalink raw reply [flat|nested] 12+ messages in thread