Bug 49494 - [4.7 Regression] ICE: in remap_predicate at ipa-inline-analysis.c:1876 with -findirect-inlining -finline-small-functions
Summary: [4.7 Regression] ICE: in remap_predicate at ipa-inline-analysis.c:1876 with -...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.7.0
: P1 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-06-21 19:17 UTC by Zdenek Sojka
Modified: 2011-08-22 08:27 UTC (History)
2 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work: 4.6.1
Known to fail: 4.7.0
Last reconfirmed: 2011-06-21 20:08:45


Attachments
reduced testcase (the same as gfortran.dg/pr49179.f90) (131 bytes, text/plain)
2011-06-21 19:17 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2011-06-21 19:17:17 UTC
Created attachment 24575 [details]
reduced testcase (the same as gfortran.dg/pr49179.f90)

Compiler output:
$ gcc -O -findirect-inlining -fno-guess-branch-probability -finline-functions -finline-small-functions testcase.f90
testcase.f90:8:0: internal compiler error: vector VEC(int,base) index domain error, in remap_predicate at ipa-inline-analysis.c:1876
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r175265 - crash
Comment 1 Dominique d'Humieres 2011-06-21 20:08:45 UTC
Revision 172608 is OK, 173763 is not. Note that the ICE is gone for versions bootstrapped with --enable-checking=release.
Comment 2 Richard Biener 2011-08-02 14:23:32 UTC
Re-confirmed.
Comment 3 Jan Hubicka 2011-08-05 15:25:34 UTC
Problem here is that more_ok is compiled into function having 4 parameters (where first parameter is return value) and it is called with 3 parameters.

My fortran fu is not on par to tell if this is expected. Originally I assumed that we won't inline this case since we will consider the call uninlinable. We however do that only on type mismatch, not on mismatch in number of parameters. Will fix that with bounds check.
Comment 4 Jan Hubicka 2011-08-05 20:56:08 UTC
Author: hubicka
Date: Fri Aug  5 20:56:05 2011
New Revision: 177484

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177484
Log:
+ 	PR middle-end/49494
+ 	* ipa-inline-analysis.c (remap_predicate): Add bounds check.
+ 	* gfortran.dg/pr49494.f90: New testcase.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr49494.f90
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-inline-analysis.c
    trunk/gcc/testsuite/ChangeLog
Comment 5 Jakub Jelinek 2011-08-22 08:27:33 UTC
Assuming this is fixed.