diff --git a/.gitignore b/.gitignore index 5086f1d..6d8921d 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,4 @@ /gcc-4.8.2-20131209.tar.bz2 /gcc-4.8.2-20131212.tar.bz2 /gcc-4.8.2-20140115.tar.bz2 +/gcc-4.8.2-20140120.tar.bz2 diff --git a/gcc.spec b/gcc.spec index ca34dd0..fc42308 100644 --- a/gcc.spec +++ b/gcc.spec @@ -1,9 +1,9 @@ -%global DATE 20140115 -%global SVNREV 206627 +%global DATE 20140120 +%global SVNREV 206854 %global gcc_version 4.8.2 # 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 11 +%global gcc_release 13 %global _unpackaged_files_terminate_build 0 %global _performance_build 1 %global multilib_64_archs sparc64 ppc64 ppc64p7 s390x x86_64 @@ -197,6 +197,7 @@ Patch12: gcc48-no-add-needed.patch Patch13: gcc48-pr56564.patch Patch14: gcc48-pr56493.patch Patch15: gcc48-color-auto.patch +Patch16: gcc48-pr28865.patch Patch1000: fastjar-0.97-segfault.patch Patch1001: fastjar-0.97-len1.patch @@ -756,6 +757,7 @@ package or when debugging this package. %if 0%{?fedora} >= 20 || 0%{?rhel} >= 7 %patch15 -p0 -b .color-auto~ %endif +%patch16 -p0 -b .pr28865~ %if 0%{?_enable_debug_packages} cat > split-debuginfo.sh <<\EOF @@ -1011,7 +1013,8 @@ enablelada=,ada enablelgo=,go %endif CC="$CC" CFLAGS="$OPT_FLAGS" \ - CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g'`" \ + CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g' \ + | sed 's/ -Werror=format-security / -Wformat -Werror=format-security /'`" \ XCFLAGS="$OPT_FLAGS" TCFLAGS="$OPT_FLAGS" GCJFLAGS="$OPT_FLAGS" \ ../configure --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \ --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap \ @@ -3022,13 +3025,25 @@ fi %{_prefix}/libexec/gcc/%{gcc_target_platform}/%{gcc_version}/plugin %changelog +* Tue Jan 21 2014 Jakub Jelinek 4.8.2-13 +- when removing -Wall from CXXFLAGS, if -Werror=format-security + is present, add -Wformat to it, so that GCC builds on F21 + +* Mon Jan 20 2014 Jakub Jelinek 4.8.2-12 +- update from the 4.8 branch (#1052892) + - PRs c++/59838, debug/54694, fortran/34547, fortran/58410, + middle-end/59827, middle-end/59860, target/58139, target/59142, + target/59695, target/59794, target/59826, target/59839 +- fix handling of initialized vars with flexible array members + (#1035413, PR middle-end/28865) + * Wed Jan 15 2014 Jakub Jelinek 4.8.2-11 - update from the 4.8 branch - fix s390x reload bug (#1052372, PR target/59803) * Tue Jan 14 2014 Jakub Jelinek 4.8.2-10 - update from the 4.8 branch (#1052892) - - PR ada/55946, ada/59772, c++/56060, c++/58954, c++/59255, c++/59730, + - PRs ada/55946, ada/59772, c++/56060, c++/58954, c++/59255, c++/59730, fortran/57042, fortran/58998, fortran/59493, fortran/59612, fortran/59654, ipa/59610, middle-end/59584, pch/59436, rtl-optimization/54300, rtl-optimization/58668, diff --git a/gcc48-pr28865.patch b/gcc48-pr28865.patch new file mode 100644 index 0000000..8e07e94 --- /dev/null +++ b/gcc48-pr28865.patch @@ -0,0 +1,190 @@ +2014-01-16 Nick Clifton + + PR middle-end/28865 + * varasm.c (output_constant): Return the number of bytes actually + emitted. + (output_constructor_array_range): Update the field size with the + number of bytes emitted by output_constant. + (output_constructor_regular_field): Likewise. Also do not + complain if the total number of bytes emitted is now greater + than the expected fieldpos. + * output.h (output_constant): Update prototype and descriptive + comment. + + * gcc.c-torture/compile/pr28865.c: New. + * gcc.c-torture/execute/pr28865.c: New. + +--- gcc/varasm.c (revision 206660) ++++ gcc/varasm.c (revision 206661) +@@ -4474,8 +4474,10 @@ static unsigned HOST_WIDE_INT + This includes the pseudo-op such as ".int" or ".byte", and a newline. + Assumes output_addressed_constants has been done on EXP already. + +- Generate exactly SIZE bytes of assembler data, padding at the end +- with zeros if necessary. SIZE must always be specified. ++ Generate at least SIZE bytes of assembler data, padding at the end ++ with zeros if necessary. SIZE must always be specified. The returned ++ value is the actual number of bytes of assembler data generated, which ++ may be bigger than SIZE if the object contains a variable length field. + + SIZE is important for structure constructors, + since trailing members may have been omitted from the constructor. +@@ -4490,14 +4492,14 @@ static unsigned HOST_WIDE_INT + + ALIGN is the alignment of the data in bits. */ + +-void ++unsigned HOST_WIDE_INT + output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align) + { + enum tree_code code; + unsigned HOST_WIDE_INT thissize; + + if (size == 0 || flag_syntax_only) +- return; ++ return size; + + /* See if we're trying to initialize a pointer in a non-default mode + to the address of some declaration somewhere. If the target says +@@ -4562,7 +4564,7 @@ output_constant (tree exp, unsigned HOST + && vec_safe_is_empty (CONSTRUCTOR_ELTS (exp))) + { + assemble_zeros (size); +- return; ++ return size; + } + + if (TREE_CODE (exp) == FDESC_EXPR) +@@ -4574,7 +4576,7 @@ output_constant (tree exp, unsigned HOST + #else + gcc_unreachable (); + #endif +- return; ++ return size; + } + + /* Now output the underlying data. If we've handling the padding, return. +@@ -4612,8 +4614,7 @@ output_constant (tree exp, unsigned HOST + switch (TREE_CODE (exp)) + { + case CONSTRUCTOR: +- output_constructor (exp, size, align, NULL); +- return; ++ return output_constructor (exp, size, align, NULL); + case STRING_CST: + thissize = MIN ((unsigned HOST_WIDE_INT)TREE_STRING_LENGTH (exp), + size); +@@ -4648,11 +4649,10 @@ output_constant (tree exp, unsigned HOST + case RECORD_TYPE: + case UNION_TYPE: + gcc_assert (TREE_CODE (exp) == CONSTRUCTOR); +- output_constructor (exp, size, align, NULL); +- return; ++ return output_constructor (exp, size, align, NULL); + + case ERROR_MARK: +- return; ++ return 0; + + default: + gcc_unreachable (); +@@ -4660,6 +4660,8 @@ output_constant (tree exp, unsigned HOST + + if (size > thissize) + assemble_zeros (size - thissize); ++ ++ return size; + } + + +@@ -4759,7 +4761,7 @@ output_constructor_array_range (oc_local + if (local->val == NULL_TREE) + assemble_zeros (fieldsize); + else +- output_constant (local->val, fieldsize, align2); ++ fieldsize = output_constant (local->val, fieldsize, align2); + + /* Count its size. */ + local->total_bytes += fieldsize; +@@ -4808,9 +4810,8 @@ output_constructor_regular_field (oc_loc + Note no alignment needed in an array, since that is guaranteed + if each element has the proper size. */ + if ((local->field != NULL_TREE || local->index != NULL_TREE) +- && fieldpos != local->total_bytes) ++ && fieldpos > local->total_bytes) + { +- gcc_assert (fieldpos >= local->total_bytes); + assemble_zeros (fieldpos - local->total_bytes); + local->total_bytes = fieldpos; + } +@@ -4847,7 +4848,7 @@ output_constructor_regular_field (oc_loc + if (local->val == NULL_TREE) + assemble_zeros (fieldsize); + else +- output_constant (local->val, fieldsize, align2); ++ fieldsize = output_constant (local->val, fieldsize, align2); + + /* Count its size. */ + local->total_bytes += fieldsize; +--- gcc/output.h (revision 206660) ++++ gcc/output.h (revision 206661) +@@ -294,11 +294,13 @@ extern void output_quoted_string (FILE * + This includes the pseudo-op such as ".int" or ".byte", and a newline. + Assumes output_addressed_constants has been done on EXP already. + +- Generate exactly SIZE bytes of assembler data, padding at the end +- with zeros if necessary. SIZE must always be specified. ++ Generate at least SIZE bytes of assembler data, padding at the end ++ with zeros if necessary. SIZE must always be specified. The returned ++ value is the actual number of bytes of assembler data generated, which ++ may be bigger than SIZE if the object contains a variable length field. + + ALIGN is the alignment in bits that may be assumed for the data. */ +-extern void output_constant (tree, unsigned HOST_WIDE_INT, unsigned int); ++extern unsigned HOST_WIDE_INT output_constant (tree, unsigned HOST_WIDE_INT, unsigned int); + + /* When outputting delayed branch sequences, this rtx holds the + sequence being output. It is null when no delayed branch +--- gcc/testsuite/gcc.c-torture/execute/pr28865.c (revision 0) ++++ gcc/testsuite/gcc.c-torture/execute/pr28865.c (revision 206661) +@@ -0,0 +1,21 @@ ++struct A { int a; char b[]; }; ++union B { struct A a; char b[sizeof (struct A) + 31]; }; ++union B b = { { 1, "123456789012345678901234567890" } }; ++union B c = { { 2, "123456789012345678901234567890" } }; ++ ++__attribute__((noinline, noclone)) void ++foo (int *x[2]) ++{ ++ x[0] = &b.a.a; ++ x[1] = &c.a.a; ++} ++ ++int ++main () ++{ ++ int *x[2]; ++ foo (x); ++ if (*x[0] != 1 || *x[1] != 2) ++ __builtin_abort (); ++ return 0; ++} +--- gcc/testsuite/gcc.c-torture/compile/pr28865.c (revision 0) ++++ gcc/testsuite/gcc.c-torture/compile/pr28865.c (revision 206661) +@@ -0,0 +1,16 @@ ++struct var_len ++{ ++ int field1; ++ const char field2[]; ++}; ++ ++/* Note - strictly speaking this array declaration is illegal ++ since each element has a variable length. GCC allows it ++ (for the moment) because it is used in existing code, such ++ as glibc. */ ++static const struct var_len var_array[] = ++{ ++ { 1, "Long exposure noise reduction" }, ++ { 2, "Shutter/AE lock buttons" }, ++ { 3, "Mirror lockup" } ++}; diff --git a/sources b/sources index 171d8cc..6a9ecff 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ be78a47bd82523250eb3e91646db5b3d cloog-0.18.0.tar.gz 2659f09c2e43ef8b7d4406321753f1b2 fastjar-0.97.tar.gz -ac6863dd2e049521aa5c3cb5e686c98c gcc-4.8.2-20140115.tar.bz2 +9f699b42394bd2754d9f77427553d923 gcc-4.8.2-20140120.tar.bz2 bce1586384d8635a76d2f017fb067cd2 isl-0.11.1.tar.bz2