public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2
@ 2011-08-11 21:50 sigurdkn at gmail dot com
  2011-08-12 11:45 ` [Bug fortran/50050] " mikael at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: sigurdkn at gmail dot com @ 2011-08-11 21:50 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50050
           Summary: Internal compiler error free_expr0 at expr.c:3709 via
                    gfc_done_2
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: sigurdkn@gmail.com


Created attachment 24988
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24988
Trigger bug with "gfortran bug.f90"

The attached minimal program triggers an internal compiler bug in all versions
of gfortran I have encountered. That includes

GNU Fortran (GCC) 4.7.0 20110811 (experimental) - linux 2.6.32-33 - ubuntu
GNU Fortran (GCC) 4.7.0 20110713 (experimental) - linux 2.6.18-238 - red hat 5
GNU Fortran (GCC) 4.6.0 - linux 2.6.32-33 - ubuntu
GNU Fortran (Gentoo 4.5.3 p1.0, pie-0.4.5) 4.5.3
GNU Fortran (GCC) 4.5.3 - macosx
GNU Fortran (Ubuntu 4.4.3-4ubuntu5) 4.4.3

To trigger the bug, simply do

  gfortran bug.f90

Optimization level and other options do not seem to matter (but I have not
tried all). Note that many of the strange details in bug.f90 are necessary to
trigger the bug. For example, one of the indices of data must be a range while
the other must be a number. The => null() part is also necessary. And the array
must have at least two dimensions.

The different compilers involved where configured differently and built on
different systems, so I do not think the configuration matters much. But here
is the configuration from 4.7.0 20110811:

 sigurdkn@kaguya:~/code$ ~/local/gcc-build-debug/gcc/gfortran -v
 Using built-in specs.
 COLLECT_GCC=/home/sigurdkn/local/gcc-build-debug/gcc/gfortran
 Target: x86_64-unknown-linux-gnu
 Configured with: /home/sigurdkn/local/gcc-svn/configure
--prefix=/home/sigurdkn /local --program-suffix=-dbg
--enable-stage1-languages=c,fortran,c++
 Thread model: posix
 gcc version 4.7.0 20110811 (experimental) (GCC) 

Here is a stack trace from 4.7.0 20110811:

#0  *__GI___libc_free (mem=0x61) at malloc.c:3709
#1  0x00000000004bb5f5 in free_expr0 (e=0x1adca70)
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/expr.c:479
#2  0x00000000004bb6d2 in gfc_free_expr (e=0x1adca70)
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/expr.c:497
#3  0x0000000000544f42 in gfc_free_statement (p=0x1adc9a0)
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/st.c:84
#4  0x000000000054515c in gfc_free_statements (p=0x1adc9a0)
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/st.c:233
#5  0x000000000054c238 in gfc_free_namespace (ns=0x1ad8d30)
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/symbol.c:3246
#6  0x000000000054c3d2 in gfc_symbol_done_2 ()
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/symbol.c:3291
#7  0x00000000004f9347 in gfc_done_2 ()
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/misc.c:266
#8  0x000000000050f951 in translate_all_program_units
(gfc_global_ns_list=0x1ad8d30, 
    main_in_tu=1 '\001') at
/home/sigurdkn/local/gcc-svn/gcc/fortran/parse.c:4334
#9  0x000000000050fecc in gfc_parse_file ()
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/parse.c:4528
#10 0x0000000000555245 in gfc_be_parse_file ()
    at /home/sigurdkn/local/gcc-svn/gcc/fortran/f95-lang.c:250
#11 0x0000000000b36e7e in compile_file ()
    at /home/sigurdkn/local/gcc-svn/gcc/toplev.c:548
#12 0x0000000000b39107 in do_compile () at
/home/sigurdkn/local/gcc-svn/gcc/toplev.c:1886
#13 0x0000000000b39277 in toplev_main (argc=2, argv=0x7fffffffe578)
    at /home/sigurdkn/local/gcc-svn/gcc/toplev.c:1962
#14 0x00000000006099a0 in main (argc=2, argv=0x7fffffffe578)
    at /home/sigurdkn/local/gcc-svn/gcc/main.c:36


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2011-09-01 19:46 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-11 21:50 [Bug fortran/50050] New: Internal compiler error free_expr0 at expr.c:3709 via gfc_done_2 sigurdkn at gmail dot com
2011-08-12 11:45 ` [Bug fortran/50050] " mikael at gcc dot gnu.org
2011-08-12 12:19 ` mikael at gcc dot gnu.org
2011-08-12 12:47 ` mikael at gcc dot gnu.org
2011-08-20 14:55 ` mikael at gcc dot gnu.org
2011-08-22 14:27 ` mikael at gcc dot gnu.org
2011-08-22 20:29 ` mikael at gcc dot gnu.org
2011-08-23 20:10 ` abenson at caltech dot edu
2011-08-23 20:13 ` janus at gcc dot gnu.org
2011-08-23 21:14 ` [Bug fortran/50050] [4.6/4.7 Regression] " burnus at gcc dot gnu.org
2011-08-24  6:13 ` jpr at csc dot fi
2011-08-24 17:15 ` jakub at gcc dot gnu.org
2011-08-25  9:18 ` burnus at gcc dot gnu.org
2011-08-25 20:10 ` mikael at gcc dot gnu.org
2011-08-26 22:34 ` mikael at gcc dot gnu.org
2011-08-30 15:06 ` [Bug fortran/50050] " burnus at gcc dot gnu.org
2011-09-01 15:54 ` mikael at gcc dot gnu.org
2011-09-01 19:20 ` mikael at gcc dot gnu.org
2011-09-01 19:46 ` mikael at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).