public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/56477] New: ICE on invalid with pointer assignment to function result
@ 2013-02-27 21:55 abensonca at gmail dot com
  2013-02-27 22:15 ` [Bug fortran/56477] [4.8 Regression] " tkoenig at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: abensonca at gmail dot com @ 2013-02-27 21:55 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56477
           Summary: ICE on invalid with pointer assignment to function
                    result
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: abensonca@gmail.com


The following causes an ICE with gfortran 4.8.0 r196316:

module s
contains
  function so()
    implicit none
    integer, target  :: so
    integer, pointer :: sp
    sp => so
    return
  end function So
end module s

$ gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/abenson/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/home/abenson
--enable-languages=c,c++,fortran --disable-multilib --with-gmp=/home/abenson
Thread model: posix
gcc version 4.8.0 20130227 (experimental) (GCC) 

$ gfortran -c -o ICEtest.o ICEtest.F90 -Wall
f951: internal compiler error: Segmentation fault
0x92f79f crash_signal
        ../../gcc-trunk/gcc/toplev.c:332
0x4fdbf2 gfc_check_pointer_assign(gfc_expr*, gfc_expr*)
        ../../gcc-trunk/gcc/fortran/expr.c:3734
0x5555d6 resolve_code
        ../../gcc-trunk/gcc/fortran/resolve.c:10261
0x557c5e resolve_codes
        ../../gcc-trunk/gcc/fortran/resolve.c:14972
0x557b67 resolve_codes
        ../../gcc-trunk/gcc/fortran/resolve.c:14958
0x548aa2 gfc_resolve
        ../../gcc-trunk/gcc/fortran/resolve.c:15000
0x53d186 gfc_parse_file()
        ../../gcc-trunk/gcc/fortran/parse.c:4608
0x579415 gfc_be_parse_file
        ../../gcc-trunk/gcc/fortran/f95-lang.c:189
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


The "-Wall" is important - without the code compiles without complaint.

I tagged this as invalid(?) because I don't think that giving the function
return value the TARGET attribute makes sense, although I couldn't find
anything that clearly says it's not allowed.


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

end of thread, other threads:[~2013-03-03 20:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-27 21:55 [Bug fortran/56477] New: ICE on invalid with pointer assignment to function result abensonca at gmail dot com
2013-02-27 22:15 ` [Bug fortran/56477] [4.8 Regression] " tkoenig at gcc dot gnu.org
2013-02-27 22:31 ` tkoenig at gcc dot gnu.org
2013-03-03 19:59 ` mikael at gcc dot gnu.org
2013-03-03 20:02 ` 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).