From b8c2c3e7456adf144a6db81107459a102fc62b16 Mon Sep 17 00:00:00 2001 From: Jan Palus Date: Sun, 12 Nov 2017 22:15:23 +0100 Subject: [PATCH] add upstream fix for PR81481 (r253300 excluding changelog diff); rel 4 for more details see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81481 https://bugzilla.opensuse.org/show_bug.cgi?id=1048861 --- gcc-pr81481.patch | 39 +++++++++++++++++++++++++++++++++++++++ gcc.spec | 4 +++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 gcc-pr81481.patch diff --git a/gcc-pr81481.patch b/gcc-pr81481.patch new file mode 100644 index 0000000..c2e5f13 --- /dev/null +++ b/gcc-pr81481.patch @@ -0,0 +1,39 @@ +Index: gcc/testsuite/gcc.target/i386/pr81481.c +=================================================================== +--- gcc/testsuite/gcc.target/i386/pr81481.c (nonexistent) ++++ gcc/testsuite/gcc.target/i386/pr81481.c (revision 253300) +@@ -0,0 +1,18 @@ ++/* { dg-do compile } */ ++/* { dg-require-effective-target ssse3 } */ ++/* { dg-options "-O2 -fpic -mssse3" } */ ++/* { dg-final { scan-assembler-not "pshufb\[ \t\]\\(%esp\\)" } } */ ++#include ++ ++extern const signed char c[31] __attribute__((visibility("hidden"))); ++ ++__m128i f(__m128i *x, void *v) ++{ ++ int i; ++ asm("# %0" : "=r"(i)); ++ __m128i t = _mm_loadu_si128((void*)&c[i]); ++ __m128i xx = *x; ++ xx = _mm_shuffle_epi8(xx, t); ++ asm("# %0 %1 %2" : "+x"(xx) : "r"(c), "r"(i)); ++ return xx; ++} +Index: gcc/ira-costs.c +=================================================================== +--- gcc/ira-costs.c (revision 253299) ++++ gcc/ira-costs.c (revision 253300) +@@ -1471,7 +1471,10 @@ + && targetm.legitimate_constant_p (GET_MODE (SET_DEST (set)), + XEXP (note, 0)) + && REG_N_SETS (REGNO (SET_DEST (set))) == 1)) +- && general_operand (SET_SRC (set), GET_MODE (SET_SRC (set)))) ++ && general_operand (SET_SRC (set), GET_MODE (SET_SRC (set))) ++ /* LRA does not use equiv with a symbol for PIC code. */ ++ && (! ira_use_lra_p || ! pic_offset_table_rtx ++ || ! contains_symbol_ref_p (XEXP (note, 0)))) + { + enum reg_class cl = GENERAL_REGS; + rtx reg = SET_DEST (set); diff --git a/gcc.spec b/gcc.spec index f8096db..3424c03 100644 --- a/gcc.spec +++ b/gcc.spec @@ -105,7 +105,7 @@ Summary(pl.UTF-8): Kolekcja kompilatorów GNU: kompilator C i pliki współdziel Summary(pt_BR.UTF-8): Coleção dos compiladores GNU: o compilador C e arquivos compartilhados Name: gcc Version: %{major_ver}.%{minor_ver} -Release: 3 +Release: 4 Epoch: 6 License: GPL v3+ Group: Development/Languages @@ -123,6 +123,7 @@ Patch2: %{name}-nodebug.patch Patch3: %{name}-ada-link.patch Patch4: %{name}-ada-x32.patch Patch5: Revert-eeb6872bf.patch +Patch6: %{name}-pr81481.patch Patch10: %{name}-moresparcs.patch Patch11: %{name}-install-libffi.patch @@ -2803,6 +2804,7 @@ Extensions dla języka C. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p0 %patch10 -p1 %if %{with gcc_libffi} -- 2.44.0