Bug 58484 - [4.9 Regression] ICE in chrec_fold_plus_1, at tree-chrec.c:272 building 416.gamess
Summary: [4.9 Regression] ICE in chrec_fold_plus_1, at tree-chrec.c:272 building 416.g...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks: 58417
  Show dependency treegraph
 
Reported: 2013-09-20 12:07 UTC by Richard Biener
Modified: 2013-09-20 17:50 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-09-20 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2013-09-20 12:07:14 UTC
> ./f951 -quiet mp2.fppized.f -O2
mp2.fppized.f: In function 'umpse':
mp2.fppized.f:2889:0: internal compiler error: in chrec_fold_plus_1, at tree-chrec.c:272
       SUBROUTINE UMPSE(EA,AIBJ,NOC,NDIM,NOCA,NVIRA,NOCCA,IOCA,E2)
 ^
0x12b7434 chrec_fold_plus_1
        /space/rguenther/src/svn/trunk/gcc/tree-chrec.c:271
0x12b7cea chrec_fold_plus(tree_node*, tree_node*, tree_node*)
        /space/rguenther/src/svn/trunk/gcc/tree-chrec.c:373
0xcebd7b instantiate_scev_binary
        /space/rguenther/src/svn/trunk/gcc/tree-scalar-evolution.c:2347

from a quick look instantiate_scev_r for some reason doesn't do its work
properly.
Comment 1 Richard Biener 2013-09-20 12:07:31 UTC
Reducing a testcase.
Comment 2 Richard Biener 2013-09-20 12:16:54 UTC
      SUBROUTINE UMPSE(AIBJ,NOC,NDIM,NOCA,NVIRA,NOCCA,E2)
      DIMENSION AIBJ(NOC,NDIM,*)
      DO 20 MA=1,NVIRA
      DO 20 MI=1,NOCA
         DO 10 MB=1,MA
         MBI = MI+NOCA*(MB-1)
         DO 10 MJ=1,NOCCA
            DUM = AIBJ(MJ,MAI,MB)-AIBJ(MJ,MBI,MA)
            E2A = E2A-DUM
   10    CONTINUE
   20 CONTINUE
      E2  = E2+E2A
      END
Comment 3 Richard Biener 2013-09-20 12:41:29 UTC
Hm, so are we expecting that instantiate_scev_r through

static tree
instantiate_scev_binary (basic_block instantiate_below,
                         struct loop *evolution_loop, struct loop *inner_loop,
                         tree chrec, enum tree_code code,
                         tree type, tree c0, tree c1,
                         bool fold_conversions, int size_expr)
{
  tree op1;
  tree op0 = instantiate_scev_r (instantiate_below, evolution_loop, inner_loop,
                                 c0, fold_conversions, size_expr);

with evolution_loop == 2 for (integer(kind=4)) ((unsigned int) ma_28 + 4294967295)
returns {0, +, 1}_1, thus an evolution in loop 1 which is an outer loop of 2?

Ah, now that the global cache is in effect it's no longer true that
instantiated_below remains the same ... :/
Comment 4 Richard Biener 2013-09-20 17:49:47 UTC
Author: rguenth
Date: Fri Sep 20 17:49:45 2013
New Revision: 202790

URL: http://gcc.gnu.org/viewcvs?rev=202790&root=gcc&view=rev
Log:
2013-09-20  Richard Biener  <rguenther@suse.de>

	PR middle-end/58484
	* tree-scalar-evolution.c (struct scev_info_str): Shrink by
	remembering SSA name version and block index.
	(new_scev_info_str): Adjust.
	(hash_scev_info): Likewise.  Also hash the block index.
	(eq_scev_info): Adjust.
	(find_var_scev_info): Likewise.
	(struct instantiate_cache_entry): Remove.
	(struct instantiate_cache_type): Use a htab to map name, block
	to chrec.
	(instantiate_cache_type::~instantiate_cache_type): Adjust.
	(get_instantiated_value_entry): Likewise.
	(hash_idx_scev_info, eq_idx_scev_info): New functions.
	(instantiate_scev_name): Adjust.

	* gfortran.dg/pr58484.f: New testcase.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr58484.f
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-scalar-evolution.c
Comment 5 Richard Biener 2013-09-20 17:50:19 UTC
Fixed.