[Bug middle-end/17407] [4.0 Regression] ICE in int_mode_for_mode

roger at eyesopen dot com gcc-bugzilla@gcc.gnu.org
Sat Sep 18 14:17:00 GMT 2004


------- Additional Comments From roger at eyesopen dot com  2004-09-18 14:17 -------
I'm getting out of my depth, but I thought I'd submit my analysis so far.
The failure on ia64 is from calling int_mode_for_mode with VOIDmode.  This
erroneous call is from extract_bit_field which is called from expand_real
with op0 == (mem/s (reg/f:DI 340 [ libxml_xpathCallbacks.0 ]) [0 S0 A8])
You'll notice that the MEM has no mode, resulting in the problematic VOIDmode.

My obvious question (and why I'm out of my depth) is are MEMs required to
have a mode?

This MEM is created INDIRECT_REF section of expand_expr, where we call
gen_rtx_MEM with VOIDmode, because TYPE_MODE (type) returned VOIDmode for
type:

 <array_type 0x200000000048e300
    type <record_type 0x200000000048e220 libxml_xpathCallback type_0 DI
        size <integer_cst 0x20000000000b4ab0 constant invariant 64>
        unit size <integer_cst 0x20000000000b4ae0 constant invariant 8>
        align 64 symtab 0 alias set -1
        fields <field_decl 0x200000000048e060 ns_uri type <pointer_type 0x200000
00000c6ae0>
            unsigned DI file /home/roger/pr17407.c line 2 size <integer_cst 0x20
000000000b4ab0 64> unit size <integer_cst 0x20000000000b4ae0 8>
            align 64 offset_align 128
            offset <integer_cst 0x20000000000b4330 constant invariant 0>
            bit offset <integer_cst 0x20000000000b56e0 constant invariant 0> con
text <record_type 0x200000000048dea0 libxml_xpathCallback> arguments <integer_cs
t 0x20000000000b4330 0>>>
    VOID
    align 8 symtab 0 alias set -1>

At this point tmode is also VOIDmode.

It really isn't clear to me where best to fix the problem.  The conditional
tests prior to the call of extract_bit_field at around line 7129 of expr.c
look daunting.  Perhaps extract_bit_field is supposed to be able to handle
VOIDmode arguments, and should guard its call to int_mode_for_mode?


-- 


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



More information about the Gcc-bugs mailing list