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

             Bug #: 53704
           Summary: [4.8 Regression] ICE: in based_loc_descr, at
                    dwarf2out.c:10027 after revision 188621
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: domi...@lps.ens.fr
                CC: bur...@net-b.de, ebotca...@gcc.gnu.org,
                    ia...@gcc.gnu.org
              Host: x86_64-apple-darwin10
            Target: x86_64-apple-darwin10
             Build: x86_64-apple-darwin10


On x86_64-apple-darwin10, revision 188621 causes/exposes the following
regressions:

Running target unix/-m32
FAIL: gfortran.dg/minmax_char_1.f90  -O3 -g  (internal compiler error)
FAIL: gfortran.dg/minmax_char_1.f90  -O3 -g  (test for excess errors)
...
Running target unix/-m64
FAIL: gfortran.dg/array_constructor_type_7.f03  -O3 -g  (internal compiler
error)
FAIL: gfortran.dg/array_constructor_type_7.f03  -O3 -g  (test for excess
errors)

In both cases, the internal compiler error appears with optimization at -O1 or
above and -g and is

[macbook] f90/bug% gfc -m32 -O1 -g minmax_char_1_red.f90
minmax_char_1_red.f90: In function 'equal':
minmax_char_1_red.f90:28:0: internal compiler error: in based_loc_descr, at
dwarf2out.c:10027

I have reduced minmax_char_1.f90 to

program test

  character(len=3) :: s
  character(len=6) :: t
  s = "gee"
  t = "crunch"

  call foo("gee   ","crunch",s,t)

contains

  subroutine foo(res_max, res_min, a, b, c, d)
    character(len=*) :: res_min, res_max
    character(len=*), optional :: a, b, c, d

    if (.not. equal(min(a,b,c,d), res_min)) call abort
    if (.not. equal(max(a,b,c,d), res_max)) call abort
  end subroutine foo

  pure function equal(a,b)
    character(len=*), intent(in) :: a, b
    logical :: equal

    equal = (len(a) == len(b)) .and. (a == b)
  end function equal

end program test

The ICE goes away if I remove one of the IF in the subroutine foo. Note also
that minmax_char_1.f90 passes with -m64 and array_constructor_type_7.f03 with
-m32.

Reply via email to