From 967fa9b1418eb3a9142fdb0159ce0852deb1a4c3 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 8 Mar 2022 17:59:34 +0100 Subject: [PATCH] 12.0.1-0.12 --- gcc.spec | 10 ++++++- gcc12-pr104777.patch | 61 ++++++++++++++++++++++++++++++++++++++ gcc12-pr104839.patch | 70 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 gcc12-pr104777.patch create mode 100644 gcc12-pr104839.patch diff --git a/gcc.spec b/gcc.spec index f690086..df07676 100644 --- a/gcc.spec +++ b/gcc.spec @@ -120,7 +120,7 @@ Summary: Various compilers (C, C++, Objective-C, ...) Name: gcc Version: %{gcc_version} -Release: %{gcc_release}.11%{?dist} +Release: %{gcc_release}.12%{?dist} # libgcc, libgfortran, libgomp, libstdc++ and crtstuff have # GCC Runtime Exception. License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD @@ -271,6 +271,8 @@ Patch9: gcc12-Wno-format-security.patch Patch10: gcc12-rh1574936.patch Patch11: gcc12-d-shared-libphobos.patch Patch12: gcc12-pr104781.patch +Patch13: gcc12-pr104777.patch +Patch14: gcc12-pr104839.patch Patch100: gcc12-fortran-fdec-duplicates.patch Patch101: gcc12-fortran-flogical-as-integer.patch @@ -793,6 +795,8 @@ to NVidia PTX capable devices if available. %endif %patch11 -p0 -b .d-shared-libphobos~ %patch12 -p0 -b .pr104781~ +%patch13 -p0 -b .pr104777~ +%patch14 -p0 -b .pr104839~ %if 0%{?rhel} >= 9 %patch100 -p1 -b .fortran-fdec-duplicates~ @@ -3166,6 +3170,10 @@ end %endif %changelog +* Tue Mar 8 2022 Jakub Jelinek 12.0.1-0.12 +- fix up promoted SUBREG handling (#2045160, PR rtl-optimization/104839) +- fix up check for asm goto (PR rtl-optimization/104777) + * Tue Mar 8 2022 Jakub Jelinek 12.0.1-0.11 - update from trunk - PRs analyzer/101983, fortran/99585, fortran/104430, libstdc++/104807, diff --git a/gcc12-pr104777.patch b/gcc12-pr104777.patch new file mode 100644 index 0000000..1e541dd --- /dev/null +++ b/gcc12-pr104777.patch @@ -0,0 +1,61 @@ +2022-03-08 Marek Polacek + + PR rtl-optimization/104777 + * rtl.cc (classify_insn): For ASM_OPERANDS, return JUMP_INSN only if + ASM_OPERANDS_LABEL_VEC has at least one element. + + * gcc.dg/torture/tls/pr104777.c: New test. + +--- gcc/rtl.cc ++++ gcc/rtl.cc +@@ -765,7 +765,7 @@ classify_insn (rtx x) + return CALL_INSN; + if (ANY_RETURN_P (x)) + return JUMP_INSN; +- if (GET_CODE (x) == ASM_OPERANDS && ASM_OPERANDS_LABEL_VEC (x)) ++ if (GET_CODE (x) == ASM_OPERANDS && ASM_OPERANDS_LABEL_LENGTH (x)) + return JUMP_INSN; + if (GET_CODE (x) == SET) + { +@@ -794,7 +794,7 @@ classify_insn (rtx x) + if (has_return_p) + return JUMP_INSN; + if (GET_CODE (XVECEXP (x, 0, 0)) == ASM_OPERANDS +- && ASM_OPERANDS_LABEL_VEC (XVECEXP (x, 0, 0))) ++ && ASM_OPERANDS_LABEL_LENGTH (XVECEXP (x, 0, 0))) + return JUMP_INSN; + } + #ifdef GENERATOR_FILE +--- gcc/testsuite/gcc.dg/torture/tls/pr104777.c ++++ gcc/testsuite/gcc.dg/torture/tls/pr104777.c +@@ -0,0 +1,30 @@ ++/* PR rtl-optimization/104777 */ ++/* { dg-do compile } */ ++/* { dg-require-effective-target tls } */ ++ ++int savestate_r; ++int savestate_ssb; ++extern void abort(); ++__thread int loop; ++void f (void) ++{ ++ int savestate_r0_5; ++ int savestate_r1_6; ++ ++ __asm__("" : "=m" (savestate_ssb), "=r" (savestate_r)); ++ savestate_r0_5 = savestate_r; ++ if (savestate_r0_5 == 0) ++ { ++ __asm__ __volatile__("" : : "m" (loop)); ++ abort (); ++ } ++ ++ __asm__("" : "=m" (savestate_ssb), "=r" (savestate_r)); ++ savestate_r1_6 = savestate_r; ++ if (savestate_r1_6 != 0) ++ return; ++ ++ __asm__ __volatile__("" : : "m" (loop)); ++ abort (); ++ ++} diff --git a/gcc12-pr104839.patch b/gcc12-pr104839.patch new file mode 100644 index 0000000..e9f432a --- /dev/null +++ b/gcc12-pr104839.patch @@ -0,0 +1,70 @@ +2022-03-08 Jakub Jelinek + + PR rtl-optimization/104839 + * simplify-rtx.cc (simplify_unary_operation_1) : + Use SRP_SIGNED instead of incorrect 1 in SUBREG_PROMOTED_SET. + (simplify_unary_operation_1) : Use SRP_UNSIGNED + instead of incorrect 0 in SUBREG_PROMOTED_SET. + + * gcc.c-torture/execute/pr104839.c: New test. + +--- gcc/simplify-rtx.cc.jj 2022-02-23 09:17:04.000000000 +0100 ++++ gcc/simplify-rtx.cc 2022-03-08 16:31:20.823246404 +0100 +@@ -1527,7 +1527,7 @@ simplify_context::simplify_unary_operati + if (partial_subreg_p (temp)) + { + SUBREG_PROMOTED_VAR_P (temp) = 1; +- SUBREG_PROMOTED_SET (temp, 1); ++ SUBREG_PROMOTED_SET (temp, SRP_SIGNED); + } + return temp; + } +@@ -1662,7 +1662,7 @@ simplify_context::simplify_unary_operati + if (partial_subreg_p (temp)) + { + SUBREG_PROMOTED_VAR_P (temp) = 1; +- SUBREG_PROMOTED_SET (temp, 0); ++ SUBREG_PROMOTED_SET (temp, SRP_UNSIGNED); + } + return temp; + } +--- gcc/testsuite/gcc.c-torture/execute/pr104839.c.jj 2022-03-08 16:46:51.418440078 +0100 ++++ gcc/testsuite/gcc.c-torture/execute/pr104839.c 2022-03-08 16:46:27.044774203 +0100 +@@ -0,0 +1,37 @@ ++/* PR rtl-optimization/104839 */ ++ ++__attribute__((noipa)) short ++foo (void) ++{ ++ return -1; ++} ++ ++__attribute__((noipa)) int ++bar (void) ++{ ++ short i = foo (); ++ if (i == -2) ++ return 2; ++ long k = i; ++ int j = -1; ++ volatile long s = 300; ++ if (k < 0) ++ { ++ k += s; ++ if (k < 0) ++ j = 0; ++ } ++ else if (k >= s) ++ j = 0; ++ if (j != -1) ++ return 1; ++ return 0; ++} ++ ++int ++main () ++{ ++ if (bar () != 0) ++ __builtin_abort (); ++ return 0; ++}