Bug 15585 - g77 ICE in force_nonfallthru_and_redirect
Summary: g77 ICE in force_nonfallthru_and_redirect
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-05-22 14:54 UTC by Martin Costabel
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build: powerpc-apple-darwin7.3.0
Known to work: 4.0.0
Known to fail:
Last reconfirmed:


Attachments
Example for g77 ICE (132 bytes, text/plain)
2004-05-22 14:58 UTC, Martin Costabel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Costabel 2004-05-22 14:54:04 UTC
The attached file elxxdl.f (actually, I'll attach it as soon as I find out how to attach a file here) produces 
the following output

 g77 -v -O3 -c elxxdl.f
Reading specs from /sw_current/bin/../lib/gcc/powerpc-apple-darwin7.3.0/3.4.0/specs
Configured with: ../gcc-3.4.0/configure --prefix=/sw --enable-languages=f77 --infodir=/share/info 
--libexecdir=/lib --disable-shared
Thread model: posix
gcc version 3.4.0
 /sw_current/bin/../lib/gcc/powerpc-apple-darwin7.3.0/3.4.0/f771 elxxdl.f -fPIC -quiet -dumpbase 
elxxdl.f -auxbase elxxdl -O3 -version -o /var/tmp//ccTnLrxk.s
GNU F77 version 3.4.0 (powerpc-apple-darwin7.3.0)
        compiled by GNU C version 3.4.0.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
In file included from elxxdl.f:0:
elxxdl.f:1: internal compiler error: in force_nonfallthru_and_redirect, at cfgrtl.c:1114
Please submit a full bug report,

It compiles OK with -O2 and with -Os. It produces the same ICE when compiled with
g77 -O -finline-functions -funswitch-loops
or with any -Ox option plus -finline-functions -funswitch-loops (I found these in old reports on 
problems with force_nonfallthru_and_redirect)

When compiled with g77 from
gcc version 3.4 20031015 (experimental)
it compiles OK with -O3, but produces the ICE with
g77 -O -finline-functions -funswitch-loops
Comment 1 Martin Costabel 2004-05-22 14:58:51 UTC
Created attachment 6362 [details]
Example for g77 ICE

This is a real-world example, just slightly stripped. It is a minimal example:
When one of the ENTRY..GOTO 1 blocks is removed, it compiles OK.
Comment 2 bdavis9659 2004-05-22 15:12:59 UTC
Can not reporoduce with any of the compile options listed by submitter on

i686/gnu/linux (FC1)

using GNU Fortran (GCC) 3.5.0 20040506 (experimental)


--bud davis

Comment 3 Andrew Pinski 2004-05-22 15:27:41 UTC
Fixed by the change to gfortran instead of g77 on the mainline, it produces better code for this case as 
it no longer produces the switch table which g77 did.
Comment 4 Martin Costabel 2004-05-25 07:01:02 UTC
Does this RESOLVED and FIXED mean the bug will not be looked at for g77-3.4?
As I was afraid, in g77-3.5 this bug is simply replaced by a different bug. For
the same file, I get

g77 -v -O3 -c elxxdl.f
Reading specs from
/usr/local_g77-3.5/bin/../lib/gcc/powerpc-apple-darwin7.3.0/3.5.0/specs
Configured with: ../gcc/configure --enable-threads=posix --enable-languages=f77
Thread model: posix
gcc version 3.5.0 20040429 (experimental)
 /usr/local_g77-3.5/bin/../libexec/gcc/powerpc-apple-darwin7.3.0/3.5.0/f771
elxxdl.f -fPIC -quiet -dumpbase elxxdl.f -auxbase elxxdl -O3 -version -o
/var/tmp//cc9oFxi0.s
GNU F77 version 3.5.0 20040429 (experimental) (powerpc-apple-darwin7.3.0)
        compiled by GNU C version 3.5.0 20040429 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
In file included from elxxdl.f:0:
elxxdl.f:1: error: unrecognizable insn:
(jump_insn:HI 175 138 176 0 (return) -1 (nil)
    (nil))
elxxdl.f:1: internal compiler error: in extract_insn, at recog.c:2074
Please submit a full bug report.

Is gfortran replacing the g77 bugs by again another set of bugs?
(Sorry for the sarcasm, but I had hoped for a more useful reaction on my bug
report).
Comment 5 Dara Hazeghi 2004-05-25 14:59:38 UTC
g77 is at this point dead (newer snapshots of 3.5 do not include it) and will not be updated. What Ben 
was saying was that gfortran, the only fortran compiler in current 3.5 snapshots, does compile this 
correctly. Would you mind trying a newer snapshot (gfortran was merged 2 weeks ago, or so)? Thanks.