This commit is contained in:
Jakub Jelinek 2018-03-03 15:56:22 +01:00
parent 872459a238
commit 153fd5db2c
5 changed files with 147 additions and 186 deletions

1
.gitignore vendored
View File

@ -29,3 +29,4 @@
/gcc-7.2.1-20180117.tar.bz2
/gcc-7.3.1-20180125.tar.bz2
/gcc-7.3.1-20180130.tar.bz2
/gcc-7.3.1-20180303.tar.bz2

View File

@ -237,7 +237,7 @@ Patch10: gcc7-foffload-default.patch
Patch11: gcc7-Wno-format-security.patch
Patch12: gcc7-aarch64-sanitizer-fix.patch
Patch13: gcc7-rh1512529-aarch64.patch
Patch14: gcc7-pr84064.patch
Patch14: gcc7-pr84524.patch
Patch1000: nvptx-tools-no-ptxas.patch
Patch1001: nvptx-tools-build.patch
@ -261,6 +261,23 @@ Patch1002: nvptx-tools-glibc.patch
%global gcc_target_platform %{_target_platform}
%endif
%if %{?fedora} >= 27
%if %{build_go}
# Avoid stripping these libraries and binaries.
%global __os_install_post \
chmod 644 %{buildroot}%{_prefix}/%{_lib}/libgo.so.11.* \
chmod 644 %{buildroot}%{_prefix}/bin/go.gcc \
chmod 644 %{buildroot}%{_prefix}/bin/gofmt.gcc \
chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo \
%__os_install_post \
chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgo.so.11.* \
chmod 755 %{buildroot}%{_prefix}/bin/go.gcc \
chmod 755 %{buildroot}%{_prefix}/bin/gofmt.gcc \
chmod 755 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo \
%{nil}
%endif
%endif
%description
The gcc package contains the GNU Compiler Collection version 7.
You'll need this package in order to compile C code.
@ -833,7 +850,7 @@ package or when debugging this package.
%patch12 -p0 -b .aarch64-sanitizer-fix~
%endif
%patch13 -p0 -b .rh1512529-aarch64~
%patch14 -p0 -b .pr84064~
%patch14 -p0 -b .pr84524~
cd nvptx-tools-%{nvptx_tools_gitrev}
%patch1000 -p1 -b .nvptx-tools-no-ptxas~
@ -1951,15 +1968,7 @@ chmod 755 %{buildroot}%{_prefix}/%{_lib}/libtsan.so.0.*
chmod 755 %{buildroot}%{_prefix}/%{_lib}/liblsan.so.0.*
%endif
%if %{build_go}
%if 0%{?fedora} < 27
chmod 755 %{buildroot}%{_prefix}/%{_lib}/libgo.so.11.*
%else
# Avoid stripping these libraries and binaries.
chmod 644 %{buildroot}%{_prefix}/%{_lib}/libgo.so.11.*
chmod 644 %{buildroot}%{_prefix}/bin/go.gcc
chmod 644 %{buildroot}%{_prefix}/bin/gofmt.gcc
chmod 644 %{buildroot}%{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_major}/cgo
%endif
%endif
chmod 755 %{buildroot}%{_prefix}/%{_lib}/libobjc.so.4.*
@ -3261,6 +3270,36 @@ fi
%endif
%changelog
* Sat Feb 3 2018 Jakub Jelinek <jakub@redhat.com> 7.3.1-3
- update from the 7 branch
- PRs ada/84277, bootstrap/80867, bootstrap/82916, bootstrap/84017,
c++/71569, c++/71784, c++/81589, c++/81853, c++/81860, c++/82664,
c++/82764, c++/83227, c++/83659, c++/83817, c++/83824, c++/83835,
c++/83958, c++/83990, c++/83993, c++/84015, c++/84031, c++/84045,
c++/84082, c++/84151, c++/84192, c++/84341, c++/84420, c++/84430,
c++/84441, c++/84444, c++/84445, c++/84448, c++/84449, c++/84489,
c++/84496, c++/84520, c++/84556, c++/84557, c++/84558, c/82210,
fortran/30792, fortran/35299, fortran/54223, fortran/68560,
fortran/78238, fortran/81116, fortran/82007, fortran/82049,
fortran/82994, fortran/83633, fortran/84116, fortran/84270,
fortran/84276, fortran/84346, fortran/84418, fortran/84495,
fortran/84506, fortran/84511, inline-asm/84625, ipa/84425, ipa/84628,
libgfortran/84412, libgomp/84096, libstdc++/81797, libstdc++/84532,
libstdc++/84671, middle-end/83945, middle-end/83977, middle-end/84040,
preprocessor/69869, preprocessor/83722, rtl-optimization/83496,
rtl-optimization/83986, rtl-optimization/84071,
rtl-optimization/84123, rtl-optimization/84308, sanitizer/70875,
sanitizer/83987, sanitizer/84285, target/56010, target/79242,
target/79975, target/81228, target/82096, target/83370, target/83743,
target/83758, target/83790, target/83930, target/84039, target/84089,
target/84113, target/84154, target/84279, target/84388, target/84390,
target/84530, target/PR84295, tree-optimization/81661,
tree-optimization/82795, tree-optimization/83605,
tree-optimization/84117, tree-optimization/84190,
tree-optimization/84233, tree-optimization/84503
- fix AVX512BW wrong-code bug (PR target/84524)
- fix go provides/requires (#1545071)
* Tue Jan 30 2018 Jakub Jelinek <jakub@redhat.com> 7.3.1-2
- update from the 7 branch
- PRs c++/82461, c++/82878, libstdc++/81076, libstdc++/83658,

View File

@ -1,175 +0,0 @@
2018-01-30 Jeff Law <law@redhat.com>
PR target/84064
* i386.c (ix86_adjust_stack_and_probe_stack_clash): New argument
INT_REGISTERS_SAVED. Check it prior to calling
get_scratch_register_on_entry.
(ix86_adjust_stack_and_probe): Similarly.
(ix86_emit_probe_stack_range): Similarly.
(ix86_expand_prologue): Corresponding changes.
* gcc.target/i386/pr84064: New test.
--- gcc/config/i386/i386.c
+++ gcc/config/i386/i386.c
@@ -12591,10 +12591,14 @@ release_scratch_register_on_entry (struct scratch_reg *sr)
This differs from the next routine in that it tries hard to prevent
attacks that jump the stack guard. Thus it is never allowed to allocate
more than PROBE_INTERVAL bytes of stack space without a suitable
- probe. */
+ probe.
+
+ INT_REGISTERS_SAVED is true if integer registers have already been
+ pushed on the stack. */
static void
-ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size)
+ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size,
+ const bool int_registers_saved)
{
struct machine_function *m = cfun->machine;
@@ -12700,6 +12704,12 @@ ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size)
}
else
{
+ /* We expect the GP registers to be saved when probes are used
+ as the probing sequences might need a scratch register and
+ the routine to allocate one assumes the integer registers
+ have already been saved. */
+ gcc_assert (int_registers_saved);
+
struct scratch_reg sr;
get_scratch_register_on_entry (&sr);
@@ -12758,10 +12768,14 @@ ix86_adjust_stack_and_probe_stack_clash (const HOST_WIDE_INT size)
emit_insn (gen_blockage ());
}
-/* Emit code to adjust the stack pointer by SIZE bytes while probing it. */
+/* Emit code to adjust the stack pointer by SIZE bytes while probing it.
+
+ INT_REGISTERS_SAVED is true if integer registers have already been
+ pushed on the stack. */
static void
-ix86_adjust_stack_and_probe (const HOST_WIDE_INT size)
+ix86_adjust_stack_and_probe (const HOST_WIDE_INT size,
+ const bool int_registers_saved)
{
/* We skip the probe for the first interval + a small dope of 4 words and
probe that many bytes past the specified size to maintain a protection
@@ -12822,6 +12836,12 @@ ix86_adjust_stack_and_probe (const HOST_WIDE_INT size)
equality test for the loop condition. */
else
{
+ /* We expect the GP registers to be saved when probes are used
+ as the probing sequences might need a scratch register and
+ the routine to allocate one assumes the integer registers
+ have already been saved. */
+ gcc_assert (int_registers_saved);
+
HOST_WIDE_INT rounded_size;
struct scratch_reg sr;
@@ -12949,10 +12969,14 @@ output_adjust_stack_and_probe (rtx reg)
}
/* Emit code to probe a range of stack addresses from FIRST to FIRST+SIZE,
- inclusive. These are offsets from the current stack pointer. */
+ inclusive. These are offsets from the current stack pointer.
+
+ INT_REGISTERS_SAVED is true if integer registers have already been
+ pushed on the stack. */
static void
-ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
+ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size,
+ const bool int_registers_saved)
{
/* See if we have a constant small number of probes to generate. If so,
that's the easy case. The run-time loop is made up of 6 insns in the
@@ -12980,6 +13004,12 @@ ix86_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
equality test for the loop condition. */
else
{
+ /* We expect the GP registers to be saved when probes are used
+ as the probing sequences might need a scratch register and
+ the routine to allocate one assumes the integer registers
+ have already been saved. */
+ gcc_assert (int_registers_saved);
+
HOST_WIDE_INT rounded_size, last;
struct scratch_reg sr;
@@ -13733,15 +13763,10 @@ ix86_expand_prologue (void)
&& (flag_stack_check == STATIC_BUILTIN_STACK_CHECK
|| flag_stack_clash_protection))
{
- /* We expect the GP registers to be saved when probes are used
- as the probing sequences might need a scratch register and
- the routine to allocate one assumes the integer registers
- have already been saved. */
- gcc_assert (int_registers_saved);
-
if (flag_stack_clash_protection)
{
- ix86_adjust_stack_and_probe_stack_clash (allocate);
+ ix86_adjust_stack_and_probe_stack_clash (allocate,
+ int_registers_saved);
allocate = 0;
}
else if (STACK_CHECK_MOVING_SP)
@@ -13749,7 +13774,7 @@ ix86_expand_prologue (void)
if (!(crtl->is_leaf && !cfun->calls_alloca
&& allocate <= get_probe_interval ()))
{
- ix86_adjust_stack_and_probe (allocate);
+ ix86_adjust_stack_and_probe (allocate, int_registers_saved);
allocate = 0;
}
}
@@ -13765,11 +13790,12 @@ ix86_expand_prologue (void)
if (crtl->is_leaf && !cfun->calls_alloca)
{
if (size > get_probe_interval ())
- ix86_emit_probe_stack_range (0, size);
+ ix86_emit_probe_stack_range (0, size, int_registers_saved);
}
else
ix86_emit_probe_stack_range (0,
- size + get_stack_check_protect ());
+ size + get_stack_check_protect (),
+ int_registers_saved);
}
else
{
@@ -13778,10 +13804,13 @@ ix86_expand_prologue (void)
if (size > get_probe_interval ()
&& size > get_stack_check_protect ())
ix86_emit_probe_stack_range (get_stack_check_protect (),
- size - get_stack_check_protect ());
+ (size
+ - get_stack_check_protect ()),
+ int_registers_saved);
}
else
- ix86_emit_probe_stack_range (get_stack_check_protect (), size);
+ ix86_emit_probe_stack_range (get_stack_check_protect (), size,
+ int_registers_saved);
}
}
}
--- gcc/testsuite/gcc.target/i386/pr84064.c
+++ gcc/testsuite/gcc.target/i386/pr84064.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=i686 -fstack-clash-protection" } */
+/* { dg-require-effective-target ia32 } */
+
+void
+f (void *p1, void *p2)
+{
+ __builtin_memcpy (p1, p2, 1000);
+}
+

