g77 - mips-sgi-irix6.2 - Internal compiler error in function copy _to_mode_reg

Jeffrey A Law law@hurl.cygnus.com
Sun Feb 14 20:43:00 GMT 1999


  In message <59A91793A168D2118E0A0000F802ED31012B9E@ATMMAIL.atmdns>you write:
  > Compiler: g77 from egcs-1.1a and egcs-19981019
  > OS: mips-sgi-irix6.2
  > 
  > When compiling the routine lsamen.f from LAPACK with -mabi=64 I get the
  > error 
  > /usr/local/imports/egcs-1.1a/gcc/explow.c:650: Internal compiler error in
  > function copy_to_mode_reg
  > Error occurs with -O0 -O1 and -O2
  > 
  > Command line: g77 -v -O0 -mabi=64 -c lsamen.f
[ ... ]
I believe this is a bug in the fortran front end.

It's calling expand_start_cond with the following condition:

 <lt_expr 0x8337970
    type <integer_type 0x8335f28 int allocated from permanent_obstack
        permanent SI
        size <integer_cst 0x8335fb8 constant permanent 32>
        align 32 symtab 0 alias set -1 precision 32
        min <integer_cst 0x8335f88 constant permanent -2147483648>
        max <integer_cst 0x8335fa0 constant permanent 2147483647>>
    allocated from momentary_obstack
   
    arg 0 <parm_decl 0x83389a4 __g77_length_ca
        type <integer_type 0x8345600 __g77_f2c_ftnlen allocated from permanent_obstack
            permanent DI
            size <integer_cst 0x8335da8 constant permanent 64>
            align 64 symtab 0 alias set -1 precision 64
            min <integer_cst 0x8345660 constant permanent 0x8000000000000000>
            max <integer_cst 0x8345678 constant permanent 0x7fffffffffffffff>
            pointer_to_this <pointer_type 0x83458c8>>
        allocated from function maybepermanent obstack
       [ ... ]

    arg 1 <indirect_ref 0x833795c
        type <integer_type 0x8340e40 integer allocated from permanent_obstack
            permanent SI size <integer_cst 0x8335fb8 32>
            align 32 symtab 0 alias set -1 precision 32
            min <integer_cst 0x8340ea0 constant permanent -2147483648>
            max <integer_cst 0x8340eb8 constant permanent 2147483647>
            pointer_to_this <pointer_type 0x834a1a4>>
        allocated from momentary_obstack

Of particular importance is the types/modes of the two arguments to the
LT_EXPR.  One is a 64bit type (DImode), the other is a 32bit type (SImode).

This eventually causes things to blow up.

Here's a simpler testcase:

      LOGICAL          FUNCTION LSAMEN( N, CA, CB )
      CHARACTER*( * )    CA, CB
      INTEGER            N
      INTRINSIC          LEN
      IF( LEN( CA ).LT.N)
     $   GO TO 20
   20 CONTINUE
      END





More information about the Gcc-bugs mailing list