Internal Compiler Error in gen_rtx_SUBREG,at emit-rtl.c:776 in CR16

Sumanth Gundapaneni Sumanth.Gundapaneni@kpitcummins.com
Fri Feb 4 14:15:00 GMT 2011


Hi Ian & Jeff,

>> Any RTL that can be created by inlining can also be created in other
>> ways, so don't wory about inlining.  You need to find out specifically
>> what is creating that insn.  I usually find it easiest to set a
>> breakpoint on make_insn_raw with a breakpoint on cur_insn_uid (which is
>> a macro, so you have to use the real expression) to find when the insn
>> with a specific UID was created.
>Tip: Place the breakpoint after the assignment:


 
> INSN_UID (insn) = cur_insn_uid++;

>And you don't have to know the "cur_insn_uid" magic...

>b <line> if insn.u.fld[0].rt_int == <some #>

>Breakpoints on an insn's UID become second nature quickly if you do a
>lot of RTL debugging.


		Thanks for sharing the debugging technique. 
I was able to isolate the error with the breakpoint at "make_raw_insn" 
and successfully resolved couple of issues and I believe all the issues 
related to subreg are resolved.

However below mentioned is one of the test case that I was not able to 
resolve.

struct test{
int ia;
char ca;
float fa;
};

int main()
{
        struct test testinst = {23, 'c', 12.34};

        return (int) &testinst;
}

Whenever a function returns a 32-bit address, the compiler crashes with
internal compiler error: in instantiate_virtual_regs_in_insn, at function.c:1600
The rtl dump  for return value "(insn 21 18 0 5 test.c:12 (use (reg/i:HI 0 r0)) -1 (nil))"
which I believe should be SImode.

The related macro definitions are 
#define FUNCTION_VALUE(VALTYPE, FUNC) \
    gen_rtx_REG (TYPE_MODE (VALTYPE), 0)

#define LIBCALL_VALUE(MODE)     gen_rtx_REG (MODE, 0)

#define FUNCTION_VALUE_REGNO_P(N)   ((N) == 0)

#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)       \
  ( (GET_MODE_SIZE (TO) < GET_MODE_SIZE (FROM))          \
   ? 1        \
   : 0)

#undef  TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX     cr16_struct_value_rt

static rtx
cr16_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
                       int incoming ATTRIBUTE_UNUSED)
{
  return gen_rtx_REG (Pmode, 0);
}
 
 
Can you point me where I went wrong ?

Thanks and Regards,
Sumanth G		



More information about the Gcc-help mailing list