Help required debugging PR 3392 and PR 3393

Billinghurst, David (CRTS) David.Billinghurst@riotinto.com
Sun Feb 3 22:18:00 GMT 2002


I am trying to debug PR fortran/3392 and fortran/3393.  Both problems are restricted to irix with the -mabi=64 flag, effectively 32-bit to 64-bit cross-compiles.

The problems are probably (see the PRs) latent bugs exposed by patch

2001-05-03  Alexandre Oliva  <aoliva@redhat.com>

	Re-installed 2001-01-09's patch:
	* hwint.h (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT): Use long long
	if it's wider than long and the target's long is wider than the
	host's.


I have two simple test cases.

      subroutine pr3392(n,a)
      integer n
      real a(n,n)
      end

which fails with

./f771 -quiet -mabi=64 -O0  pr3392.f
pr3392.f: In subroutine `pr3392':
pr3392.f:1: Internal compiler error in function_arg, at config/mips/mips.c:4059
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

and

       PROGRAM PR3393
       INTEGER I, J, M
       REAL    A(5,2)
       M = 1
       DO J = 1, 2
         DO I = 1, M
           CALL F1( A(I,J) )
         END DO
       END DO
       CALL F2(M)
       END

which fails with

./f771 -quiet -mabi=64 -O2 pr3393.f
pr3393.f: In program `pr3393':
pr3393.f:11: unrecognizable insn:
(insn 203 86 144 (set (reg:DI 114)
        (plus:DI (reg:DI 114)
            (sign_extend:DI (const_int 20 [0x14])))) -1 (nil)
    (nil))
pr3393.f:11: Internal compiler error in extract_insn, at recog.c:2129
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.


I can run these under gdb and get a backtrace (below) but I am now getting out of my depth.  Any advice welcome.

gdb ./f771 
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "mips-sgi-irix6.5"...
Breakpoint 1 at 0x101cbf90: file /exd4/billingd/src/gcc/gcc/diagnostic.c, line 1452.
.gdbinit:7: Error in sourced command file:
/exd4/billingd/src/gcc/gcc/gdbinit.in:101: Error in sourced command file:
Function "exit" not defined.
(gdb) run -quiet -mabi=64 -O0  pr3392.f
Starting program: /exd4/billingd/obj/gcc/gcc/./f771 -quiet -mabi=64 -O0  pr3392.f

Breakpoint 1, fancy_abort (
    file=0x103c1d60 "/exd4/billingd/src/gcc/gcc/config/mips/mips.c", 
    line=4059, function=0x103c2858 "function_arg")
    at /exd4/billingd/src/gcc/gcc/diagnostic.c:1452
1452      internal_error ("Internal compiler error in %s, at %s:%d",
(gdb) bt
#0  fancy_abort (
    file=0x103c1d60 "/exd4/billingd/src/gcc/gcc/config/mips/mips.c", 
    line=4059, function=0x103c2858 "function_arg")
    at /exd4/billingd/src/gcc/gcc/diagnostic.c:1452
#1  0x101a356c in function_arg (cum=0x7ffed140, mode=TImode, type=0x0, named=1)
    at /exd4/billingd/src/gcc/gcc/config/mips/mips.c:4092
#2  0x10130dcc in emit_library_call_value_1 (retval=1, orgfun=0x10498fd0, 
    value=0x0, fn_type=LCT_CONST, outmode=TImode, nargs=2, p=0x7ffed278 "")
    at /exd4/billingd/src/gcc/gcc/calls.c:3710
#3  0x10132228 in emit_library_call_value (orgfun=0x1, value=0x0, 
    fn_type=LCT_NORMAL, outmode=BImode, nargs=2)
    at /exd4/billingd/src/gcc/gcc/calls.c:4244
#4  0x10250858 in expand_binop (mode=TImode, binoptab=0x104df478, 
    op0=0x104c4408, op1=0x104c4570, target=0x104c4408, unsignedp=1, 
    methods=OPTAB_LIB_WIDEN) at /exd4/billingd/src/gcc/gcc/optabs.c:1763
#5  0x10291448 in expand_mult (mode=TImode, op0=0x104c4408, op1=0x104c4570, 
    target=0x104c4408, unsignedp=1) at /exd4/billingd/src/gcc/gcc/expmed.c:2535
#6  0x1018838c in expand_expr (exp=0x1049ca20, target=0x104c4408, 
    tmode=273546040, modifier=EXPAND_NORMAL)
    at /exd4/billingd/src/gcc/gcc/expr.c:7694
#7  0x101882e4 in expand_expr (exp=0x1049ca40, target=0x104c4408, 
    tmode=TImode, modifier=EXPAND_NORMAL)
    at /exd4/billingd/src/gcc/gcc/expr.c:7692
#8  0x101752fc in store_expr (exp=0x1049ca40, target=0x104c4408, want_value=0)
    at /exd4/billingd/src/gcc/gcc/expr.c:4069
