GCC Bugzilla – Attachment 41259 Details for
Bug 77728
[5 Regression] Miscompilation multiple vector iteration on ARM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
gcc7-pr77728.patch
gcc7-pr77728.patch (text/plain), 4.17 KB, created by
Jakub Jelinek
on 2017-04-24 17:59:31 UTC
(
hide
)
Description:
gcc7-pr77728.patch
Filename:
MIME Type:
Creator:
Jakub Jelinek
Created:
2017-04-24 17:59:31 UTC
Size:
4.17 KB
patch
obsolete
>--- gcc/config/arm/arm.c.jj 2017-04-20 11:50:41.242076889 +0200 >+++ gcc/config/arm/arm.c 2017-04-24 19:45:46.573047469 +0200 >@@ -81,7 +81,7 @@ struct four_ints > > /* Forward function declarations. */ > static bool arm_const_not_ok_for_debug_p (rtx); >-static bool arm_needs_doubleword_align (machine_mode, const_tree); >+static int arm_needs_doubleword_align (machine_mode, const_tree); > static int arm_compute_static_chain_stack_bytes (void); > static arm_stack_offsets *arm_get_frame_offsets (void); > static void arm_add_gc_roots (void); >@@ -6349,7 +6349,7 @@ aapcs_layout_arg (CUMULATIVE_ARGS *pcum, > /* C3 - For double-word aligned arguments, round the NCRN up to the > next even number. */ > ncrn = pcum->aapcs_ncrn; >- if ((ncrn & 1) && arm_needs_doubleword_align (mode, type)) >+ if ((ncrn & 1) && arm_needs_doubleword_align (mode, type) > 0) > ncrn++; > > nregs = ARM_NUM_REGS2(mode, type); >@@ -6455,12 +6455,16 @@ arm_init_cumulative_args (CUMULATIVE_ARG > } > } > >-/* Return true if mode/type need doubleword alignment. */ >-static bool >+/* Return 1 if double word alignment is required for argument passing. >+ Return -1 if double word alignment used to be required for argument >+ passing before PR77728 ABI fix, but is not required anymore. >+ Return 0 if double word alignment is not required and wasn't requried >+ before either. */ >+static int > arm_needs_doubleword_align (machine_mode mode, const_tree type) > { > if (!type) >- return PARM_BOUNDARY < GET_MODE_ALIGNMENT (mode); >+ return GET_MODE_ALIGNMENT (mode) > PARM_BOUNDARY; > > /* Scalar and vector types: Use natural alignment, i.e. of base type. */ > if (!AGGREGATE_TYPE_P (type)) >@@ -6470,12 +6474,21 @@ arm_needs_doubleword_align (machine_mode > if (TREE_CODE (type) == ARRAY_TYPE) > return TYPE_ALIGN (TREE_TYPE (type)) > PARM_BOUNDARY; > >+ int ret = 0; > /* Record/aggregate types: Use greatest member alignment of any member. */ > for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) > if (DECL_ALIGN (field) > PARM_BOUNDARY) >- return true; >+ { >+ if (TREE_CODE (field) == FIELD_DECL) >+ return 1; >+ else >+ /* Before PR77728 fix, we were incorrectly considering also >+ other aggregate fields, like VAR_DECLs, TYPE_DECLs etc. >+ Make sure we can warn about that with -Wpsabi. */ >+ ret = -1; >+ } > >- return false; >+ return ret; > } > > >@@ -6532,10 +6545,15 @@ arm_function_arg (cumulative_args_t pcum > } > > /* Put doubleword aligned quantities in even register pairs. */ >- if (pcum->nregs & 1 >- && ARM_DOUBLEWORD_ALIGN >- && arm_needs_doubleword_align (mode, type)) >- pcum->nregs++; >+ if ((pcum->nregs & 1) && ARM_DOUBLEWORD_ALIGN) >+ { >+ int res = arm_needs_doubleword_align (mode, type); >+ if (res < 0 && warn_psabi) >+ inform (input_location, "parameter passing for argument of type " >+ "%qT changed in GCC 7.1", type); >+ else if (res > 0) >+ pcum->nregs++; >+ } > > /* Only allow splitting an arg between regs and memory if all preceding > args were allocated to regs. For args passed by reference we only count >@@ -6554,9 +6572,15 @@ arm_function_arg (cumulative_args_t pcum > static unsigned int > arm_function_arg_boundary (machine_mode mode, const_tree type) > { >- return (ARM_DOUBLEWORD_ALIGN && arm_needs_doubleword_align (mode, type) >- ? DOUBLEWORD_ALIGNMENT >- : PARM_BOUNDARY); >+ if (!ARM_DOUBLEWORD_ALIGN) >+ return PARM_BOUNDARY; >+ >+ int res = arm_needs_doubleword_align (mode, type); >+ if (res < 0 && warn_psabi) >+ inform (input_location, "parameter passing for argument of type %qT " >+ "changed in GCC 7.1", type); >+ >+ return res > 0 ? DOUBLEWORD_ALIGNMENT : PARM_BOUNDARY; > } > > static int >@@ -26516,8 +26540,15 @@ arm_setup_incoming_varargs (cumulative_a > if (pcum->pcs_variant <= ARM_PCS_AAPCS_LOCAL) > { > nregs = pcum->aapcs_ncrn; >- if ((nregs & 1) && arm_needs_doubleword_align (mode, type)) >- nregs++; >+ if (nregs & 1) >+ { >+ int res = arm_needs_doubleword_align (mode, type); >+ if (res < 0 && warn_psabi) >+ inform (input_location, "parameter passing for argument of " >+ "type %qT changed in GCC 7.1", type); >+ else if (res > 0) >+ nregs++; >+ } > } > else > nregs = pcum->nregs;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 77728
:
41237
|
41254
|
41255
|
41257
|
41259
|
41261
|
41262
|
41263
|
41264