Source is at

http://www.netlib.org/lapack/testing/eig/schkee.f

(sorry, I haven't been able to cook up a simpler test case so far).

This only happens with -O.

$ gfortran -v
Reading specs from /home/zfkts/lib/gcc/ia64-unknown-linux-gnu/4.0.0/specs
Configured with: ../gcc-4.0-20041114/configure --prefix=/home/zfkts
--enable-languages=c,c++,f95
Thread model: posix
gcc version 4.0.0 20041114 (experimental)
$ gdb ~/libexec/gcc/ia64-unknown-linux-gnu/4.0.0/f951
GNU gdb Red Hat Linux (6.1post-1.20040607.17rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "ia64-redhat-linux-gnu"...Using host libthread_db
library "/lib/tls/libthread_db.so.1".

(gdb) r -O schkee.f
Starting program: /home/zfkts/libexec/gcc/ia64-unknown-linux-gnu/4.0.0/f951 -O
schkee.f
 MAIN__
 {GC 9564k -> 8477k}
Program received signal SIGSEGV, Segmentation fault.
operand_equal_p (arg0=0x200000000293d130, arg1=0x2000000002aeff20, flags=0)
    at ../../gcc-4.0-20041114/gcc/fold-const.c:2342
2342      if (TYPE_UNSIGNED (TREE_TYPE (arg0)) != TYPE_UNSIGNED (TREE_TYPE 
(arg1)))
(gdb) bt
#0  operand_equal_p (arg0=0x200000000293d130, arg1=0x2000000002aeff20, flags=0)
    at ../../gcc-4.0-20041114/gcc/fold-const.c:2342
#1  0x4000000000120860 in thread_jumps () at tree-flow-inline.h:306
#2  0x4000000000121e60 in cleanup_tree_cfg ()
    at ../../gcc-4.0-20041114/gcc/tree-cfg.c:872
#3  0x40000000001ab3f0 in perform_tree_ssa_dce (aggressive=51 '3')
    at ../../gcc-4.0-20041114/gcc/tree-ssa-dce.c:954
#4  0x400000000014c530 in execute_pass_list (pass=0x600000000000ced0)
    at ../../gcc-4.0-20041114/gcc/tree-optimize.c:508
#5  0x400000000014c1d0 in execute_pass_list (pass=0x600000000000b7c8)
    at ../../gcc-4.0-20041114/gcc/tree-optimize.c:546
#6  0x400000000014d490 in tree_rest_of_compilation (fndecl=0x2000000002586300)
    at ../../gcc-4.0-20041114/gcc/tree-optimize.c:640
#7  0x40000000000a9860 in gfc_expand_function (fndecl=0x2000000002586300)
    at ../../gcc-4.0-20041114/gcc/fortran/f95-lang.c:200
#8  0x40000000006e53a0 in cgraph_expand_function (node=0x20000000026d4700)
    at ../../gcc-4.0-20041114/gcc/cgraphunit.c:822
#9  0x40000000006e5750 in cgraph_assemble_pending_functions ()
    at ../../gcc-4.0-20041114/gcc/cgraphunit.c:305
#10 0x40000000006e69b0 in cgraph_finalize_function (decl=0x2000000002586300,
    nested=0 '\0') at ../../gcc-4.0-20041114/gcc/cgraphunit.c:388
#11 0x40000000000d48a0 in gfc_generate_function_code (ns=0x60000000000f5d20)
    at ../../gcc-4.0-20041114/gcc/fortran/trans-decl.c:2299
---Type <return> to continue, or q <return> to quit---
#12 0x40000000000b4a90 in gfc_generate_code (ns=0x60000000000f5d20)
    at ../../gcc-4.0-20041114/gcc/fortran/trans.c:679
#13 0x4000000000078ed0 in gfc_parse_file ()
    at ../../gcc-4.0-20041114/gcc/fortran/parse.c:2628
#14 0x40000000000ac6b0 in gfc_be_parse_file (set_yydebug=-27344)
    at ../../gcc-4.0-20041114/gcc/fortran/f95-lang.c:266
#15 0x4000000000642510 in toplev_main (argc=Variable "argc" is not available.
)
    at ../../gcc-4.0-20041114/gcc/toplev.c:985
#16 0x4000000000104e40 in main (argc=3, argv=0x60000fffffff99b8)
    at ../../gcc-4.0-20041114/gcc/main.c:35

-- 
           Summary: segfault compiling schkee.f from LAPACK with -O
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Thomas dot Koenig at online dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: ia64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18609

Reply via email to