#9  0x1018cbe8 in expand_expr (exp=0x1049cbe0, target=0x0, tmode=VOIDmode, 
    modifier=EXPAND_NORMAL) at /exd4/billingd/src/gcc/gcc/expr.c:6395
#10 0x10142160 in expand_pending_sizes (pending_sizes=0x6)
    at /exd4/billingd/src/gcc/gcc/function.c:6365
#11 0x10142684 in expand_function_start (subr=0x104a0200, 
    parms_have_cleanups=29) at /exd4/billingd/src/gcc/gcc/function.c:6586
#12 0x10055294 in store_parm_decls (is_main_program=6)
    at /exd4/billingd/src/gcc/gcc/f/com.c:13872
#13 0x10044c44 in ffecom_start_progunit_ ()
    at /exd4/billingd/src/gcc/gcc/f/com.c:7297
#14 0x1004c844 in ffecom_end_transition ()
    at /exd4/billingd/src/gcc/gcc/f/com.c:10739
#15 0x100c48bc in ffestd_exec_end () at /exd4/billingd/src/gcc/gcc/f/std.c:1431
#16 0x100b6418 in ffestc_shriek_subroutine_ (ok=true)
---Type <return> to continue, or q <return> to quit---
    at /exd4/billingd/src/gcc/gcc/f/stc.c:4935
#17 0x100c1cd0 in ffestc_R1225 (name=0x0)
    at /exd4/billingd/src/gcc/gcc/f/stc.c:12417
#18 0x100b7138 in ffestc_end () at /exd4/billingd/src/gcc/gcc/f/stc.c:5659
#19 0x10095ae8 in ffestb_end3_ (t=0x104d2320)
    at /exd4/billingd/src/gcc/gcc/f/stb.c:3206
#20 0x10095370 in ffestb_end (t=0x104d2320)
    at /exd4/billingd/src/gcc/gcc/f/stb.c:2985
#21 0x10090010 in ffesta_second_ (t=0x104d2320)
    at /exd4/billingd/src/gcc/gcc/f/sta.c:1359
#22 0x100894f4 in ffelex_send_token_ ()
    at /exd4/billingd/src/gcc/gcc/f/lex.c:1637
#23 0x10087640 in ffelex_finish_statement_ ()
    at /exd4/billingd/src/gcc/gcc/f/lex.c:930
#24 0x1008a2d8 in ffelex_file_fixed (wf=0x9, f=0xfb52640)
    at /exd4/billingd/src/gcc/gcc/f/lex.c:2977
#25 0x100e9a70 in ffe_file (wf=0x10499cb0, f=0xfb52640)
    at /exd4/billingd/src/gcc/gcc/f/top.c:545
#26 0x1008e78c in yyparse () at /exd4/billingd/src/gcc/gcc/f/parse.c:46
#27 0x10147a0c in compile_file () at /exd4/billingd/src/gcc/gcc/toplev.c:2122
#28 0x1014e218 in do_compile () at /exd4/billingd/src/gcc/gcc/toplev.c:5177
#29 0x1014e2e0 in toplev_main (argc=5, argv=0x7ffedf14)
    at /exd4/billingd/src/gcc/gcc/toplev.c:5209
#30 0x100eb19c in main (argc=6, argv=0x2)
    at /exd4/billingd/src/gcc/gcc/main.c:35


gdb ./f771
GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "mips-sgi-irix6.5"...
Breakpoint 1 at 0x101cbf90: file /exd4/billingd/src/gcc/gcc/diagnostic.c, line 1452.
.gdbinit:7: Error in sourced command file:
/exd4/billingd/src/gcc/gcc/gdbinit.in:101: Error in sourced command file:
Function "exit" not defined.
(gdb) run  -quiet -mabi=64 -O2 pr3393.f
Starting program: /exd4/billingd/obj/gcc/gcc/./f771 -quiet -mabi=64 -O2 pr3393.f
pr3393.f: In program `pr3393':
pr3393.f:11: unrecognizable insn:
(insn 203 86 144 (set (reg:DI 114)
        (plus:DI (reg:DI 114)
            (sign_extend:DI (const_int 20 [0x14])))) -1 (nil)
    (nil))

Breakpoint 1, fancy_abort (
    file=0x103ca908 "/exd4/billingd/src/gcc/gcc/recog.c", line=2129, 
    function=0x103cac30 "extract_insn")
    at /exd4/billingd/src/gcc/gcc/diagnostic.c:1452
1452      internal_error ("Internal compiler error in %s, at %s:%d",
(gdb) bt
#0  fancy_abort (file=0x103ca908 "/exd4/billingd/src/gcc/gcc/recog.c", 
    line=2129, function=0x103cac30 "extract_insn")
    at /exd4/billingd/src/gcc/gcc/diagnostic.c:1452



More information about the Gcc-bugs mailing list