From: rsandifo Date: Wed, 3 Jan 2018 07:17:52 +0000 (+0000) Subject: poly_int: expand_expr_real_1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=198b2de5f7157ec8ee193db161dac4a3bc2ef04b;p=thirdparty%2Fgcc.git poly_int: expand_expr_real_1 This patch makes the VIEW_CONVERT_EXPR handling in expand_expr_real_1 cope with polynomial type and mode sizes. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood gcc/ * expr.c (expand_expr_real_1): Use tree_to_poly_uint64 instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs via stack temporaries. Treat the mode size as polynomial too. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256152 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6cef62278cea..37737bcabd99 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-01-03 Richard Sandiford + Alan Hayward + David Sherwood + + * expr.c (expand_expr_real_1): Use tree_to_poly_uint64 + instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs + via stack temporaries. Treat the mode size as polynomial too. + 2018-01-03 Richard Sandiford Alan Hayward David Sherwood diff --git a/gcc/expr.c b/gcc/expr.c index abab83136d3b..a82d9e41ae22 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -11132,9 +11132,10 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode, else if (STRICT_ALIGNMENT) { tree inner_type = TREE_TYPE (treeop0); - HOST_WIDE_INT temp_size - = MAX (int_size_in_bytes (inner_type), - (HOST_WIDE_INT) GET_MODE_SIZE (mode)); + poly_uint64 mode_size = GET_MODE_SIZE (mode); + poly_uint64 op0_size + = tree_to_poly_uint64 (TYPE_SIZE_UNIT (inner_type)); + poly_int64 temp_size = upper_bound (op0_size, mode_size); rtx new_rtx = assign_stack_temp_for_type (mode, temp_size, type); rtx new_with_op0_mode