96
gcc7-pr84524.patch Normal file
View File

@ -0,0 +1,96 @@
2018-02-23 Jakub Jelinek <jakub@redhat.com>
PR target/84524
* config/i386/sse.md (*<code><mode>3): Replace <mask_prefix3> with
orig,vex.
(*<plusminus_insn><mode>3): Likewise. Remove <mask_operand3> uses.
* gcc.c-torture/execute/pr84524.c: New test.
* gcc.target/i386/avx512bw-pr84524.c: New test.
--- gcc/config/i386/sse.md.jj 2018-02-13 09:31:24.769607162 +0100
+++ gcc/config/i386/sse.md 2018-02-23 11:51:00.271477979 +0100
@@ -9938,11 +9938,11 @@ (define_insn "*<plusminus_insn><mode>3"
&& ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
"@
p<plusminus_mnemonic><ssemodesuffix>\t{%2, %0|%0, %2}
- vp<plusminus_mnemonic><ssemodesuffix>\t{%2, %1, %0<mask_operand3>|%0<mask_operand3>, %1, %2}"
+ vp<plusminus_mnemonic><ssemodesuffix>\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "isa" "noavx,avx")
(set_attr "type" "sseiadd")
(set_attr "prefix_data16" "1,*")
- (set_attr "prefix" "<mask_prefix3>")
+ (set_attr "prefix" "orig,vex")
(set_attr "mode" "<sseinsnmode>")])
(define_insn "*<plusminus_insn><mode>3_mask"
@@ -11822,7 +11822,7 @@ (define_insn "*<code><mode>3"
(eq_attr "mode" "TI"))
(const_string "1")
(const_string "*")))
- (set_attr "prefix" "<mask_prefix3>")
+ (set_attr "prefix" "orig,vex")
(set (attr "mode")
(cond [(and (match_test "<MODE_SIZE> == 16")
(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL"))
--- gcc/testsuite/gcc.c-torture/execute/pr84524.c.jj 2018-02-23 11:54:51.913492631 +0100
+++ gcc/testsuite/gcc.c-torture/execute/pr84524.c 2018-02-23 11:59:55.467511836 +0100
@@ -0,0 +1,41 @@
+/* PR target/84524 */
+
+__attribute__((noipa)) void
+foo (unsigned short *x)
+{
+ unsigned short i, v;
+ unsigned char j;
+ for (i = 0; i < 256; i++)
+ {
+ v = i << 8;
+ for (j = 0; j < 8; j++)
+ if (v & 0x8000)
+ v = (v << 1) ^ 0x1021;
+ else
+ v = v << 1;
+ x[i] = v;
+ }
+}
+
+int
+main ()
+{
+ unsigned short a[256];
+
+ foo (a);
+ for (int i = 0; i < 256; i++)
+ {
+ unsigned short v = i << 8;
+ for (int j = 0; j < 8; j++)
+ {
+ asm volatile ("" : "+r" (v));
+ if (v & 0x8000)
+ v = (v << 1) ^ 0x1021;
+ else
+ v = v << 1;
+ }
+ if (a[i] != v)
+ __builtin_abort ();
+ }
+ return 0;
+}
--- gcc/testsuite/gcc.target/i386/avx512bw-pr84524.c.jj 2018-02-23 11:58:16.919505601 +0100
+++ gcc/testsuite/gcc.target/i386/avx512bw-pr84524.c 2018-02-23 11:58:57.377508169 +0100
@@ -0,0 +1,14 @@
+/* PR target/84524 */
+/* { dg-do run { target avx512bw } } */
+/* { dg-options "-O3 -mavx512bw" } */
+
+#include "avx512bw-check.h"
+
+#define main() do_main()
+#include "../../gcc.c-torture/execute/pr84524.c"
+
+static void
+avx512bw_test (void)
+{
+ do_main ();
+}

View File

@ -1,3 +1,3 @@
SHA512 (gcc-7.3.1-20180130.tar.bz2) = 2a2fb771ac99f4630db61c4ca77fb4d7d52ca357a1721bf5967e6296035f1806f58ad3836834bcccc172771bd0eaa5b7b0f2da8cacf4671a8640fe67fd8e29fd
SHA512 (gcc-7.3.1-20180303.tar.bz2) = 3c65092ea40f401c7bb5c220079f367323b389668763a93962c321a98caa4d72487748c034903f5a6381d9edadc1bc848831f3bc5404db283a234cf2d7bb82f1
SHA512 (nvptx-newlib-aadc8eb0ec43b7cd0dd2dfb484bae63c8b05ef24.tar.bz2) = 38f97c9297ad108568352a4d28277455a3c01fd8b7864e798037e5006b6f757022e874bbf3f165775fe3b873781bc108137bbeb42dd5ed3c7d3e6747746fa918
SHA512 (nvptx-tools-c28050f60193b3b95a18866a96f03334e874e78f.tar.bz2) = 95b577a06a93bb044dbc8033e550cb36bcf2ab2687da030a7318cdc90e7467ed49665e247dcafb5ff4a7e92cdc264291d19728bd17fab902fb64b22491269330