summaryrefslogtreecommitdiff
path: root/gcc/config/nvptx/nvptx.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-03 17:26:51 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-03 17:26:51 +0000
commit9009997267683341df8c84a72f0deba749024e1b (patch)
tree29f0919ef5bd3f0b99f39f7f69700e3f71b2f081 /gcc/config/nvptx/nvptx.c
parentb3f70025e3cec069bc6d06ba6a23bcc74f40aabd (diff)
downloadgcc-9009997267683341df8c84a72f0deba749024e1b.tar.gz
gcc/
* config/nvptx/nvptx.c (nvptx_declare_function_name): Round frame size to DImode boundary. (nvptx_propagate): Likewise. libgomp/ * testsuite/libgomp.oacc-c-c++-common/crash-1.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239086 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/nvptx/nvptx.c')
-rw-r--r--gcc/config/nvptx/nvptx.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 6c78699d75f..4d87ead20f3 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -1037,11 +1037,14 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl)
init_frame (file, STACK_POINTER_REGNUM,
UNITS_PER_WORD, crtl->outgoing_args_size);
- /* Declare a local variable for the frame. */
+ /* Declare a local variable for the frame. Force its size to be
+ DImode-compatible. */
HOST_WIDE_INT sz = get_frame_size ();
if (sz || cfun->machine->has_chain)
init_frame (file, FRAME_POINTER_REGNUM,
- crtl->stack_alignment_needed / BITS_PER_UNIT, sz);
+ crtl->stack_alignment_needed / BITS_PER_UNIT,
+ (sz + GET_MODE_SIZE (DImode) - 1)
+ & ~(HOST_WIDE_INT)(GET_MODE_SIZE (DImode) - 1));
/* Declare the pseudos we have as ptx registers. */
int maxregs = max_reg_num ();
@@ -3266,8 +3269,9 @@ nvptx_propagate (basic_block block, rtx_insn *insn, propagate_mask rw,
rtx pred = NULL_RTX;
rtx_code_label *label = NULL;
- gcc_assert (!(fs & (GET_MODE_SIZE (DImode) - 1)));
- fs /= GET_MODE_SIZE (DImode);
+ /* The frame size might not be DImode compatible, but the frame
+ array's declaration will be. So it's ok to round up here. */
+ fs = (fs + GET_MODE_SIZE (DImode) - 1) / GET_MODE_SIZE (DImode);
/* Detect single iteration loop. */
if (fs == 1)
fs = 0;