This commit is contained in:
Jakub Jelinek 2020-09-16 11:42:59 +02:00
parent 6358fb610c
commit d10315732b
8 changed files with 403 additions and 4 deletions

1
.gitignore vendored
View File

@ -16,3 +16,4 @@
/gcc-10.2.1-20200723.tar.xz /gcc-10.2.1-20200723.tar.xz
/gcc-10.2.1-20200804.tar.xz /gcc-10.2.1-20200804.tar.xz
/gcc-10.2.1-20200826.tar.xz /gcc-10.2.1-20200826.tar.xz
/gcc-10.2.1-20200916.tar.xz

View File

@ -1,10 +1,10 @@
%global DATE 20200826 %global DATE 20200916
%global gitrev c59c8927f43fb78d6a72a0ff93a47b36e43282d5 %global gitrev c65817433fde22de2a18a00be00c2c3d83228453
%global gcc_version 10.2.1 %global gcc_version 10.2.1
%global gcc_major 10 %global gcc_major 10
# Note, gcc_release must be integer, if you want to add suffixes to # Note, gcc_release must be integer, if you want to add suffixes to
# %%{release}, append them after %%{gcc_release} on Release: line. # %%{release}, append them after %%{gcc_release} on Release: line.
%global gcc_release 3 %global gcc_release 4
%global nvptx_tools_gitrev 5f6f343a302d620b0868edab376c00b15741e39e %global nvptx_tools_gitrev 5f6f343a302d620b0868edab376c00b15741e39e
%global newlib_cygwin_gitrev 50e2a63b04bdd018484605fbb954fd1bd5147fa0 %global newlib_cygwin_gitrev 50e2a63b04bdd018484605fbb954fd1bd5147fa0
%global _unpackaged_files_terminate_build 0 %global _unpackaged_files_terminate_build 0
@ -271,6 +271,11 @@ Patch11: gcc10-d-shared-libphobos.patch
Patch12: gcc10-pr96383.patch Patch12: gcc10-pr96383.patch
Patch13: gcc10-pr96385.patch Patch13: gcc10-pr96385.patch
Patch14: gcc10-pr96690.patch Patch14: gcc10-pr96690.patch
Patch15: gcc10-pr96939.patch
Patch16: gcc10-pr96939-2.patch
Patch17: gcc10-pr96939-3.patch
Patch18: gcc10-pr97032.patch
Patch19: gcc10-pr97060.patch
# On ARM EABI systems, we do want -gnueabi to be part of the # On ARM EABI systems, we do want -gnueabi to be part of the
# target triple. # target triple.
@ -785,6 +790,12 @@ to NVidia PTX capable devices if available.
%patch12 -p0 -b .pr96383~ %patch12 -p0 -b .pr96383~
%patch13 -p0 -b .pr96385~ %patch13 -p0 -b .pr96385~
%patch14 -p0 -b .pr96690~ %patch14 -p0 -b .pr96690~
%patch15 -p0 -b .pr96939~
%patch16 -p0 -b .pr96939-2~
%patch17 -p0 -b .pr96939-3~
%patch18 -p0 -b .pr97032~
%patch19 -p0 -b .pr97060~
find gcc/testsuite -name \*.pr96939~ | xargs rm -f
echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE echo 'Red Hat %{version}-%{gcc_release}' > gcc/DEV-PHASE
@ -3051,6 +3062,25 @@ end
%endif %endif
%changelog %changelog
* Wed Sep 16 2020 Jakub Jelinek <jakub@redhat.com> 10.2.1-4
- update from releases/gcc-10 branch
- PRs bootstrap/96203, c++/95164, c++/96862, c++/96901, d/96157, d/96924,
debug/93865, debug/94235, debug/96729, fortran/94690, fortran/95109,
fortran/95398, fortran/95882, fortran/96859, libstdc++/71960,
libstdc++/92978, libstdc++/96766, libstdc++/96851, lto/94311,
middle-end/87256, middle-end/96369, target/85830, target/94538,
target/96357, target/96551, target/96574, target/96744, target/96808,
target/97028, tree-optimization/88240, tree-optimization/96349,
tree-optimization/96370, tree-optimization/96514,
tree-optimization/96522, tree-optimization/96579,
tree-optimization/96597, tree-optimization/96820,
tree-optimization/96854, tree-optimization/97043
- fix up ARM target attribute/pragma handling (#1875814, PR target/96939)
- don't ICE on sp clobbers with -mincoming-stack-boundary=2 on ia32
(#1862029, PR target/97032)
- emit DW_AT_declaration on DIEs for external FUNCTION_DECLs without body
(PR debug/97060)
* Wed Aug 26 2020 Jakub Jelinek <jakub@redhat.com> 10.2.1-3 * Wed Aug 26 2020 Jakub Jelinek <jakub@redhat.com> 10.2.1-3
- update from releases/gcc-10 branch - update from releases/gcc-10 branch
- PRs c++/95428, c++/96082, c++/96106, c++/96164, c++/96199, c++/96497, - PRs c++/95428, c++/96082, c++/96106, c++/96164, c++/96199, c++/96497,

51
gcc10-pr96939-2.patch Normal file
View File

@ -0,0 +1,51 @@
2020-09-09 Jakub Jelinek <jakub@redhat.com>
* config/arm/arm.c (arm_override_options_after_change_1): Add opts_set
argument, test opts_set->x_str_align_functions rather than
opts->x_str_align_functions.
(arm_override_options_after_change, arm_option_override_internal,
arm_set_current_function): Adjust callers.
--- gcc/config/arm/arm.c.jj 2020-09-09 09:19:42.911419411 +0200
+++ gcc/config/arm/arm.c 2020-09-09 09:28:02.392897384 +0200
@@ -3024,10 +3024,11 @@ static GTY(()) bool thumb_flipper;
static GTY(()) tree init_optimize;
static void
-arm_override_options_after_change_1 (struct gcc_options *opts)
+arm_override_options_after_change_1 (struct gcc_options *opts,
+ struct gcc_options *opts_set)
{
/* -falign-functions without argument: supply one. */
- if (opts->x_flag_align_functions && !opts->x_str_align_functions)
+ if (opts->x_flag_align_functions && !opts_set->x_str_align_functions)
opts->x_str_align_functions = TARGET_THUMB_P (opts->x_target_flags)
&& opts->x_optimize_size ? "2" : "4";
}
@@ -3037,7 +3038,7 @@ arm_override_options_after_change_1 (str
static void
arm_override_options_after_change (void)
{
- arm_override_options_after_change_1 (&global_options);
+ arm_override_options_after_change_1 (&global_options, &global_options_set);
}
/* Implement TARGET_OPTION_SAVE. */
@@ -3065,7 +3066,7 @@ static void
arm_option_override_internal (struct gcc_options *opts,
struct gcc_options *opts_set)
{
- arm_override_options_after_change_1 (opts);
+ arm_override_options_after_change_1 (opts, opts_set);
if (TARGET_INTERWORK && !bitmap_bit_p (arm_active_target.isa, isa_bit_thumb))
{
@@ -32335,7 +32336,7 @@ arm_set_current_function (tree fndecl)
save_restore_target_globals (new_tree);
- arm_override_options_after_change_1 (&global_options);
+ arm_override_options_after_change_1 (&global_options, &global_options_set);
}
/* Implement TARGET_OPTION_PRINT. */

111
gcc10-pr96939-3.patch Normal file
View File

@ -0,0 +1,111 @@
2020-09-13 Jakub Jelinek <jakub@redhat.com>
* config/arm/arm.opt (arm_arch_specified, arm_cpu_specified,
arm_tune_specified): New TargetVariables.
* config/arm/arm.c (arm_configure_build_target): Comment out
opts_set argument name. Use opts->x_arm_*_specified instead
of opts_set->x_arm_*_string.
* common/config/arm/arm-common.c (arm_handle_option): New function.
(TARGET_HANDLE_OPTION): Redefine.
--- gcc/config/arm/arm.opt.jj 2020-09-12 13:36:27.619716335 +0200
+++ gcc/config/arm/arm.opt 2020-09-12 13:38:48.547661292 +0200
@@ -30,6 +30,15 @@ const char *x_arm_cpu_string
TargetSave
const char *x_arm_tune_string
+TargetVariable
+unsigned char arm_arch_specified = 0
+
+TargetVariable
+unsigned char arm_cpu_specified = 0
+
+TargetVariable
+unsigned char arm_tune_specified = 0
+
Enum
Name(tls_type) Type(enum arm_tls_type)
TLS dialect to use:
--- gcc/config/arm/arm.c.jj 2020-09-12 13:36:27.619716335 +0200
+++ gcc/config/arm/arm.c 2020-09-12 13:49:26.166363387 +0200
@@ -3181,7 +3181,7 @@ static sbitmap isa_quirkbits;
void
arm_configure_build_target (struct arm_build_target *target,
struct cl_target_option *opts,
- struct gcc_options *opts_set,
+ struct gcc_options */* opts_set */,
bool warn_compatible)
{
const cpu_option *arm_selected_tune = NULL;
@@ -3196,7 +3196,7 @@ arm_configure_build_target (struct arm_b
target->core_name = NULL;
target->arch_name = NULL;
- if (opts_set->x_arm_arch_string)
+ if (opts->x_arm_arch_specified)
{
arm_selected_arch = arm_parse_arch_option_name (all_architectures,
"-march",
@@ -3204,7 +3204,7 @@ arm_configure_build_target (struct arm_b
arch_opts = strchr (opts->x_arm_arch_string, '+');
}
- if (opts_set->x_arm_cpu_string)
+ if (opts->x_arm_cpu_specified)
{
arm_selected_cpu = arm_parse_cpu_option_name (all_cores, "-mcpu",
opts->x_arm_cpu_string);
@@ -3214,7 +3214,7 @@ arm_configure_build_target (struct arm_b
options for tuning. */
}
- if (opts_set->x_arm_tune_string)
+ if (opts->x_arm_tune_specified)
{
arm_selected_tune = arm_parse_cpu_option_name (all_cores, "-mtune",
opts->x_arm_tune_string);
--- gcc/common/config/arm/arm-common.c.jj 2020-07-28 15:39:09.705760394 +0200
+++ gcc/common/config/arm/arm-common.c 2020-09-12 13:50:09.021738456 +0200
@@ -1021,6 +1021,34 @@ arm_asm_auto_mfpu (int argc, const char
#undef ARM_CPU_NAME_LENGTH
+bool
+arm_handle_option (struct gcc_options *opts,
+ struct gcc_options *opts_set ATTRIBUTE_UNUSED,
+ const struct cl_decoded_option *decoded,
+ location_t loc ATTRIBUTE_UNUSED)
+{
+ size_t code = decoded->opt_index;
+ const char *arg = decoded->arg;
+ int val = decoded->value;
+
+ switch (code)
+ {
+ case OPT_march_:
+ opts->x_arm_arch_specified = true;
+ return true;
+
+ case OPT_mcpu_:
+ opts->x_arm_cpu_specified = true;
+ return true;
+
+ case OPT_mtune_:
+ opts->x_arm_tune_specified = true;
+ return true;
+
+ default:
+ return true;
+ }
+}
#undef TARGET_DEFAULT_TARGET_FLAGS
#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_SCHED_PROLOG)
@@ -1031,4 +1059,7 @@ arm_asm_auto_mfpu (int argc, const char
#undef TARGET_EXCEPT_UNWIND_INFO
#define TARGET_EXCEPT_UNWIND_INFO arm_except_unwind_info
+#undef TARGET_HANDLE_OPTION
+#define TARGET_HANDLE_OPTION arm_handle_option
+
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;

64
gcc10-pr96939.patch Normal file
View File

@ -0,0 +1,64 @@
2020-09-07 Jakub Jelinek <jakub@redhat.com>
PR target/96939
* config/arm/arm.c (arm_override_options_after_change): Don't call
arm_configure_build_target here.
(arm_set_current_function): Call arm_override_options_after_change_1
at the end.
* gcc.target/arm/lto/pr96939_0.c: New test.
* gcc.target/arm/lto/pr96939_1.c: New file.
--- gcc/config/arm/arm.c.jj 2020-07-30 15:04:38.136293101 +0200
+++ gcc/config/arm/arm.c 2020-09-07 10:43:54.809561852 +0200
@@ -3037,10 +3037,6 @@ arm_override_options_after_change_1 (str
static void
arm_override_options_after_change (void)
{
- arm_configure_build_target (&arm_active_target,
- TREE_TARGET_OPTION (target_option_default_node),
- &global_options_set, false);
-
arm_override_options_after_change_1 (&global_options);
}
@@ -32338,6 +32334,8 @@ arm_set_current_function (tree fndecl)
cl_target_option_restore (&global_options, TREE_TARGET_OPTION (new_tree));
save_restore_target_globals (new_tree);
+
+ arm_override_options_after_change_1 (&global_options);
}
/* Implement TARGET_OPTION_PRINT. */
--- gcc/testsuite/gcc.target/arm/lto/pr96939_0.c.jj 2020-09-07 11:26:45.909937609 +0200
+++ gcc/testsuite/gcc.target/arm/lto/pr96939_0.c 2020-09-07 11:29:18.722706535 +0200
@@ -0,0 +1,15 @@
+/* PR target/96939 */
+/* { dg-lto-do link } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
+/* { dg-lto-options { { -flto -O2 } } } */
+
+extern unsigned crc (unsigned, const void *);
+typedef unsigned (*fnptr) (unsigned, const void *);
+volatile fnptr fn;
+
+int
+main ()
+{
+ fn = crc;
+ return 0;
+}
--- gcc/testsuite/gcc.target/arm/lto/pr96939_1.c.jj 2020-09-07 11:26:49.365887153 +0200
+++ gcc/testsuite/gcc.target/arm/lto/pr96939_1.c 2020-09-07 11:25:13.885281180 +0200
@@ -0,0 +1,10 @@
+/* PR target/96939 */
+/* { dg-options "-march=armv8-a+crc" } */
+
+#include <arm_acle.h>
+
+unsigned
+crc (unsigned x, const void *y)
+{
+ return __crc32cw (x, *(unsigned *) y);
+}

89
gcc10-pr97032.patch Normal file
View File

@ -0,0 +1,89 @@
2020-09-14 H.J. Lu <hjl.tools@gmail.com>
PR target/97032
* cfgexpand.c (asm_clobber_reg_kind): Set sp_is_clobbered_by_asm
to true if the stack pointer is clobbered by asm statement.
* emit-rtl.h (rtl_data): Add sp_is_clobbered_by_asm.
* config/i386/i386.c (ix86_get_drap_rtx): Set need_drap to true
if the stack pointer is clobbered by asm statement.
* gcc.target/i386/pr97032.c: New test.
--- gcc/cfgexpand.c
+++ gcc/cfgexpand.c
@@ -2879,11 +2879,15 @@ asm_clobber_reg_is_valid (int regno, int nregs, const char *regname)
as it was before, so no asm can validly clobber the stack pointer in
the usual sense. Adding the stack pointer to the clobber list has
traditionally had some undocumented and somewhat obscure side-effects. */
- if (overlaps_hard_reg_set_p (regset, Pmode, STACK_POINTER_REGNUM)
- && warning (OPT_Wdeprecated, "listing the stack pointer register"
- " %qs in a clobber list is deprecated", regname))
- inform (input_location, "the value of the stack pointer after an %<asm%>"
- " statement must be the same as it was before the statement");
+ if (overlaps_hard_reg_set_p (regset, Pmode, STACK_POINTER_REGNUM))
+ {
+ crtl->sp_is_clobbered_by_asm = true;
+ if (warning (OPT_Wdeprecated, "listing the stack pointer register"
+ " %qs in a clobber list is deprecated", regname))
+ inform (input_location, "the value of the stack pointer after"
+ " an %<asm%> statement must be the same as it was before"
+ " the statement");
+ }
return is_valid;
}
--- gcc/config/i386/i386.c
+++ gcc/config/i386/i386.c
@@ -12283,10 +12283,12 @@ ix86_update_stack_boundary (void)
static rtx
ix86_get_drap_rtx (void)
{
- /* We must use DRAP if there are outgoing arguments on stack and
+ /* We must use DRAP if there are outgoing arguments on stack or
+ the stack pointer register is clobbered by asm statment and
ACCUMULATE_OUTGOING_ARGS is false. */
if (ix86_force_drap
- || (cfun->machine->outgoing_args_on_stack
+ || ((cfun->machine->outgoing_args_on_stack
+ || crtl->sp_is_clobbered_by_asm)
&& !ACCUMULATE_OUTGOING_ARGS))
crtl->need_drap = true;
--- gcc/emit-rtl.h
+++ gcc/emit-rtl.h
@@ -266,6 +266,9 @@ struct GTY(()) rtl_data {
pass_stack_ptr_mod has run. */
bool sp_is_unchanging;
+ /* True if the stack pointer is clobbered by asm statement. */
+ bool sp_is_clobbered_by_asm;
+
/* Nonzero if function being compiled doesn't contain any calls
(ignoring the prologue and epilogue). This is set prior to
register allocation in IRA and is valid for the remaining
--- gcc/testsuite/gcc.target/i386/pr97032.c
+++ gcc/testsuite/gcc.target/i386/pr97032.c
@@ -0,0 +1,23 @@
+/* { dg-do compile { target { ia32 && fstack_protector } } } */
+/* { dg-options "-O2 -mincoming-stack-boundary=2 -fstack-protector-all" } */
+
+#include <stdarg.h>
+
+extern int *__errno_location (void);
+
+long
+sys_socketcall (int op, ...)
+{
+ long int res;
+ va_list ap;
+ va_start (ap, op);
+ asm volatile ("push %%ebx; movl %2, %%ebx; int $0x80; pop %%ebx"
+ /* { dg-warning "listing the stack pointer register" "" { target *-*-* } .-1 } */
+ : "=a" (res) : "0" (102), "ri" (16), "c" (ap) : "memory", "esp");
+ if (__builtin_expect (res > 4294963200UL, 0))
+ *__errno_location () = -res;
+ va_end (ap);
+ return res;
+}
+
+/* { dg-final { scan-assembler "call\[ \t\]*_?__errno_location" } } */

53
gcc10-pr97060.patch Normal file
View File

@ -0,0 +1,53 @@
2020-09-16 Jakub Jelinek <jakub@redhat.com>
PR debug/97060
* dwarf2out.c (dwarf2out_early_global_decl): For FUNCTION_DECLs
and their abstract origins, if they don't have gimple body,
set current_function_decl to NULL rather than the decl or origin.
* gcc.dg/debug/dwarf2/pr97060.c: New test.
--- gcc/dwarf2out.c.jj 2020-09-07 13:17:58.383594248 +0200
+++ gcc/dwarf2out.c 2020-09-16 11:14:57.763550862 +0200
@@ -26547,7 +26547,11 @@ dwarf2out_early_global_decl (tree decl)
&& ((origin_die = lookup_decl_die (origin)) == NULL
|| is_declaration_die (origin_die)))
{
- current_function_decl = origin;
+ cgraph_node *cnode = cgraph_node::get (origin);
+ if (cnode && cnode->has_gimple_body_p ())
+ current_function_decl = origin;
+ else
+ current_function_decl = NULL_TREE;
dwarf2out_decl (origin);
}
@@ -26556,7 +26560,11 @@ dwarf2out_early_global_decl (tree decl)
if ((old_die = lookup_decl_die (decl)) == NULL
|| is_declaration_die (old_die))
{
- current_function_decl = decl;
+ cgraph_node *cnode = cgraph_node::get (decl);
+ if (cnode && cnode->has_gimple_body_p ())
+ current_function_decl = decl;
+ else
+ current_function_decl = NULL_TREE;
dwarf2out_decl (decl);
}
--- gcc/testsuite/gcc.dg/debug/dwarf2/pr97060.c.jj 2020-09-16 11:03:22.358420449 +0200
+++ gcc/testsuite/gcc.dg/debug/dwarf2/pr97060.c 2020-09-16 11:03:17.717486318 +0200
@@ -0,0 +1,13 @@
+/* PR debug/97060 */
+/* { dg-do compile } */
+/* { dg-options "-g -dA" } */
+/* { dg-final { scan-assembler-times "DW_AT_declaration" 2 } } */
+
+extern int foo (unsigned int, unsigned int);
+
+int
+bar (void)
+{
+ foo (1, 2);
+ return 0;
+}

View File

@ -1,3 +1,3 @@
SHA512 (gcc-10.2.1-20200826.tar.xz) = b6949ea780618400dec06b8fc7b2728414d46e5972970ed70949ce16100547e4a9a6a5ce84ae1f47309a0610607b5454b0acc5fe5ecbb2889c84346bcdbdc8ab SHA512 (gcc-10.2.1-20200916.tar.xz) = 1dd5ef9b6eb785e8356751b198462f61ed6a06b460285f4ddf274a85ed79a452723fd71b6bf5eb3c68821bf798299a1a352481e265e61bd836976927187879e5
SHA512 (newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz) = 002a48a7b689a81abbf16161bcaec001a842e67dfbe372e9e109092703bfc666675f16198f60ca429370e8850d564547dc505df81bc3aaca4ce6defbc014ad6c SHA512 (newlib-cygwin-50e2a63b04bdd018484605fbb954fd1bd5147fa0.tar.xz) = 002a48a7b689a81abbf16161bcaec001a842e67dfbe372e9e109092703bfc666675f16198f60ca429370e8850d564547dc505df81bc3aaca4ce6defbc014ad6c
SHA512 (nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz) = f6d10db94fa1570ae0f94df073fa3c73c8e5ee16d59070b53d94f7db0de8a031bc44d7f3f1852533da04b625ce758e022263855ed43cfc6867e0708d001e53c7 SHA512 (nvptx-tools-5f6f343a302d620b0868edab376c00b15741e39e.tar.xz) = f6d10db94fa1570ae0f94df073fa3c73c8e5ee16d59070b53d94f7db0de8a031bc44d7f3f1852533da04b625ce758e022263855ed43cfc6867e0708d001e53c7