public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/60450] New: ICE with SHAPE intrinsic
@ 2014-03-06 21:24 dave.allured at noaa dot gov
  2014-03-07 14:13 ` [Bug fortran/60450] [4.7/4.8 Regression] " janus at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: dave.allured at noaa dot gov @ 2014-03-06 21:24 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60450
           Summary: ICE with SHAPE intrinsic
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dave.allured at noaa dot gov

Created attachment 32293
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32293&action=edit
Backtrace and crash dump for shape-bug.2.f90

linux64:~/temp/shape-bug 230> cat shape-bug.2.f90

program shape_bug
  integer dims(2)
  real, allocatable :: x(:,:,:)
  allocate (x(3,5,2))
  x = 99.0
  dims = shape (sum (x, 2) / 10.0)
  print *, 'shape = ', dims
end program shape_bug

linux64:~/temp/shape-bug 231> gfortran -Wall -Wextra shape-bug.2.f90

*** glibc detected ***
/usr/local/gcc-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/f951: double free
or corruption (out): 0x0000000001da17d0 ***
======= Backtrace: =========
/lib64/libc.so.6[0x31fd876166]
/lib64/libc.so.6[0x31fd878c93]
/usr/local/gcc-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/f951(_Z15gfc_clear_shapePA1_12__mpz_structi+0x1f)[0x4f93af]
/usr/local/gcc-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/f951(_Z18gfc_simplify_shapeP8gfc_exprS0_+0x202)[0x563962]
/usr/local/gcc-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/f951[0x505552]
/usr/local/gcc-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/f951(_Z28gfc_intrinsic_func_interfaceP8gfc_expri+0x1c0)[0x5069c0]
/usr/local/gcc-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/f951(_Z16gfc_resolve_exprP8gfc_expr+0x1968)[0x54b828]

<snip>

See attachment for full crash dump.

There are obvious workarounds by decomposing the nested expression into
multiple statements.

Here is compiler and platform identification:

linux64:~/temp/shape-bug 240> gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /usr/local/src/gcc-4.8.2/configure
--with-gmp=/usr/local/gcc-4.8 --with-mpfr=/usr/local/gcc-4.8
--with-mpc=/usr/local/gcc-4.8 --prefix=/usr/local/gcc-4.8 --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-lto
--enable-languages=c,c++,fortran --disable-multilib --disable-bootstrap
--disable-install-libiberty --with-system-zlib
Thread model: posix
gcc version 4.8.2 (GCC) 

linux64:~/temp/shape-bug 241> uname -a
Linux linux64.psd.esrl.noaa.gov 2.6.32-431.5.1.el6.x86_64 #1 SMP Fri Jan 10
14:46:43 EST 2014 x86_64 GNU/Linux

----------------------------------------------------------------------

This also fails with the same gfortran version 4.8.2 on Mac OS:

mac56:/home/dallured/temp/shape-bug 7> gfortran -Wall -Wextra shape-bug.2.f90 
f951(58275) malloc: *** error for object 0x141618cd0: pointer being freed was
not allocated
*** set a breakpoint in malloc_error_break to debug
f951: internal compiler error: Abort trap: 6
gfortran: internal compiler error: Abort trap: 6 (program f951)
Abort

Note: On the Mac version, no lengthy crash log, I don't know why.

mac56:/home/dallured/temp/shape-bug 8> gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin12/4.8.2/lto-wrapper
Target: x86_64-apple-darwin12
Configured with:
/opt/local/var/macports/build/_opt_mports_dports_lang_gcc48/gcc48/work/gcc-4.8.2/configure
--prefix=/opt/local --build=x86_64-apple-darwin12
--enable-languages=c,c++,objc,obj-c++,lto,fortran,java
--libdir=/opt/local/lib/gcc48 --includedir=/opt/local/include/gcc48
--infodir=/opt/local/share/info --mandir=/opt/local/share/man
--datarootdir=/opt/local/share/gcc-4.8 --with-local-prefix=/opt/local
--with-system-zlib --disable-nls --program-suffix=-mp-4.8
--with-gxx-include-dir=/opt/local/include/gcc48/c++/ --with-gmp=/opt/local
--with-mpfr=/opt/local --with-mpc=/opt/local --with-cloog=/opt/local
--enable-cloog-backend=isl --disable-cloog-version-check
--enable-stage1-checking --disable-multilib --enable-lto
--enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld
--with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket
--with-pkgversion='MacPorts gcc48 4.8.2_0'
Thread model: posix
gcc version 4.8.2 (MacPorts gcc48 4.8.2_0) 

Thanks for looking into this.


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

end of thread, other threads:[~2014-03-09 19:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-06 21:24 [Bug fortran/60450] New: ICE with SHAPE intrinsic dave.allured at noaa dot gov
2014-03-07 14:13 ` [Bug fortran/60450] [4.7/4.8 Regression] " janus at gcc dot gnu.org
2014-03-07 14:36 ` janus at gcc dot gnu.org
2014-03-07 14:42 ` janus at gcc dot gnu.org
2014-03-07 18:24 ` janus at gcc dot gnu.org
2014-03-07 22:25 ` dave.allured at noaa dot gov
2014-03-08 13:59 ` janus at gcc dot gnu.org
2014-03-08 14:05 ` janus at gcc dot gnu.org
2014-03-09 18:25 ` dave.allured at noaa dot gov
2014-03-09 18:45 ` janus at gcc dot gnu.org
2014-03-09 19:01 ` janus at gcc dot gnu.org
2014-03-09 19:06 ` janus at gcc dot gnu.org
2014-03-09 19:40 ` dave.allured at noaa dot gov

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).