re PR target/90811 ([nvptx] ptxas error on OpenMP offloaded code)

PR target/90811
	* cfgexpand.c (align_local_variable): Add really_expand argument,
	don't SET_DECL_ALIGN if it is false.
	(add_stack_var): Add really_expand argument, pass it through to
	align_local_variable.
	(expand_one_stack_var_1): Pass true as really_expand to
	align_local_variable.
	(expand_one_ssa_partition): Pass true as really_expand to
	add_stack_var.
	(expand_one_var): Pass really_expand through to add_stack_var.

From-SVN: r272181
This commit is contained in:
Jakub Jelinek 2019-06-12 11:31:26 +02:00 committed by Jakub Jelinek
parent 84ae721396
commit 26d7a5e690
2 changed files with 25 additions and 7 deletions

View File

@ -1,3 +1,16 @@
2019-06-12 Jakub Jelinek <jakub@redhat.com>
PR target/90811
* cfgexpand.c (align_local_variable): Add really_expand argument,
don't SET_DECL_ALIGN if it is false.
(add_stack_var): Add really_expand argument, pass it through to
align_local_variable.
(expand_one_stack_var_1): Pass true as really_expand to
align_local_variable.
(expand_one_ssa_partition): Pass true as really_expand to
add_stack_var.
(expand_one_var): Pass really_expand through to add_stack_var.
2019-06-12 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
* config/arm/iterators.md (VABAL): New int iterator.

View File

@ -361,7 +361,7 @@ static bool has_short_buffer;
we can't do with expected alignment of the stack boundary. */
static unsigned int
align_local_variable (tree decl)
align_local_variable (tree decl, bool really_expand)
{
unsigned int align;
@ -370,7 +370,12 @@ align_local_variable (tree decl)
else
{
align = LOCAL_DECL_ALIGNMENT (decl);
SET_DECL_ALIGN (decl, align);
/* Don't change DECL_ALIGN when called from estimated_stack_frame_size.
That is done before IPA and could bump alignment based on host
backend even for offloaded code which wants different
LOCAL_DECL_ALIGNMENT. */
if (really_expand)
SET_DECL_ALIGN (decl, align);
}
return align / BITS_PER_UNIT;
}
@ -418,7 +423,7 @@ alloc_stack_frame_space (poly_int64 size, unsigned HOST_WIDE_INT align)
/* Accumulate DECL into STACK_VARS. */
static void
add_stack_var (tree decl)
add_stack_var (tree decl, bool really_expand)
{
struct stack_var *v;
@ -446,7 +451,7 @@ add_stack_var (tree decl)
variables that are simultaneously live. */
if (known_eq (v->size, 0U))
v->size = 1;
v->alignb = align_local_variable (decl);
v->alignb = align_local_variable (decl, really_expand);
/* An alignment of zero can mightily confuse us later. */
gcc_assert (v->alignb != 0);
@ -1323,7 +1328,7 @@ expand_one_stack_var_1 (tree var)
else
{
size = tree_to_poly_uint64 (DECL_SIZE_UNIT (var));
byte_align = align_local_variable (var);
byte_align = align_local_variable (var, true);
}
/* We handle highly aligned variables in expand_stack_vars. */
@ -1413,7 +1418,7 @@ expand_one_ssa_partition (tree var)
if (!use_register_for_decl (var))
{
if (defer_stack_allocation (var, true))
add_stack_var (var);
add_stack_var (var, true);
else
expand_one_stack_var_1 (var);
return;
@ -1695,7 +1700,7 @@ expand_one_var (tree var, bool toplevel, bool really_expand)
}
}
else if (defer_stack_allocation (var, toplevel))
add_stack_var (origvar);
add_stack_var (origvar, really_expand);
else
{
if (really_expand)