Bug 37251 - [4.4 Regression] ICE with ira: delete_allocno_from_bucket
Summary: [4.4 Regression] ICE with ira: delete_allocno_from_bucket
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Not yet assigned to anyone
Keywords: ice-on-valid-code
Depends on:
Blocks: 29975
  Show dependency treegraph
Reported: 2008-08-27 06:25 UTC by Joost VandeVondele
Modified: 2008-10-10 08:25 UTC (History)
3 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2008-08-28 08:15:19

testcase (124.21 KB, application/octet-stream)
2008-08-27 06:26 UTC, Joost VandeVondele
shorter Fortran only testcase (32.50 KB, text/plain)
2008-08-27 07:45 UTC, Joost VandeVondele

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2008-08-27 06:25:06 UTC
The following triggered with CP2K:

gfortran -v -c -O3 -ffast-math -funroll-loops -ftree-vectorize -march=native xc_xbecke88_lr_adiabatic.f90
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /data/vondele/gcc_bench/gcc_trunk/gcc/configure --prefix=/data/vondele/gcc_bench/gcc_trunk/build --enable-languages=c,fortran
Thread model: posix
gcc version 4.4.0 20080826 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-c' '-O3' '-ffast-math' '-funroll-loops' '-ftree-vectorize'
 /data/vondele/gcc_bench/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.4.0/f951 xc_xbecke88_lr_adiabatic.f90 -march=core2 -mcx16 -msahf --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096 -mtune=core2 -quiet -dumpbase xc_xbecke88_lr_adiabatic.f90 -auxbase xc_xbecke88_lr_adiabatic -O3 -version -ffast-math -funroll-loops -ftree-vectorize -fintrinsic-modules-path /data/vondele/gcc_bench/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.4.0/finclude -o /tmp/cci09Vqi.s
GNU Fortran (GCC) version 4.4.0 20080826 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.4.0 20080826 (experimental), GMP version 4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
xc_xbecke88_lr_adiabatic.f90: In function ‘xb88_lr_adiabatic_lda_calc’:
xc_xbecke88_lr_adiabatic.f90:492: internal compiler error: in delete_allocno_from_bucket, at ira-color.c:619

testcase to be attached. Using -march=opteron (which I used to test the ira branch) is enough to avoid it, so the -march=xxx and so on parameters are relevant.

Full sources can be downloaded:
Comment 1 Joost VandeVondele 2008-08-27 06:26:38 UTC
Created attachment 16153 [details]
Comment 2 Joost VandeVondele 2008-08-27 07:45:15 UTC
Created attachment 16154 [details]
shorter Fortran only testcase

gfortran -v -c -O3 -ffast-math -funroll-loops -ftree-vectorize -march=native bug_PR37251.f90
Comment 3 Joost VandeVondele 2008-08-27 07:53:02 UTC
This is the minimal command line to reproduce the bug:

gfortran  -c -O1 -ffast-math -march=core2  bug_PR37251.f90

Comment 4 Dominique d'Humieres 2008-08-27 07:59:33 UTC
Confirmed on i686-apple-darwin9 for the code in comment #3. -O2 is sufficient to trigger the ICE

[ibook-dhum] f90/bug% gfc -O2 pr37251.f90
pr37251.f90: In function 'xb88_lr_adiabatic_lda_calc':
pr37251.f90:216: internal compiler error: in delete_allocno_from_bucket, at ira-color.c:619

Comment 5 Vladimir Makarov 2008-08-27 21:59:40 UTC
  The problem occurs when a region and its nested region have more 4000 uncolorable allocnos.  In this case splay tree is used to deal with the uncolorable allocnos.  Part of uncolorable_allocnos is temporarily stored in an array which is not truncated after region coloring and allocnos in the array are put into the splay tree in its subregion.

The patch solving the problem will be sent soon.
Comment 6 Joost VandeVondele 2008-08-28 08:15:18 UTC
(In reply to comment #5)
> The patch solving the problem will be sent soon.
The patch you posted fixes the build of CP2K. Benchmark results will appear:


the night after it hits trunk.
Comment 7 Vladimir Makarov 2008-08-29 16:19:33 UTC
Subject: Bug 37251

Author: vmakarov
Date: Fri Aug 29 16:18:11 2008
New Revision: 139770

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139770
2008-08-29  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-opt/37251

	* ira-color.c (push_allocnos_to_stack): Truncate


Comment 8 hjl@gcc.gnu.org 2008-09-02 18:17:43 UTC
Subject: Bug 37251

Author: hjl
Date: Tue Sep  2 18:16:24 2008
New Revision: 139900

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=139900
2008-09-02  H.J. Lu  <hongjiu.lu@intel.com>

	Backport from mainline:
	2008-09-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* ira.c (setup_eliminable_regset): Only declare i if ELIMINABLE_REGS is

	2008-08-29  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-opt/37251
	* ira-color.c (push_allocnos_to_stack): Truncate

	2008-08-29  Vladimir Makarov  <vmakarov@redhat.com>

	PR rtl-opt/37243
	* ira-color (ira_fast_allocation): Don't assign hard registers to
	global allocnos.


Comment 9 Joost VandeVondele 2008-09-06 09:09:59 UTC
I believe this bug should be closed ? Or do you still want to add the testcase to mainline?
Comment 10 Jakub Jelinek 2008-10-10 08:25:49 UTC
Let's close this...