Bug 16954 - [4.0 Regression] ICE in get_tmt_for with IMA and incomplete structs
[4.0 Regression] ICE in get_tmt_for with IMA and incomplete structs
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: tree-optimization
4.0.0
: P2 critical
: 4.0.0
Assigned To: Andrew Pinski
: alias, ice-checking, ice-on-valid-code, patch
Depends on:
Blocks: 17662
  Show dependency treegraph
 
Reported: 2004-08-10 01:08 UTC by Andrew Pinski
Modified: 2004-09-24 17:39 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-08-10 13:15:24


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2004-08-10 01:08:26 UTC
$ more aa.c
struct x;
foo(struct x* q)
{
    bar(q);
}

 $ more bb.c
struct x { int a; int b; };
bar(struct x* p) {
  printf("%d\n", p->a);
}

gcc bb.c aa.c -O3 -combine -S

This breaks mesa compiling IMA.
Comment 1 Wolfgang Bangerth 2004-08-10 13:15:20 UTC
Confirmed: 
 
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/gcc -O3 -combine -c *.c 
aa.c: In function `bar': 
aa.c:3: warning: incompatible implicit declaration of built-in function 
'printf' 
aa.c: In function `foo': 
aa.c:3: internal compiler error: in get_tmt_for, at tree-ssa-alias.c:2188 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
Comment 3 Andrew Pinski 2004-08-11 15:23:59 UTC
Note that may_propagate_copy uses alias_sets_conflict_p to check to see if we able to propagate the 
copy which is different from the check in get_tmt_for.
Comment 4 Diego Novillo 2004-08-11 15:35:13 UTC
Subject: Re:  [3.5 Regression] ICE in
	get_tmt_for with IMA and incomplete structs

On Wed, 2004-08-11 at 11:24, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-08-11 15:23 -------
> Note that may_propagate_copy uses alias_sets_conflict_p to check to see if we able to propagate the 
> copy which is different from the check in get_tmt_for.
>
Hmm, this triggers a memory, but I can't remember the exact details
now.  Thanks.


Diego.

Comment 5 Andrew Pinski 2004-08-11 19:00:16 UTC
> Subject: Re:  [3.5 Regression] ICE in
>         get_tmt_for with IMA and incomplete structs
>
> Hmm, this triggers a memory, but I can't remember the exact details
> now.  Thanks.

http://gcc.gnu.org/ml/gcc-patches/2003-09/msg01112.html
Comment 6 Andrew Pinski 2004-08-11 19:02:45 UTC
Another link: <http://gcc.gnu.org/ml/gcc-patches/2004-07/msg02217.html>.
Comment 7 Andrew Pinski 2004-08-11 19:44:28 UTC
I have a fix and I posted it: <http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00680.html>.  The 
problem was nothing to do with DOM or may_propagate_copy at all but it had to do with copyrename 
doing a rename which it should not have been doing.
Comment 8 Andrew Pinski 2004-09-24 14:52:02 UTC
Newest patch here: <http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02534.html> which I will apply 
in about 2 hours after class.
Comment 9 CVS Commits 2004-09-24 17:38:46 UTC
Subject: Bug 16954

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2004-09-24 17:38:38

Modified files:
	gcc            : ChangeLog tree-ssa-copyrename.c 

Log message:
	2004-09-24  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR tree-opt/16954
	* tree-ssa-copyrename.c (copy_rename_partition_coalesce):
	Prevent renaming if the aliasing sets of the type which the
	pointer points to are different.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5604&r2=2.5605
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-copyrename.c.diff?cvsroot=gcc&r1=2.16&r2=2.17

Comment 10 Andrew Pinski 2004-09-24 17:39:56 UTC
Fixed.  Will file a bug for requesting a testsuite for IMA testcases.