ASAN: fix ICE in gcc.dg/asan/pr80168.c on aarch64 -mabi=ilp32
authorMaxim Ostapenko <m.ostapenko@samsung.com>
Thu, 13 Jul 2017 07:48:49 +0000 (07:48 +0000)
committerMaxim Ostapenko <chefmax@gcc.gnu.org>
Thu, 13 Jul 2017 07:48:49 +0000 (10:48 +0300)
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
gcc/asan.c
gcc/builtins.c

index 6e62befe6d1fc34184c33c82f46cc8fcdb215944..4f7907aac4314d52632e0d23f2120510fa40434a 100644 (file)
@@ -1,3 +1,9 @@
+2017-07-13  Maxim Ostapenko  <m.ostapenko@samsung.com>
+
+       * 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  <meissner@linux.vnet.ibm.com>
 
        PR target/81193
index 95004d734a5556c0b5ef938401b42a3ab4f5ae5d..89c2731e8cdb69d45fb91b345fdf7f081ad9e79d 100644 (file)
@@ -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 ();
index 608993afc1b6caba92a22e03f51a637c0b08e05e..2deef725620b69ae855f21037e0dfb5fbf0336cc 100644 (file)
@@ -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;
 }