MODULE bug 
      IMPLICIT NONE 
 
      TYPE :: my_type 
        REAL :: x 
      END TYPE 
 
      TYPE (my_type), DIMENSION(3) :: t 
 
      CONTAINS 
      SUBROUTINE foo 
      INTEGER, DIMENSION(8)        :: c(3) 
      t(c)%x = t(c)%x 
      RETURN 
      END SUBROUTINE foo 
 
      END MODULE bug 
 
 
 
--> 
 
Starting program: /space/stevenb/build/gcc/f951 -O t.f90 
 foo 
Breakpoint 1, internal_error (gmsgid=0xb1a07f "in %s, at %s:%d") at 
diagnostic.c:534 
534       va_start (ap, gmsgid); 
(gdb) up 
#1  0x000000000058fea3 in fancy_abort (file=0xb27480 
"../../mainline/gcc/fold-const.c", line=2028, 
    function=0xb27cbc "fold_convert") at diagnostic.c:590 
590       internal_error ("in %s, at %s:%d", function, trim_filename (file), 
line); 
(gdb) 
#2  0x0000000000621928 in fold_convert (type=0x2a95a67e70, arg=0x2a95a70b40) 
at fold-const.c:2028 
 
2028          gcc_unreachable (); 
(gdb) 
#3  0x000000000048200a in gfc_trans_scalar_assign (lse=0x7fbfffeea0, 
rse=0x7fbfffee50, type=BT_REAL) 
    at trans-expr.c:2550 
2550          gfc_add_modify_expr (&block, lse->expr, 
(gdb) bt 
#0  internal_error (gmsgid=0xb1a07f "in %s, at %s:%d") at diagnostic.c:534 
#1  0x000000000058fea3 in fancy_abort (file=0xb27480 
"../../mainline/gcc/fold-const.c", line=2028, 
    function=0xb27cbc "fold_convert") at diagnostic.c:590 
#2  0x0000000000621928 in fold_convert (type=0x2a95a67e70, arg=0x2a95a70b40) 
at fold-const.c:2028 
#3  0x000000000048200a in gfc_trans_scalar_assign (lse=0x7fbfffeea0, 
rse=0x7fbfffee50, type=BT_REAL) 
    at trans-expr.c:2550 
#4  0x0000000000482507 in gfc_trans_assignment (expr1=0xe3ac90, 
expr2=0xe668c0) at trans-expr.c:2718 
#5  0x00000000004826fe in gfc_trans_assign (code=0xe3b8f0) at 
trans-expr.c:2770 
#6  0x00000000004678d8 in gfc_trans_code (code=0xe3b8f0) at trans.c:493 
#7  0x000000000047c333 in gfc_generate_function_code (ns=0xe65d20) at 
trans-decl.c:2415 
#8  0x0000000000467e04 in gfc_generate_module_code (ns=0xe2d200) at 
trans.c:712 
#9  0x0000000000443c1a in gfc_parse_file () at parse.c:2637 
#10 0x000000000045e868 in gfc_be_parse_file (set_yydebug=0) at f95-lang.c:256 
#11 0x0000000000873eda in compile_file () at toplev.c:990 
#12 0x00000000008756dd in do_compile () at toplev.c:1933 
#13 0x000000000087573f in toplev_main (argc=3, argv=0x7fbffff2b8) at 
toplev.c:1965 
#14 0x0000000000499c9b in main (argc=3, argv=0x7fbffff2b8) at main.c:35 
(gdb) down 
#2  0x0000000000621928 in fold_convert (type=0x2a95a67e70, arg=0x2a95a70b40) 
at fold-const.c:2028 
2028          gcc_unreachable (); 
(gdb) p debug_tree (type) 
 <record_type 0x2a95a67e70 my_type SF 
    size <integer_cst 0x2a959c5a50 type <integer_type 0x2a959d00b0 
bit_size_type> constant invariant 32> 
    unit size <integer_cst 0x2a959c5570 type <integer_type 0x2a959d0000> 
constant invariant 4> 
    align 32 symtab 0 alias set -1 
    fields <field_decl 0x2a95a63a80 x 
        type <real_type 0x2a959de210 real4 SF size <integer_cst 0x2a959c5a50 
32> unit size <integer_cst 0x2a959c5570 4> 
            align 32 symtab 0 alias set -1 precision 32 
            pointer_to_this <pointer_type 0x2a959de420>> 
        SF file t.f90 line 0 size <integer_cst 0x2a959c5a50 32> unit size 
<integer_cst 0x2a959c5570 4> 
        align 32 offset_align 128 
        offset <integer_cst 0x2a959c55a0 constant invariant 0> 
        bit offset <integer_cst 0x2a959db180 constant invariant 0> context 
<record_type 0x2a95a67e70 my_type>> 
    pointer_to_this <pointer_type 0x2a95a6b160> chain <type_decl 0x2a959e5270 
D.806>> 
$8 = void 
(gdb) p debug_tree (orig) 
 <real_type 0x2a959de210 real4 SF 
    size <integer_cst 0x2a959c5a50 type <integer_type 0x2a959d00b0 
bit_size_type> constant invariant 32> 
    unit size <integer_cst 0x2a959c5570 type <integer_type 0x2a959d0000> 
constant invariant 4> 
    align 32 symtab 0 alias set -1 precision 32 
    pointer_to_this <pointer_type 0x2a959de420>> 
$9 = void 
(gdb)    
 
This shows up in a SPEC benchmark candidate.

-- 
           Summary: ICE trying to fold_convert a REAL_TYPE to a RECORD_TYPE
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: steven at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
OtherBugsDependingO 15502
             nThis:


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

Reply via email to