https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65192

            Bug ID: 65192
           Summary: [avr-tiny] ICE in
                    tiny_valid_direct_memory_access_range
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: ice-checking
          Severity: normal
          Priority: P3
         Component: target
          Assignee: senthil_kumar.selvaraj at atmel dot com
          Reporter: gjl at gcc dot gnu.org
            Target: avr

if configured with --enable-checking=all avr-gcc 5.0 fails to build libgcc for
avrtiny:

conftest.c:11:1: internal compiler error: RTL check: expected elt 0 type 'e' or
'u', have 'i' (rtx reg) in tiny_valid_direct_memory_access_range, at
config/avr/avr.c:3228
 main ()
 ^
0x8721938 rtl_check_failed_type2(rtx_def const*, int, int, int, char const*,
int, char const*)
    ../../../gcc.gnu.org/trunk/gcc/rtl.c:722
0x8abfcac tiny_valid_direct_memory_access_range(rtx_def*, machine_mode)
    ../../../gcc.gnu.org/trunk/gcc/config/avr/avr.c:3228
0x8b08e6f gen_movsi(rtx_def*, rtx_def*)
    ../../../gcc.gnu.org/trunk/gcc/config/avr/avr.md:680
0x83fc788 insn_gen_fn::operator()(rtx_def*, rtx_def*) const
    ../../../gcc.gnu.org/trunk/gcc/recog.h:303
0x83fc788 emit_move_insn_1(rtx_def*, rtx_def*)
    ../../../gcc.gnu.org/trunk/gcc/expr.c:3546
0x83fcb6b emit_move_insn(rtx_def*, rtx_def*)
    ../../../gcc.gnu.org/trunk/gcc/expr.c:3641
0x82e3f23 init_set_costs()
    ../../../gcc.gnu.org/trunk/gcc/cfgloopanal.c:371
0x87806ce backend_init_target
    ../../../gcc.gnu.org/trunk/gcc/toplev.c:1717
0x87806ce initialize_rtl()
    ../../../gcc.gnu.org/trunk/gcc/toplev.c:1820
0x84869ed init_function_start(tree_node*)
    ../../../gcc.gnu.org/trunk/gcc/function.c:4892
0x830c3a6 cgraph_node::expand()
    ../../../gcc.gnu.org/trunk/gcc/cgraphunit.c:1857
0x830dca6 expand_all_functions
    ../../../gcc.gnu.org/trunk/gcc/cgraphunit.c:2006
0x830dca6 symbol_table::compile()
    ../../../gcc.gnu.org/trunk/gcc/cgraphunit.c:2359
0x830fa5c symbol_table::finalize_compilation_unit()
    ../../../gcc.gnu.org/trunk/gcc/cgraphunit.c:2436
0x817d593 c_write_global_declarations()
    ../../../gcc.gnu.org/trunk/gcc/c/c-decl.c:10803
Please submit a full bug report,
with preprocessed source if appropriate.


This is because x = XEXP (op, 0)  under the assumption that op is always MEM
which is not the case.  It might also be REG or SUBREG.

BTW, using tiny_valid_direct_memory_access_range or similar in insn condition
in order to refuse some addresses is a bad approach.  Better use
legitimate_address_p and similar hooks.

Reply via email to