Bug 16705 - [4.0 Regression] [testcase] ICE in verify_flow_insensitive_alias_info
Summary: [4.0 Regression] [testcase] ICE in verify_flow_insensitive_alias_info
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.0.0
: P2 minor
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-07-25 14:26 UTC by Erik Schnetter
Modified: 2004-09-13 14:15 UTC (History)
4 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2004-07-28 06:04:39


Attachments
failing source code (8.13 KB, text/plain)
2004-07-25 14:26 UTC, Erik Schnetter
Details
shorter testcase (154 bytes, text/plain)
2004-07-28 13:42 UTC, Volker Reichelt
Details
fortran 77 testcase (103 bytes, text/plain)
2004-07-28 13:59 UTC, Volker Reichelt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Schnetter 2004-07-25 14:26:01 UTC
I receive an ICE for the attached Fortran source code.  I use 
 
$ /home/eschnett/gcc/bin/gfortran --version 
GNU Fortran 95 (GCC 3.5.0 20040724 (experimental)) 
 
with the options 
 
$ /home/eschnett/gcc/bin/gfortran -march=pentium4 -malign-double -g3 -O3 
-funroll-loops -Wall -Wshadow -c ih_interpolate.f90  
ih_interpolate.f90: In function `ih_interpolate': 
ih_interpolate.f90:0: error: Non-addressable variable inside an alias set. 
.GLOBAL_VAR, UID 3370, is an alias tag, is static, call clobbered, default 
def: .GLOBAL_VAR_5147 
TMT.3890, UID 3154, is an alias tag, is global, call clobbered, default def: 
TMT.3890_5164, may aliases: { .GLOBAL_VAR } 
ih_interpolate.f90:0: internal compiler error: 
verify_flow_insensitive_alias_info failed.
Comment 1 Erik Schnetter 2004-07-25 14:26:39 UTC
Created attachment 6825 [details]
failing source code
Comment 2 Andrew Pinski 2004-07-25 17:00:01 UTC
This is most likely the same as Ada bootstrap failure too.
Comment 3 Andrew Pinski 2004-07-27 06:20:04 UTC
I see this with a fortran to C compiler for SPEC CPU 2000FP code.
Can you please look into this bug, Diego?
Comment 4 Diego Novillo 2004-07-28 04:36:45 UTC
Subject: Re:  ICE in
	verify_flow_insensitive_alias_info

On Tue, 2004-07-27 at 02:20, pinskia at gcc dot gnu dot org wrote:

> I see this with a fortran to C compiler for SPEC CPU 2000FP code.
> Can you please look into this bug, Diego?
>
This patches fixes this problem.  Essentially, we should always consider
.GLOBAL_VAR as potentially aliased.  This may have been related to the
Ada bootstrap problems.  Kenner, could you check?  Thanks.

I'm not quite sure whether this test can be added as-is to the fortran
testsuite.  Could anyone confirm if I can just drop it in gfortran.dg? 
How should I change the compile flags used?

Bootstrapped and tested x86 and ppc.


Diego.

	PR tree-optimization/16705
	* tree-ssa-alias.c (create_global_var): Set DECL_EXTERNAL on
	.GLOBAL_VAR.


Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.17
diff -d -c -p -r2.17 tree-ssa-alias.c
*** tree-ssa-alias.c	27 Jul 2004 15:32:44 -0000	2.17
--- tree-ssa-alias.c	28 Jul 2004 04:15:26 -0000
*************** create_global_var (void)
*** 2202,2208 ****
                             size_type_node);
    DECL_ARTIFICIAL (global_var) = 1;
    TREE_READONLY (global_var) = 0;
!   DECL_EXTERNAL (global_var) = 0;
    TREE_STATIC (global_var) = 1;
    TREE_USED (global_var) = 1;
    DECL_CONTEXT (global_var) = NULL_TREE;
--- 2205,2211 ----
                             size_type_node);
    DECL_ARTIFICIAL (global_var) = 1;
    TREE_READONLY (global_var) = 0;
!   DECL_EXTERNAL (global_var) = 1;
    TREE_STATIC (global_var) = 1;
    TREE_USED (global_var) = 1;
    DECL_CONTEXT (global_var) = NULL_TREE;


Comment 5 GCC Commits 2004-07-28 04:53:27 UTC
Subject: Bug 16705

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	dnovillo@gcc.gnu.org	2004-07-28 04:53:24

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

Log message:
	PR tree-optimization/16705
	* tree-ssa-alias.c (create_global_var): Set DECL_EXTERNAL on
	.GLOBAL_VAR.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4716&r2=2.4717
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-alias.c.diff?cvsroot=gcc&r1=2.17&r2=2.18

Comment 6 Andrew Pinski 2004-07-28 06:04:39 UTC
Confirmed, just waiting for the testcase.
Comment 7 Volker Reichelt 2004-07-28 13:42:24 UTC
Created attachment 6844 [details]
shorter testcase

Here's a shorter testcase that might be included in the testsuite.
Just compile with -O2.
Comment 8 Volker Reichelt 2004-07-28 13:59:51 UTC
Created attachment 6845 [details]
fortran 77 testcase

Here's an even simpler testcase that is also valid fortran 77.
Comment 9 Andrew Pinski 2004-08-03 05:55:38 UTC
Closing as fixed.