This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/33998] New: ICE in make_decl_rtl, at varasm.c:1263


Found at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/f222faf1eb571cba

The following program crashes a couple of compilers, including gfortran 4.1.x
to 4.3.0. The error message is:

sdsd.f90: In function 'len_test':
sdsd.f90:23: internal compiler error: in make_decl_rtl, at varasm.c:1263

This is the following assert:

  /* A weak alias has TREE_PUBLIC set but not the other bits.  */
  gcc_assert (TREE_CODE (decl) != VAR_DECL
              || TREE_STATIC (decl)
              || TREE_PUBLIC (decl)
              || DECL_EXTERNAL (decl)
              || DECL_REGISTER (decl));

 * * *

Using NAG f95, the following program compiles and prints "01234567890".


module test
   implicit none
   contains
      function my_string(x)
         integer i
         real, intent(in) :: x(:)
         character(0) h4(1:minval([(1,i=1,0)],1))
         character(0) sv1(size(x,1):size(h4))
         character(0) sv2(2*lbound(sv1,1):size(h4))
         character(lbound(sv2,1)-3) my_string

         do i = 1, len(my_string)
            my_string(i:i) = achar(modulo(i-1,10)+iachar('0'))
         end do
      end function my_string
end module test

program len_test
   use test
   implicit none
   real x(7)

   write(*,*) my_string(x) ! <<< Line 23
end program len_test


-- 
           Summary: ICE in make_decl_rtl, at varasm.c:1263
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]