On 11/07/17 16:51, Andreas Schwab wrote:
On Jul 10 2017, Maxim Ostapenko <[email protected]> wrote:diff --git a/gcc/asan.c b/gcc/asan.c index 95004d7..89c2731 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -1567,9 +1567,10 @@ asan_emit_allocas_unpoison (rtx top, rtx bot, rtx_insn *before) else start_sequence (); rtx ret = init_one_libfunc ("__asan_allocas_unpoison"); + top = convert_memory_address (ptr_mode, top); + bot = convert_memory_address (ptr_mode, bot); ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, 2, top, - TYPE_MODE (pointer_sized_int_node), bot, - TYPE_MODE (pointer_sized_int_node)); + ptr_mode, bot, ptr_mode);There is another similar occurence: /opt/gcc/gcc-20170711/gcc/testsuite/gcc.dg/asan/pr80168.c:7:1: internal compiler error: in emit_library_call_value_1, at calls.c:4555 0x701577 emit_library_call_value_1 ../../gcc/calls.c:4554 0x7068d7 emit_library_call_value(rtx_def*, rtx_def*, libcall_type, machine_mode, int, ...) ../../gcc/calls.c:5159 0x6f2307 expand_asan_emit_allocas_unpoison ../../gcc/builtins.c:4978 0x6f2307 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int) ../../gcc/builtins.c:6787 0x81fa6f expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ../../gcc/expr.c:10841 0x716517 expand_expr ../../gcc/expr.h:276 0x716517 expand_call_stmt ../../gcc/cfgexpand.c:2664 0x716517 expand_gimple_stmt_1 ../../gcc/cfgexpand.c:3583 0x716517 expand_gimple_stmt ../../gcc/cfgexpand.c:3749 0x719077 expand_gimple_basic_block ../../gcc/cfgexpand.c:5753 0x71dfc7 execute ../../gcc/cfgexpand.c:6360
Oh, I see. Does attached patch fix the issue? -Maxim
Andreas.
gcc/ChangeLog: 2017-07-11 Maxim Ostapenko <[email protected]> * asan.c (asan_emit_allocas_unpoison): Use ptr_mode for arguments during expansion. * builtins.c (expand_asan_emit_allocas_unpoison): Likewise. diff --git a/gcc/asan.c b/gcc/asan.c index 95004d7..89c2731 100644 --- a/gcc/asan.c +++ b/gcc/asan.c @@ -1567,9 +1567,10 @@ asan_emit_allocas_unpoison (rtx top, rtx bot, rtx_insn *before) else start_sequence (); rtx ret = init_one_libfunc ("__asan_allocas_unpoison"); + top = convert_memory_address (ptr_mode, top); + bot = convert_memory_address (ptr_mode, bot); ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, 2, top, - TYPE_MODE (pointer_sized_int_node), bot, - TYPE_MODE (pointer_sized_int_node)); + ptr_mode, bot, ptr_mode); do_pending_stack_adjust (); rtx_insn *insns = get_insns (); diff --git a/gcc/builtins.c b/gcc/builtins.c index 608993a..6437979 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4976,9 +4976,7 @@ expand_asan_emit_allocas_unpoison (tree exp) EXPAND_NORMAL); rtx ret = init_one_libfunc ("__asan_allocas_unpoison"); ret = emit_library_call_value (ret, NULL_RTX, LCT_NORMAL, ptr_mode, 2, top, - TYPE_MODE (pointer_sized_int_node), - virtual_stack_dynamic_rtx, - TYPE_MODE (pointer_sized_int_node)); + ptr_mode, virtual_stack_dynamic_rtx, ptr_mode); return ret; }
