re PR middle-end/80295 (ICE in __builtin_update_setjmp_buf expander)
authorQing Zhao <qing.zhao@oracle.com>
Tue, 17 Oct 2017 14:16:35 +0000 (14:16 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 17 Oct 2017 14:16:35 +0000 (14:16 +0000)
gcc/ChangeLog

2017-10-17  Qing Zhao <qing.zhao@oracle.com>
    Wilco Dijkstra <wilco.dijkstra@arm.com>

        * builtins.c (expand_builtin_update_setjmp_buf): Add a
        converstion to Pmode from the buf_addr.

gcc/testsuite/ChangeLog

2017-10-17  Qing Zhao <qing.zhao@oracle.com>
    Wilco Dijkstra <wilco.dijkstra@arm.com>

        PR middle-end/80295
        * gcc.target/aarch64/pr80295.c: New test.

Co-Authored-By: Wilco Dijkstra <wdijkstr@arm.com>
From-SVN: r253814

gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/gcc.target/aarch64/pr80295.c [new file with mode: 0644]

index 7baed9da49a08af19e3ac22d883d099695643706..b53ae8b3240079123ddee3dd26ed028bc294bc40 100644 (file)
@@ -1,3 +1,9 @@
+2017-10-17  Qing Zhao <qing.zhao@oracle.com>
+           Wilco Dijkstra <wilco.dijkstra@arm.com>
+
+        * builtins.c (expand_builtin_update_setjmp_buf): Add a
+        converstion to Pmode from the buf_addr.
+
 2017-10-17  Richard Biener  <rguenther@suse.de>
 
        * graphite-dependences.c (scop_get_reads_and_writes): Change
index ff049aa9d378deb5de7b106307be82dfa3f7495d..28fc76b5fc0f547262d1203ca211a9843db3100a 100644 (file)
@@ -1199,6 +1199,7 @@ void
 expand_builtin_update_setjmp_buf (rtx buf_addr)
 {
   machine_mode sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL);
+  buf_addr = convert_memory_address (Pmode, buf_addr);
   rtx stack_save
     = gen_rtx_MEM (sa_mode,
                   memory_address
diff --git a/gcc/testsuite/gcc.target/aarch64/pr80295.c b/gcc/testsuite/gcc.target/aarch64/pr80295.c
new file mode 100644 (file)
index 0000000..b3866d8
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-mabi=ilp32" } */
+
+void f (void *b) 
+{ 
+  __builtin_update_setjmp_buf (b); 
+}
+