Bug 15955 - ICE in make_decl_rtl, at varasm.c
Summary: ICE in make_decl_rtl, at varasm.c
Status: RESOLVED DUPLICATE of bug 16609
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2004-06-12 12:48 UTC by Mart Rentmeester
Modified: 2004-08-09 16:15 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-06-12 12:55:15


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mart Rentmeester 2004-06-12 12:48:05 UTC
This piece of (valid) code generates an ICE.
When the private attribute to the module is
removed a different error occurs (which is
also submitted as a bug).



troogle> gfortran -v -c n3.f95
Reading specs from /OPT/32/gcc-2004-06-09/lib/gcc/hppa2.0w-hp-hpux11.11/3.5.
0/specs
Configured with: ../configure --enable-languages=c,f95 
--prefix=/opt32/gcc-2004-06-09 --with-gmp=/opt32/gmp --with-gnu-as 
--with-as=/opt32/binutils/bin/as --enable-threads --disable-shared --disable-nls
Thread model: posix
gcc version 3.5.0 20040611 (experimental)
 /OPT/32/gcc-2004-06-09/libexec/gcc/hppa2.0w-hp-hpux11.11/3.5.0/f951 n3.f95 
-quiet -dumpbase n3.f95 -auxbase n3 -version -o /var/tmp//ccOOpnv6.s
GNU F95 version 3.5.0 20040611 (experimental) (hppa2.0w-hp-hpux11.11)
        compiled by GNU C version 3.5.0 20040611 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096

n3.f95: In function `uppercase':
n3.f95:0: internal compiler error: in make_decl_rtl, at varasm.c:758


      module theflib

      private

      contains

!*******************************************************************************

      function uppercase(string)

      implicit none  
      character(*), intent(in) :: string  
      character(len(string))   :: uppercase

      uppercase = string

      end function uppercase

!*******************************************************************************

      end module theflib
Comment 1 Andrew Pinski 2004-06-12 12:55:14 UTC
Confirmed.
Comment 2 Tobias Schlüter 2004-06-22 14:54:48 UTC
Failure here:
  /* Check that we are not being given an automatic variable.  */
  /* A weak alias has TREE_PUBLIC set but not the other bits.  */
  if (TREE_CODE (decl) == PARM_DECL
      || TREE_CODE (decl) == RESULT_DECL
      || (TREE_CODE (decl) == VAR_DECL
	  && !TREE_STATIC (decl)
	  && !TREE_PUBLIC (decl)
	  && !DECL_EXTERNAL (decl)
	  && !DECL_REGISTER (decl)))
    abort ();
Comment 3 Eelis 2004-07-03 19:05:30 UTC
gcc 3.4.0 is also affected, here's an alternative snippet:

  struct S
  {
    double d;
    int i;
  };

  S f ()
  {
    double a = 0.0;
    S b = { a, 0 };
    return b;
  }

  void g () { f(); }


  $ g++ -O7 -c t.cpp
  t.cpp: In function `void g()':
  t.cpp:9: internal compiler error: in make_decl_rtl, at varasm.c:752
  $ g++ -v
  Reading specs from d:/mingw/bin/../lib/gcc/mingw32/3.4.0/specs
  Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as
--host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls
--enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry
--disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt
--without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter
--enable-hash-synchronization
  Thread model: win32
  gcc version 3.4.0 (mingw special)

gcc 3.2.3 is not affected:

  eelis@s2:~$ g++ -O7 -c t.cpp
  eelis@s2:~$ g++ -v
  Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.2.3/specs
  Configured with: ../gcc-3.2.3/configure --prefix=/usr --enable-shared
--enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld
--verbose --target=i486-slackware-linux --host=i486-slackware-linux
  Thread model: posix
  gcc version 3.2.3
Comment 4 Andrew Pinski 2004-07-03 19:19:08 UTC
gccbugs@contacts.eelis.net, your bug is PR15461 and not this one, this is a bug in the new fortran 
front-end.
Comment 5 Andrew Pinski 2004-08-09 16:15:58 UTC
Closing as a dup of bug 16609 which has a small example.

*** This bug has been marked as a duplicate of 16609 ***