Bug 37379 - [graphite] ICE compiling aermod.f90 with -ffast-math -floop-block -O2 -fgraphite
Summary: [graphite] ICE compiling aermod.f90 with -ffast-math -floop-block -O2 -fgraphite
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Sebastian Pop
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2008-09-04 22:15 UTC by Jack Howarth
Modified: 2008-11-07 18:03 UTC (History)
2 users (show)

See Also:
Host: i686-apple-darwin9
Target: i686-apple-darwin9
Build: i686-apple-darwin9
Known to work:
Known to fail:
Last reconfirmed: 2008-11-07 05:22:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Howarth 2008-09-04 22:15:46 UTC
When compiling the aermod.f90 from the Polyhedron 2005 benchmarks with gfortran using either...

gfortran -ffast-math -floop-block -O2 -fgraphite aermod.f90

or

gfortran -ffast-math -O2 -floop-strip-mine -fgraphite aermod.f90

results in the compiler error...

aermod.f90: In function ‘vrtcbl’:
aermod.f90:14521: internal compiler error: in instantiate_scev_1, at tree-scalar-evolution.c:2220
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

This error doesn't occur when the -ffast-math flag is not used.
Comment 1 Jack Howarth 2008-09-04 22:21:24 UTC
gfortran -funsafe-loop-optimizations -floop-block -O2 -fgraphite aermod.f90

...ICEs with...

aermod.f90: In function ‘ocalc’:
aermod.f90:8312: internal compiler error: in expand_scalar_variables_expr, at graphite.c:3168
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 2 Jack Howarth 2008-09-04 22:23:54 UTC
gfortran -fno-trapping-math -floop-block -O2 -fgraphite aermod.f90

...ICEs with...

aermod.f90: In function ‘ocalc’:
aermod.f90:8312: internal compiler error: in expand_scalar_variables_expr, at graphite.c:3168
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 3 Jack Howarth 2008-09-04 22:27:11 UTC
gfortran -fno-signed-zeros -floop-block -O2 -fgraphite aermod.f90

...ICEs with...

aermod.f90: In function ‘ocalc’:
aermod.f90:8312: internal compiler error: in expand_scalar_variables_expr, at graphite.c:3168
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 4 Jack Howarth 2008-09-04 22:31:04 UTC
gfortran -fassociative-math -floop-block -O2 -fgraphite aermod.f90

...ICEs with...

aermod.f90: In function ‘ocalc’:
aermod.f90:8312: internal compiler error: in expand_scalar_variables_expr, at graphite.c:3168
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 5 Jack Howarth 2008-09-04 22:33:14 UTC
gfortran -freciprocal-math -floop-block -O2 -fgraphite aermod.f90

...ICEs with...

aermod.f90: In function ‘ocalc’:
aermod.f90:8312: internal compiler error: in expand_scalar_variables_expr, at graphite.c:3168
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 6 sebpop@gmail.com 2008-11-07 05:21:14 UTC
Subject: Re:  [graphite] ICE compiling aermod.f90 with -ffast-math -floop-block -O2 -fgraphite

Hi,

For the first part of the bug:

> aermod.f90:14521: internal compiler error: in instantiate_scev_1, at
> tree-scalar-evolution.c:2220

the bug was introduced by an automatic rewrite arount TREE_CODE_LENGTH
http://gcc.gnu.org/viewcvs?view=rev&revision=122018

The fix avoids the gcc_assert by returning "unknown scalar evolution".

The second part of the bug was already fixed:
> aermod.f90:8312: internal compiler error: in expand_scalar_variables_expr, at
> graphite.c:3168

I will apply the patch below once it finishes regstrap.

Sebastian

Index: tree-scalar-evolution.c
===================================================================
--- tree-scalar-evolution.c	(revision 141661)
+++ tree-scalar-evolution.c	(working copy)
@@ -2213,7 +2213,9 @@ instantiate_scev_1 (basic_block instanti
       break;
     }

-  gcc_assert (!VL_EXP_CLASS_P (chrec));
+  if (VL_EXP_CLASS_P (chrec))
+    return chrec_dont_know;
+
   switch (TREE_CODE_LENGTH (TREE_CODE (chrec)))
     {
     case 3:
Comment 7 Sebastian Pop 2008-11-07 18:03:36 UTC
Fixed.
Comment 8 Sebastian Pop 2008-11-07 18:04:30 UTC
Subject: Bug 37379

Author: spop
Date: Fri Nov  7 18:03:04 2008
New Revision: 141682

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141682
Log:
2008-11-07  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/37379
	* tree-scalar-evolution.c (instantiate_scev_1): Return
	chrec_dont_know for VL_EXP_CLASS_P.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-scalar-evolution.c