From 8f4956cadfef8fd4f43fecca65070428a504188d Mon Sep 17 00:00:00 2001 From: Maxim Ostapenko Date: Thu, 13 Jul 2017 07:48:49 +0000 Subject: [PATCH] ASAN: fix ICE in gcc.dg/asan/pr80168.c on aarch64 -mabi=ilp32 gcc/ * asan.c (asan_emit_allocas_unpoison): Use ptr_mode for arguments during expansion. * builtins.c (expand_asan_emit_allocas_unpoison): Likewise. From-SVN: r250176 --- gcc/ChangeLog | 6 ++++++ gcc/asan.c | 5 +++-- gcc/builtins.c | 8 +++----- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e62befe6d1..4f7907aac43 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-07-13 Maxim Ostapenko + + * asan.c (asan_emit_allocas_unpoison): Use ptr_mode for arguments + during expansion. + * builtins.c (expand_asan_emit_allocas_unpoison): Likewise. + 2017-07-12 Michael Meissner PR target/81193 diff --git a/gcc/asan.c b/gcc/asan.c index 95004d734a5..89c2731e8cd 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 608993afc1b..2deef725620 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -4972,13 +4972,11 @@ static rtx expand_asan_emit_allocas_unpoison (tree exp) { tree arg0 = CALL_EXPR_ARG (exp, 0); - rtx top = expand_expr (arg0, NULL_RTX, GET_MODE (virtual_stack_dynamic_rtx), - EXPAND_NORMAL); + rtx top = expand_expr (arg0, NULL_RTX, ptr_mode, EXPAND_NORMAL); + rtx bot = convert_memory_address (ptr_mode, virtual_stack_dynamic_rtx); 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, bot, ptr_mode); return ret; } -- 2.30.2