The following fails with today's (rev. 120520) trunk (at -O1 on both i686-linux
and x86_64-linux):

$ cat mc_coordinates.f90
SUBROUTINE check_for_overlap (cell_length)
  REAL, DIMENSION(1:3), INTENT(IN), OPTIONAL :: cell_length
  REAL, DIMENSION(1:3) :: abc, box_length

  IF (PRESENT(cell_length)) THEN
    box_length(1:3)=abc(1:3)
  ENDIF
END SUBROUTINE check_for_overlap
$ gfortran -O1 -c mc_coordinates.f90
mc_coordinates.f90: In function ‘check_for_overlap’:
mc_coordinates.f90:6: internal compiler error: in operand_equal_p, at
fold-const.c:2539

The bug was originaly reported in PR29975. The gdb backtrace is:

Breakpoint 1, fancy_abort (file=0xa20a04 "../../trunk/gcc/fold-const.c", 
    line=2539, function=0xa20900 "operand_equal_p")
    at ../../trunk/gcc/diagnostic.c:641
641     {
(gdb) back
#0  fancy_abort (file=0xa20a04 "../../trunk/gcc/fold-const.c", line=2539, 
    function=0xa20900 "operand_equal_p") at ../../trunk/gcc/diagnostic.c:641
#1  0x00000000005c416d in operand_equal_p (arg0=0x2a984c3e40, 
    arg1=0x2a983e3300, flags=0) at ../../trunk/gcc/fold-const.c:2539
#2  0x00000000005c7f5f in fold_ternary (code=COND_EXPR, type=0x2a983f30c0, 
    op0=0x2a983de3c0, op1=0x2a984c3e40, op2=0x2a983e3300)
    at ../../trunk/gcc/fold-const.c:11657
#3  0x00000000005c9161 in fold_build3_stat (code=COND_EXPR, type=0x2a983f30c0, 
    op0=0x2a983de3c0, op1=0x2a984c3e40, op2=0x2a983e3300)
    at ../../trunk/gcc/fold-const.c:12307
#4  0x0000000000493271 in gfc_trans_if_1 (code=0xd6af60)
    at ../../trunk/gcc/fortran/trans-stmt.c:612
#5  0x0000000000464b83 in gfc_trans_code (code=0xd73b80)
    at ../../trunk/gcc/fortran/trans.c:528
#6  0x0000000000477f64 in gfc_generate_function_code (ns=0xd6a710)
    at ../../trunk/gcc/fortran/trans-decl.c:3232
#7  0x0000000000442bfc in gfc_parse_file ()
    at ../../trunk/gcc/fortran/parse.c:3263

I don't see any suspicious change in gcc/fortran/ChangeLog, maybe it has to do
with Roger's recent array copying patch (although I don't see how). What is
sure is that it worked at least until 20070104, and is now failing. Roger,
could you give it a look?


-- 
           Summary: [4.3 regression] ICE at -O1 on
           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: fxcoudert at gcc dot gnu dot org
OtherBugsDependingO 29975
             nThis:


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

Reply via email to