public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49023] New: ICE on invalid code with C_ASSOCIATED
@ 2011-05-17 14:10 dennis.wassel at googlemail dot com
  2011-05-18 16:55 ` [Bug fortran/49023] " burnus at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dennis.wassel at googlemail dot com @ 2011-05-17 14:10 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ICE on invalid code with C_ASSOCIATED
           Product: gcc
           Version: 4.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dennis.wassel@googlemail.com


Hi list,

when messing around with C_ASSOCIATED, I got an ICE with this bit of invalid
code using stock gfortran on Ubuntu 10.4

----------------- 8< -----------------
PROGRAM test

  USE, INTRINSIC :: iso_c_binding
  IMPLICIT NONE

  TYPE (C_PTR) :: x, y

  PRINT *, C_ASSOCIATED([x,y])  ! wrong: C_ASSOCIATED is not ELEMENTAL

END PROGRAM test
----------------- 8< -----------------

$ gfortran -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc
--disable-werror --with-arch-32=i486 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)


valgrind says

valgrind /usr/lib/gcc/x86_64-linux-gnu/4.4.3/f951 /home/uni/tmp/test.f90
-dumpbase test.f90 -mtune=generic -auxbase test -fintrinsic-modules-path
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/finclude -o /tmp/ccMioHAS.s
==1488== Memcheck, a memory error detector
==1488== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==1488== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for
copyright info
==1488== Command: /usr/lib/gcc/x86_64-linux-gnu/4.4.3/f951
/home/uni/tmp/test.f90 -dumpbase test.f90 -mtune=generic -auxbase test
-fintrinsic-modules-path /usr/lib/gcc/x86_64-linux-gnu/4.4.3/finclude -o
/tmp/ccMioHAS.s
==1488== 
==1488== Invalid read of size 8
==1488==    at 0x4FC5F2: ??? (in /usr/lib/gcc/x86_64-linux-gnu/4.4/f951)
==1488==    by 0x4F95C1: gfc_resolve_expr (in
/usr/lib/gcc/x86_64-linux-gnu/4.4/f951)
==1488==    by 0x4FFC22: ??? (in /usr/lib/gcc/x86_64-linux-gnu/4.4/f951)
==1488==    by 0x5031EB: gfc_resolve_blocks (in
/usr/lib/gcc/x86_64-linux-gnu/4.4/f951)
==1488==    by 0x4FFC02: ??? (in /usr/lib/gcc/x86_64-linux-gnu/4.4/f951)
==1488==    by 0x5015C0: ??? (in /usr/lib/gcc/x86_64-linux-gnu/4.4/f951)
==1488==    by 0x501604: gfc_resolve (in
/usr/lib/gcc/x86_64-linux-gnu/4.4/f951)
==1488==    by 0x4EFD5F: gfc_parse_file (in
/usr/lib/gcc/x86_64-linux-gnu/4.4/f951)
==1488==    by 0x520937: ??? (in /usr/lib/gcc/x86_64-linux-gnu/4.4/f951)
==1488==    by 0x738FF1: toplev_main (in
/usr/lib/gcc/x86_64-linux-gnu/4.4/f951)
==1488==    by 0x54FEC4C: (below main) (libc-start.c:226)
==1488==  Address 0x28 is not stack'd, malloc'd or (recently) free'd
==1488== 

On a side note:
The example code at
http://gcc.gnu.org/onlinedocs/gfortran/C_005fASSOCIATED.html
puzzles me. Shouldn't the message read 'b and a DO point to the same target'?

Cheers,
Dennis


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

end of thread, other threads:[~2013-03-25 17:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-17 14:10 [Bug fortran/49023] New: ICE on invalid code with C_ASSOCIATED dennis.wassel at googlemail dot com
2011-05-18 16:55 ` [Bug fortran/49023] " burnus at gcc dot gnu.org
2013-03-25 15:54 ` burnus at gcc dot gnu.org
2013-03-25 17:51 ` burnus 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).