gfortran fails to compile valid code, leads to ICE segfault, Code compiles fine under 4.1.2 . command used: gfortran -v -save-temps -c -ffree-form ice.f OUTPUT: Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.2.3/configure --prefix=/scratch/sjb/local Thread model: posix gcc version 4.2.3 /scratch/sjb/local/libexec/gcc/i686-pc-linux-gnu/4.2.3/f951 ice.f -quiet -dumpbase ice.f -mtune=generic -auxbase ice -version -ffree-form -I /scratch/sjb/local/lib/gcc/i686-pc-linux-gnu/4.2.3/finclude -o ice.s GNU F95 version 4.2.3 (i686-pc-linux-gnu) compiled by GNU C version 4.2.3. GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129260 ice.f: In function ‘subtwo’: ice.f:51: internal compiler error: in fold_convert, at fold-const.c:2248 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Created attachment 15263 [details] Testcase (reduced from proprietary code). Testcase (reduced from proprietary code).
(In reply to comment #0) > gfortran fails to compile valid code, leads to ICE segfault, Code compiles fine > under 4.1.2 . > > command used: > gfortran -v -save-temps -c -ffree-form ice.f > > OUTPUT: > > Using built-in specs. > Target: i686-pc-linux-gnu > Configured with: ../gcc-4.2.3/configure --prefix=/scratch/sjb/local > Thread model: posix > gcc version 4.2.3 > /scratch/sjb/local/libexec/gcc/i686-pc-linux-gnu/4.2.3/f951 ice.f -quiet > -dumpbase ice.f -mtune=generic -auxbase ice -version -ffree-form -I > /scratch/sjb/local/lib/gcc/i686-pc-linux-gnu/4.2.3/finclude -o ice.s > GNU F95 version 4.2.3 (i686-pc-linux-gnu) > compiled by GNU C version 4.2.3. > GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129260 > ice.f: In function ‘subtwo’: > ice.f:51: internal compiler error: in fold_convert, at fold-const.c:2248 > Please submit a full bug report, > with preprocessed source if appropriate. > See <URL:http://gcc.gnu.org/bugs.html> for instructions. > Sorry it's not a segfault (that was yesterdays problem...) as the output shows it's a problem with fold-const.c .
Works on 4.1.2 (release), trunk (20080225) and 4.3 branch (20080219), fails for 4.2.4 (20080222).
Thanks for the report. I can reproduce the problem with 4.2.3, however, it seems to be fixed in GCC/gfortran 4.3.0rc2 (and 4.4.0) - and as Daniel noted it used to worked with 4.1.3. GCC 4.3.0 is supposted to be released at the end of this week (currently, we have release candidate 2). Any chance that you could upgrade your GCC and try again? Despite being a regression, I'm not sure it will be fixed soon as we need to find the fix first. Binaries and a description how to build GCC from source can be found at http://gcc.gnu.org/wiki/GFortranBinaries Depending on your Linux distribution, they might have already experimental GCC 4.3.0 packages somewhere. Changelog: http://gcc.gnu.org/gcc-4.3/changes.html
(In reply to comment #4) > GCC 4.3.0 is supposted to be released at the end of this week (currently, we > have release candidate 2). It is actually very closer to release than the end of the week, in fact it is being uploaded to the FTP sites right now :). The official announcement will be made after some of the mirrors pick it up. -- Pinski
Simon and Tobias, (In reply to comment #4) > Thanks for the report. I can reproduce the problem with 4.2.3, however, it > seems to be fixed in GCC/gfortran 4.3.0rc2 (and 4.4.0) - and as Daniel noted it > used to worked with 4.1.3. I was responsible for much of the variability and regressions in this area. Unfortunately, in spite of our my endeavours, the testsuite did not keep track of the regressions that I was generating. I think that is OK now and that the regression in 4.2.3 was cause by fixing things that 4.1.3 did not dream about. 4.3.x and 4.4.0 are now much better. Please accept my apologies for the temporary breakage. Paul
I will dejagnuize the test case and commit it.
Subject: Bug 35475 Author: jvdelisle Date: Fri Mar 14 03:13:17 2008 New Revision: 133205 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133205 Log: 2008-03-13 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/35475 * gfortran.dg/derived_sub.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/derived_sub.f90 Modified: trunk/gcc/testsuite/ChangeLog
Woks on trunk. Test case committed to avoid future regression.