This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gomp-nvptx 7/7] nvptx backend: define STACK_SIZE_MODE
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 18 Mar 2016 20:48:47 +0300
- Subject: [gomp-nvptx 7/7] nvptx backend: define STACK_SIZE_MODE
- Authentication-results: sourceware.org; auth=none
- References: <1458323327-9908-1-git-send-email-amonakov at ispras dot ru>
Default definition of STACK_SIZE_MODE is word_mode, which is DImode on NVPTX.
However, stack pointer mode matches pointer mode, so needs to be SImode on
32-bit NVPTX ABI. Define it to Pmode to fix 32-bit code generation.
* config/nvptx/nvptx.h (STACK_SIZE_MODE): Define.
---
gcc/ChangeLog.gomp-nvptx | 4 ++++
gcc/config/nvptx/nvptx.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index 7810cca..6da4d06 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -83,6 +83,7 @@
#define POINTER_SIZE (TARGET_ABI64 ? 64 : 32)
#define Pmode (TARGET_ABI64 ? DImode : SImode)
+#define STACK_SIZE_MODE Pmode
/* Registers. Since ptx is a virtual target, we just define a few
hard registers for special purposes and leave pseudos unallocated.