> Reload can temporarily produce a SUBREG of a MEM if, as the comment > says, the insn has a SUBREG of a REG, and the REG is turned into a > memory address. But before approving this patch, can you say > something about what calls reg_overlap_mentioned_for_reload_p in this > case? There are a number of places in reload which assume that a > SUBREG is only of a REG.
Here is the traceback: #0 fancy_abort (file=0xa7dd7f "../../gcc/gcc/rtlanal.c", line=3149, function=0xa7f240 "subreg_regno_offset") at ../../gcc/gcc/diagnostic.c:602 #1 0x00000000007f1ae5 in subreg_regno_offset (xregno=2507505024, xmode=QImode, offset=0, ymode=HImode) at ../../gcc/gcc/rtlanal.c:3149 #2 0x00000000007d6527 in reg_overlap_mentioned_for_reload_p (x=0x2a95757de0, in=0x2a95757be0) at ../../gcc/gcc/reload.c:6340 #3 0x00000000007e5d7f in merge_assigned_reloads (insn=0x2a9592e870) at ../../gcc/gcc/reload1.c:6171 #4 0x00000000007e11c7 in reload_as_needed (live_known=1) at ../../gcc/gcc/reload1.c:3958 #5 0x00000000007da5ac in reload (first=0x2a957a5f80, global=1) at ../../gcc/gcc/reload1.c:1074 #6 0x000000000098c482 in global_alloc (file=0x0) at ../../gcc/gcc/global.c:628 #7 0x00000000009917b9 in rest_of_handle_global_alloc () at ../../gcc/gcc/global.c:2494 #8 0x0000000000882ecd in execute_one_pass (pass=0xc2b640) at ../../gcc/gcc/passes.c:846 #9 0x0000000000882f8c in execute_pass_list (pass=0xc2b640) at ../../gcc/gcc/passes.c:878 #10 0x0000000000882faa in execute_pass_list (pass=0xc29e80) at ../../gcc/gcc/passes.c:879 #11 0x00000000004e4a05 in tree_rest_of_compilation (fndecl=0x2a95747500) at ../../gcc/gcc/tree-optimize.c:412 #12 0x0000000000424a7a in c_expand_body (fndecl=0x2a95747500) at ../../gcc/gcc/c-decl.c:6640 #13 0x00000000008da985 in cgraph_expand_function (node=0x2a95936900) at ../../gcc/gcc/cgraphunit.c:1056 #14 0x00000000008dac0d in cgraph_expand_all_functions () at ../../gcc/gcc/cgraphunit.c:1122 #15 0x00000000008db312 in cgraph_optimize () at ../../gcc/gcc/cgraphunit.c:1276 #16 0x0000000000427a93 in c_write_global_declarations () at ../../gcc/gcc/c-decl.c:7746 #17 0x00000000008261fc in compile_file () at ../../gcc/gcc/toplev.c:1003 #18 0x0000000000827cc1 in do_compile () at ../../gcc/gcc/toplev.c:1948 #19 0x0000000000827d25 in toplev_main (argc=19, argv=0x7fbffff7a8) at ../../gcc/gcc/toplev.c:1980 #20 0x00000000004adbfb in main (argc=19, argv=0x7fbffff7a8) at ../../gcc/gcc/main.c:35