diff --git a/SOURCES/gcc48-pr53658.patch b/SOURCES/gcc48-pr53658.patch new file mode 100644 index 0000000..cafc8bd --- /dev/null +++ b/SOURCES/gcc48-pr53658.patch @@ -0,0 +1,26 @@ +2013-06-07 Paolo Carlini + + PR c++/53658 + * pt.c (lookup_template_class_1): Consistently use TYPE_MAIN_DECL, + not TYPE_STUB_DECL, to access the _DECL for a _TYPE. + +--- gcc/cp/pt.c ++++ gcc/cp/pt.c +@@ -7561,7 +7561,7 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context, + if (CLASS_TYPE_P (template_type) && is_dependent_type) + /* If the type makes use of template parameters, the + code that generates debugging information will crash. */ +- DECL_IGNORED_P (TYPE_STUB_DECL (t)) = 1; ++ DECL_IGNORED_P (TYPE_MAIN_DECL (t)) = 1; + + /* Possibly limit visibility based on template args. */ + TREE_PUBLIC (type_decl) = 1; +--- /dev/null ++++ gcc/testsuite/g++.dg/cpp0x/alias-decl-36.C +@@ -0,0 +1,6 @@ ++// PR c++/53658 ++// { dg-do compile { target c++11 } } ++ ++struct A; ++template using Foo = const A; ++template Foo bar(); diff --git a/SOURCES/gcc48-pr60784.patch b/SOURCES/gcc48-pr60784.patch new file mode 100644 index 0000000..4cfc3a7 --- /dev/null +++ b/SOURCES/gcc48-pr60784.patch @@ -0,0 +1,46 @@ +2014-05-02 Marek Polacek + + PR c/60784 + * c-typeck.c (push_init_level): Set constructor_designated to + p->designated for structures. + +--- gcc/c/c-typeck.c ++++ gcc/c/c-typeck.c +@@ -7270,6 +7270,9 @@ push_init_level (int implicit, struct obstack * braced_init_obstack) + push_member_name (constructor_fields); + constructor_depth++; + } ++ /* If upper initializer is designated, then mark this as ++ designated too to prevent bogus warnings. */ ++ constructor_designated = p->designated; + } + else if (TREE_CODE (constructor_type) == ARRAY_TYPE) + { +--- /dev/null ++++ gcc/testsuite/gcc.dg/pr60784.c +@@ -0,0 +1,25 @@ ++/* PR c/60784 */ ++/* { dg-do compile } */ ++/* { dg-options "-Wextra -std=c99" } */ ++ ++struct A { int i, j; }; ++struct B { struct A a; } b1 = { .a.i = 1, .a.j = 1 }; ++struct B b2 = { .a.i = 1 }; ++ ++struct C { struct { int a, b; }; } c1 = { .a = 4, .b = 2 }; ++struct C c2 = { .a = 4, .b = 2 }; ++ ++struct D { struct A a; }; ++struct E { struct D d; }; ++struct F { struct E e; } f1 = { .e.d.a.i = 8 }; ++struct F f2 = { .e.d.a.i = 8, .e.d.a.j = 3 }; ++ ++struct G { ++ struct { ++ struct { ++ struct { ++ int a, b, c, d, e, f; ++ }; ++ }; ++ }; ++} g = { .b = 2 }; diff --git a/SOURCES/gcc48-pr63567-1.patch b/SOURCES/gcc48-pr63567-1.patch new file mode 100644 index 0000000..b5e7bc5 --- /dev/null +++ b/SOURCES/gcc48-pr63567-1.patch @@ -0,0 +1,52 @@ +2014-10-17 Marek Polacek + + PR c/63567 + * c-typeck.c (digest_init): Allow initializing objects with static + storage duration with compound literals even in C99 and add pedwarn + for it. + +--- gcc/c/c-typeck.c ++++ gcc/c/c-typeck.c +@@ -6683,13 +6683,15 @@ digest_init (location_t init_loc, tree type, tree init, tree origtype, + inside_init = convert (type, inside_init); + + if (require_constant +- && (code == VECTOR_TYPE || !flag_isoc99) + && TREE_CODE (inside_init) == COMPOUND_LITERAL_EXPR) + { + /* As an extension, allow initializing objects with static storage + duration with compound literals (which are then treated just as + the brace enclosed list they contain). Also allow this for + vectors, as we can only assign them with compound literals. */ ++ if (flag_isoc99 && code != VECTOR_TYPE) ++ pedwarn_init (init_loc, OPT_Wpedantic, "initializer element " ++ "is not constant"); + tree decl = COMPOUND_LITERAL_EXPR_DECL (inside_init); + inside_init = DECL_INITIAL (decl); + } +--- /dev/null ++++ gcc/testsuite/gcc.dg/pr63567-1.c +@@ -0,0 +1,10 @@ ++/* PR c/63567 */ ++/* { dg-do compile } */ ++/* { dg-options "" } */ ++ ++/* Allow initializing objects with static storage duration with ++ compound literals even. This is being used in Linux kernel. */ ++ ++struct T { int i; }; ++struct S { struct T t; }; ++static struct S s = (struct S) { .t = { 42 } }; +--- /dev/null ++++ gcc/testsuite/gcc.dg/pr63567-2.c +@@ -0,0 +1,10 @@ ++/* PR c/63567 */ ++/* { dg-do compile } */ ++/* { dg-options "-pedantic -std=gnu99" } */ ++ ++/* Allow initializing objects with static storage duration with ++ compound literals. This is being used in Linux kernel. */ ++ ++struct T { int i; }; ++struct S { struct T t; }; ++static struct S s = (struct S) { .t = { 42 } }; /* { dg-warning "initializer element is not constant" } */ diff --git a/SOURCES/gcc48-pr63567-2.patch b/SOURCES/gcc48-pr63567-2.patch new file mode 100644 index 0000000..610771c --- /dev/null +++ b/SOURCES/gcc48-pr63567-2.patch @@ -0,0 +1,45 @@ +2014-10-19 Marek Polacek + + PR c/63567 + * c-typeck.c (output_init_element): Allow initializing objects with + static storage duration with compound literals even in C99 and add + pedwarn for it. + +--- gcc/c/c-typeck.c ++++ gcc/c/c-typeck.c +@@ -8251,11 +8251,14 @@ output_init_element (location_t loc, tree value, tree origtype, + value = array_to_pointer_conversion (input_location, value); + + if (TREE_CODE (value) == COMPOUND_LITERAL_EXPR +- && require_constant_value && !flag_isoc99 && pending) ++ && require_constant_value && pending) + { + /* As an extension, allow initializing objects with static storage + duration with compound literals (which are then treated just as + the brace enclosed list they contain). */ ++ if (flag_isoc99) ++ pedwarn_init (input_location, OPT_Wpedantic, "initializer element is not " ++ "constant"); + tree decl = COMPOUND_LITERAL_EXPR_DECL (value); + value = DECL_INITIAL (decl); + } +--- /dev/null ++++ gcc/testsuite/gcc.dg/pr63567-3.c +@@ -0,0 +1,7 @@ ++/* PR c/63567 */ ++/* { dg-do compile } */ ++/* { dg-options "" } */ ++ ++struct T { int i; }; ++struct S { struct T t; }; ++struct S s = { .t = { (int) { 1 } } }; +--- /dev/null ++++ gcc/testsuite/gcc.dg/pr63567-4.c +@@ -0,0 +1,7 @@ ++/* PR c/63567 */ ++/* { dg-do compile } */ ++/* { dg-options "-Wpedantic -std=gnu99" } */ ++ ++struct T { int i; }; ++struct S { struct T t; }; ++struct S s = { .t = { (int) { 1 } } }; /* { dg-warning "initializer element is not constant|initialization" } */ diff --git a/SOURCES/gcc48-pr68814.patch b/SOURCES/gcc48-pr68814.patch new file mode 100644 index 0000000..d92bde8 --- /dev/null +++ b/SOURCES/gcc48-pr68814.patch @@ -0,0 +1,17 @@ +2015-12-11 Segher Boessenkool + + PR rtl-optimization/68814 + * rtlanal.c (set_noop_p): Use BITS_BIG_ENDIAN instead of + BYTES_BIG_ENDIAN. + +--- gcc/rtlanal.c ++++ gcc/rtlanal.c +@@ -1534,7 +1534,7 @@ set_noop_p (const_rtx set) + + if (GET_CODE (dst) == ZERO_EXTRACT) + return rtx_equal_p (XEXP (dst, 0), src) +- && ! BYTES_BIG_ENDIAN && XEXP (dst, 2) == const0_rtx ++ && !BITS_BIG_ENDIAN && XEXP (dst, 2) == const0_rtx + && !side_effects_p (src); + + if (GET_CODE (dst) == STRICT_LOW_PART) diff --git a/SOURCES/gcc48-pr69891.patch b/SOURCES/gcc48-pr69891.patch new file mode 100644 index 0000000..466b194 --- /dev/null +++ b/SOURCES/gcc48-pr69891.patch @@ -0,0 +1,51 @@ +2016-02-26 Jakub Jelinek + Eric Botcazou + + PR rtl-optimization/69891 + * dse.c (scan_insn): If we can't figure out memset arguments + or they are non-constant, call clear_rhs_from_active_local_stores. + +--- gcc/testsuite/gcc.target/i386/pr69891.c (nonexistent) ++++ gcc/testsuite/gcc.target/i386/pr69891.c (revision 238137) +@@ -0,0 +1,30 @@ ++/* PR rtl-optimization/69891 */ ++/* { dg-do run } */ ++/* { dg-options "-O -fno-tree-fre -mstringop-strategy=libcall -Wno-psabi" } */ ++/* { dg-additional-options "-mno-sse" { target ia32 } } */ ++ ++typedef unsigned short A; ++typedef unsigned short B __attribute__ ((vector_size (32))); ++typedef unsigned int C; ++typedef unsigned int D __attribute__ ((vector_size (32))); ++typedef unsigned long long E; ++typedef unsigned long long F __attribute__ ((vector_size (32))); ++ ++__attribute__((noinline, noclone)) unsigned ++foo(D a, B b, D c, F d) ++{ ++ b /= (B) {1, -c[0]} | 1; ++ c[0] |= 7; ++ a %= c | 1; ++ c ^= c; ++ return a[0] + b[15] + c[0] + d[3]; ++} ++ ++int ++main () ++{ ++ unsigned x = foo ((D) {}, (B) {}, (D) {}, (F) {}); ++ if (x != 0) ++ __builtin_abort (); ++ return 0; ++} +--- gcc/dse.c (revision 238136) ++++ gcc/dse.c (revision 238137) +@@ -2582,6 +2582,8 @@ + active_local_stores = insn_info; + } + } ++ else ++ clear_rhs_from_active_local_stores (); + } + } + diff --git a/SOURCES/gcc48-rh1614326.patch b/SOURCES/gcc48-rh1614326.patch new file mode 100644 index 0000000..da9f480 --- /dev/null +++ b/SOURCES/gcc48-rh1614326.patch @@ -0,0 +1,18 @@ +2016-05-04 Alan Modra + + * config/rs6000/rs6000.h (PIC_OFFSET_TABLE_REGNUM): Correct. + +--- gcc/config/rs6000/rs6000.h ++++ gcc/config/rs6000/rs6000.h +@@ -2058,7 +2058,10 @@ do { \ + to allocate such a register (if necessary). */ + + #define RS6000_PIC_OFFSET_TABLE_REGNUM 30 +-#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? RS6000_PIC_OFFSET_TABLE_REGNUM : INVALID_REGNUM) ++#define PIC_OFFSET_TABLE_REGNUM \ ++ (TARGET_TOC ? TOC_REGISTER \ ++ : flag_pic ? RS6000_PIC_OFFSET_TABLE_REGNUM \ ++ : INVALID_REGNUM) + + #define TOC_REGISTER (TARGET_MINIMAL_TOC ? RS6000_PIC_OFFSET_TABLE_REGNUM : 2) + diff --git a/SPECS/gcc.spec b/SPECS/gcc.spec index be574ec..6bdd182 100644 --- a/SPECS/gcc.spec +++ b/SPECS/gcc.spec @@ -2,11 +2,11 @@ %global SVNREV 225304 # Note, gcc_release must be integer, if you want to add suffixes to # %{release}, append them after %{gcc_release} on Release: line. -%global gcc_release 36 +%global gcc_release 39 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 %global multilib_64_archs sparc64 ppc64 ppc64p7 s390x x86_64 -%ifarch %{ix86} x86_64 ia64 ppc ppc64 ppc64le ppc64p7 alpha aarch64 %{arm} +%ifarch %{ix86} x86_64 ia64 ppc ppc64 ppc64le ppc64p7 alpha aarch64 %global build_ada 1 %else %global build_ada 0 @@ -79,7 +79,7 @@ Name: gcc %global gcc_version 4.8.5 %endif Version: 4.8.5 -Release: %{gcc_release}%{?dist}.2 +Release: %{gcc_release}%{?dist} %if "%{version}" != "%{gcc_version}" %define gcc_provides %{gcc_version}-16%{?dist} %endif @@ -269,8 +269,15 @@ Patch69: gcc48-pr72717.patch Patch70: gcc48-pr66840.patch Patch71: gcc48-rh1546372.patch Patch72: gcc48-rh1655148.patch -Patch73: gcc48-rh1659698.patch -Patch74: gcc48-pr63442.patch +Patch73: gcc48-pr63442.patch +Patch74: gcc48-rh1659698.patch +Patch75: gcc48-pr69891.patch +Patch76: gcc48-pr68814.patch +Patch77: gcc48-pr63567-1.patch +Patch78: gcc48-pr63567-2.patch +Patch79: gcc48-rh1614326.patch +Patch80: gcc48-pr60784.patch +Patch81: gcc48-pr53658.patch Patch1000: fastjar-0.97-segfault.patch Patch1001: fastjar-0.97-len1.patch @@ -1063,8 +1070,15 @@ touch -r %{PATCH27} libstdc++-v3/python/libstdcxx/v6/printers.py %patch70 -p0 -b .pr66840~ %patch71 -p0 -b .rh1546372~ %patch72 -p1 -b .rh1655148~ -%patch73 -p0 -b .rh1659698~ -%patch74 -p0 -b .pr63442~ +%patch73 -p0 -b .pr63442~ +%patch74 -p0 -b .rh1659698~ +%patch75 -p0 -b .pr69891~ +%patch76 -p0 -b .pr68814~ +%patch77 -p0 -b .pr63567-1~ +%patch78 -p0 -b .pr63567-2~ +%patch79 -p0 -b .rh1614326~ +%patch80 -p0 -b .pr60784~ +%patch81 -p0 -b .pr53658~ %if 0%{?_enable_debug_packages} cat > split-debuginfo.sh <<\EOF @@ -3554,11 +3568,21 @@ fi %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_version}/plugin %changelog -* Wed Feb 13 2019 Marek Polacek 4.8.5-36.2 -- allow libitm to use HTM (#1674383) -- fix mode mismatch in prepare_cmp_insn (#1676795, PR target/63442) - -* Wed Jan 16 2019 Jeff Law 4.8.5-36.1 +* Tue Feb 26 2019 Marek Polacek 4.8.5-39 +- fix pr63567-2.c and pr63567-4.c + +* Mon Feb 25 2019 Marek Polacek 4.8.5-38 +- fix mode mismatch in prepare_cmp_insn (#1641329, PR target/63442) +- allow libitm to use HTM (#1659698) +- fix up memset handling in DSE (#1640805, PR rtl-optimization/69891) +- fix bits/bytes confusion in set_noop_p (#1594975, PR rtl-optimization/68814) +- enable initializing statics with COMPOUND_LITERAL_EXPR in C99 + (#1672652, PR c/63567) +- fix PIC_OFFSET_TABLE_REGNUM (#1614326) +- quash spurious -Wmissing-field-initializers warnings (#1633716, PR c/60784) +- fix ICE with alias template (#1648161, PR c++/53658) + +* Wed Jan 16 2019 Jeff Law 4.8.5-37 - Avoid code generation bug due to incorrect CFG in the presence of setjmp/longjmp (#1655148).