[gentoo-commits] proj/gcc-patches:master commit in: 7.4.0/gentoo/
commit: ba604ad0372c3773298b241244309a1d42097646 Author: Sergei Trofimovich gentoo org> AuthorDate: Sat Mar 21 13:01:11 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Sat Mar 21 13:01:11 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=ba604ad0 7.4.0: backport glibc-2.31 libsanitizer fixes Signed-off-by: Sergei Trofimovich gentoo.org> 7.4.0/gentoo/23_all_libsanitizer-p1.patch | 32 + 7.4.0/gentoo/24_all_libsanitizer-p2.patch | 59 +++ 7.4.0/gentoo/README.history | 4 ++- 3 files changed, 94 insertions(+), 1 deletion(-) diff --git a/7.4.0/gentoo/23_all_libsanitizer-p1.patch b/7.4.0/gentoo/23_all_libsanitizer-p1.patch new file mode 100644 index 000..80cc074 --- /dev/null +++ b/7.4.0/gentoo/23_all_libsanitizer-p1.patch @@ -0,0 +1,32 @@ +From 54d87ffe4b34052f159ac5b72b250129ce813b2a Mon Sep 17 00:00:00 2001 +From: Jakub Jelinek +Date: Fri, 14 Feb 2020 12:33:27 +0100 +Subject: [PATCH] backport: re PR sanitizer/92154 (new glibc breaks arm + bootstrap due to libsanitizer) + + Backported from mainline + 2019-10-22 Tamar Christina + + PR sanitizer/92154 + * sanitizer_common/sanitizer_platform_limits_posix.cc: + Cherry-pick compiler-rt revision r375220. +--- +--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +@@ -1147,8 +1147,12 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid); + CHECK_SIZE_AND_OFFSET(ipc_perm, gid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); +-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) ++#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \ ++!defined(__arm__) + /* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ ++/* On Arm glibc 2.31 and later provide a different mode field, this field is ++ never used by libsanitizer so we can simply ignore this assert for all glibc ++ versions. */ + CHECK_SIZE_AND_OFFSET(ipc_perm, mode); + #endif + +-- +2.25.2 + diff --git a/7.4.0/gentoo/24_all_libsanitizer-p2.patch b/7.4.0/gentoo/24_all_libsanitizer-p2.patch new file mode 100644 index 000..bdd8dcb --- /dev/null +++ b/7.4.0/gentoo/24_all_libsanitizer-p2.patch @@ -0,0 +1,59 @@ +From dbdf86838aaaef76620c00c53096cfe157d5af6e Mon Sep 17 00:00:00 2001 +From: Jakub Jelinek +Date: Fri, 14 Feb 2020 12:38:30 +0100 +Subject: [PATCH] backport: re PR sanitizer/92154 (new glibc breaks arm + bootstrap due to libsanitizer) + + Backported from mainline + 2019-11-26 Jakub Jelinek + + PR sanitizer/92154 + * sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick + llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce. + * sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise. +--- +--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +@@ -1147,12 +1147,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid); + CHECK_SIZE_AND_OFFSET(ipc_perm, gid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); +-#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \ +-!defined(__arm__) +-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ +-/* On Arm glibc 2.31 and later provide a different mode field, this field is +- never used by libsanitizer so we can simply ignore this assert for all glibc +- versions. */ ++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31) ++/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit ++ on many architectures. */ + CHECK_SIZE_AND_OFFSET(ipc_perm, mode); + #endif + +--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -210,20 +210,13 @@ namespace __sanitizer { + unsigned long __unused1; + unsigned long __unused2; + #elif defined(__sparc__) +-# if defined(__arch64__) + unsigned mode; +-unsigned short __pad1; +-# else +-unsigned short __pad1; +-unsigned short mode; + unsigned short __pad2; +-# endif + unsigned short __seq; + unsigned long long __unused1; + unsigned long long __unused2; + #else +-unsigned short mode; +-unsigned short __pad1; ++unsigned int mode; + unsigned short __seq; + unsigned short __pad2; + #if defined(__x86_64__) && !defined(_LP64) +-- +2.25.2 + diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history index 46ced37..25cf759 100644 --- a/7.4.0/gentoo/README.history +++ b/7.4.0/gentoo/README.history @@ -1,5 +1,7 @@ -1.4abandoned in favour of 9.2 branch +2 abandoned in favour of 7.5 branch - 23_all-pgo.patch + + 23_all_libsanitizer-p1.patch + + 24_all_libsanitizer-p2.patch 1.3
[gentoo-commits] proj/gcc-patches:master commit in: 7.4.0/gentoo/
commit: 99920ddb52baa8475a657e549aaee3225024b81f Author: Sergei Trofimovich gentoo org> AuthorDate: Wed Jan 8 22:39:45 2020 + Commit: Sergei Trofimovich gentoo org> CommitDate: Wed Jan 8 22:39:45 2020 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=99920ddb 7.4.0: mark unreleased changes abandoned Signed-off-by: Sergei Trofimovich gentoo.org> 7.4.0/gentoo/README.history | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history index f91f788..46ced37 100644 --- a/7.4.0/gentoo/README.history +++ b/7.4.0/gentoo/README.history @@ -1,4 +1,4 @@ -1.4TODO +1.4abandoned in favour of 9.2 branch - 23_all-pgo.patch 1.31 Jun 2019
[gentoo-commits] proj/gcc-patches:master commit in: 7.4.0/gentoo/
commit: 7ad3c1ca7c0726c3f3ceebf562bb9d1379c52223 Author: Sergei Trofimovich gentoo org> AuthorDate: Sun Oct 20 20:41:56 2019 + Commit: Sergei Trofimovich gentoo org> CommitDate: Sun Oct 20 20:41:56 2019 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7ad3c1ca 7.4..0: drop unappliable 23_all-pgo.patch Repored-by: Samuel Bernardo Bug: https://bugs.gentoo.org/698130 Signed-off-by: Sergei Trofimovich gentoo.org> 7.4.0/gentoo/23_all-pgo.patch | 59 --- 7.4.0/gentoo/README.history | 3 +++ 2 files changed, 3 insertions(+), 59 deletions(-) diff --git a/7.4.0/gentoo/23_all-pgo.patch b/7.4.0/gentoo/23_all-pgo.patch deleted file mode 100644 index b11c72f..000 --- a/7.4.0/gentoo/23_all-pgo.patch +++ /dev/null @@ -1,59 +0,0 @@ -https://bugs.gentoo.org/677724 - -From 332446ac24e5b37f441f7c9cb0b97fc36f9f0aa3 Mon Sep 17 00:00:00 2001 -From: hubicka -Date: Sat, 15 Dec 2018 10:31:37 + -Subject: [PATCH] * ipa.c (cgraph_build_static_cdtor_1): Add - OPTIMIZATION and TARGET parameters. (cgraph_build_static_cdtor): - Update. (build_cdtor): Use OPTIMIZATION and TARGET of the first real - cdtor callsed. - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267168 138bc75d-0d04-0410-961f-82ee72b054a4 - gcc/ipa.c | 12 +--- - a/gcc/ipa.c -+++ b/gcc/ipa.c -@@ -831,7 +831,9 @@ ipa_discover_variable_flags (void) -be produced. */ - - static void --cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) -+cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final, -+ tree optimization, -+ tree target) - { - static int counter = 0; - char which_buf[16]; -@@ -862,6 +864,8 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) - - TREE_STATIC (decl) = 1; - TREE_USED (decl) = 1; -+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) = optimization; -+ DECL_FUNCTION_SPECIFIC_TARGET (decl) = target; - DECL_ARTIFICIAL (decl) = 1; - DECL_IGNORED_P (decl) = 1; - DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1; -@@ -911,7 +915,7 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) - void - cgraph_build_static_cdtor (char which, tree body, int priority) - { -- cgraph_build_static_cdtor_1 (which, body, priority, false); -+ cgraph_build_static_cdtor_1 (which, body, priority, false, NULL, NULL); - } - - /* When target does not have ctors and dtors, we call all constructor -@@ -993,7 +997,9 @@ build_cdtor (bool ctor_p, const vec ) - gcc_assert (body != NULL_TREE); - /* Generate a function to call all the function of like -priority. */ -- cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true); -+ cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true, -+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (cdtors[0]), -+ DECL_FUNCTION_SPECIFIC_TARGET (cdtors[0])); - } - } - --- -2.20.1 - diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history index 05000ee..f91f788 100644 --- a/7.4.0/gentoo/README.history +++ b/7.4.0/gentoo/README.history @@ -1,3 +1,6 @@ +1.4TODO + - 23_all-pgo.patch + 1.31 Jun 2019 + 23_all-pgo.patch
[gentoo-commits] proj/gcc-patches:master commit in: 7.4.0/gentoo/
commit: b6c8ba65d3aeccf17fc8010370c22baf908da339 Author: Sergei Trofimovich gentoo org> AuthorDate: Sat Jun 1 08:07:17 2019 + Commit: Sergei Trofimovich gentoo org> CommitDate: Sat Jun 1 08:07:17 2019 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b6c8ba65 7.4.0: backport PGO fix Bug: https://bugs.gentoo.org/677724 Signed-off-by: Sergei Trofimovich gentoo.org> 7.4.0/gentoo/23_all-pgo.patch | 59 +++ 7.4.0/gentoo/README.history | 3 +++ 2 files changed, 62 insertions(+) diff --git a/7.4.0/gentoo/23_all-pgo.patch b/7.4.0/gentoo/23_all-pgo.patch new file mode 100644 index 000..b11c72f --- /dev/null +++ b/7.4.0/gentoo/23_all-pgo.patch @@ -0,0 +1,59 @@ +https://bugs.gentoo.org/677724 + +From 332446ac24e5b37f441f7c9cb0b97fc36f9f0aa3 Mon Sep 17 00:00:00 2001 +From: hubicka +Date: Sat, 15 Dec 2018 10:31:37 + +Subject: [PATCH] * ipa.c (cgraph_build_static_cdtor_1): Add + OPTIMIZATION and TARGET parameters. (cgraph_build_static_cdtor): + Update. (build_cdtor): Use OPTIMIZATION and TARGET of the first real + cdtor callsed. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267168 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/ipa.c | 12 +--- + +--- a/gcc/ipa.c b/gcc/ipa.c +@@ -831,7 +831,9 @@ ipa_discover_variable_flags (void) +be produced. */ + + static void +-cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) ++cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final, ++ tree optimization, ++ tree target) + { + static int counter = 0; + char which_buf[16]; +@@ -862,6 +864,8 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) + + TREE_STATIC (decl) = 1; + TREE_USED (decl) = 1; ++ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) = optimization; ++ DECL_FUNCTION_SPECIFIC_TARGET (decl) = target; + DECL_ARTIFICIAL (decl) = 1; + DECL_IGNORED_P (decl) = 1; + DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1; +@@ -911,7 +915,7 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) + void + cgraph_build_static_cdtor (char which, tree body, int priority) + { +- cgraph_build_static_cdtor_1 (which, body, priority, false); ++ cgraph_build_static_cdtor_1 (which, body, priority, false, NULL, NULL); + } + + /* When target does not have ctors and dtors, we call all constructor +@@ -993,7 +997,9 @@ build_cdtor (bool ctor_p, const vec ) + gcc_assert (body != NULL_TREE); + /* Generate a function to call all the function of like +priority. */ +- cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true); ++ cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true, ++ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (cdtors[0]), ++ DECL_FUNCTION_SPECIFIC_TARGET (cdtors[0])); + } + } + +-- +2.20.1 + diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history index 54c6d3d..05000ee 100644 --- a/7.4.0/gentoo/README.history +++ b/7.4.0/gentoo/README.history @@ -1,3 +1,6 @@ +1.31 Jun 2019 + + 23_all-pgo.patch + 1.22 Feb 2019 U 01_all_default-fortify-source.patch + 21_all_kr-decl-PR88214.patch
[gentoo-commits] proj/gcc-patches:master commit in: 7.4.0/gentoo/
commit: d3e7c05cbf9c7590bb3a21158613e24a05036c83 Author: Sergei Trofimovich gentoo org> AuthorDate: Mon Feb 11 21:58:50 2019 + Commit: Sergei Trofimovich gentoo org> CommitDate: Mon Feb 11 21:58:50 2019 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=d3e7c05c 7.4.0: lto: fix target-specific option leak into global constructors Picked upstream patch as-is: https://github.com/gcc-mirror/gcc/commit/332446ac24e5b37f441f7c9cb0b97fc36f9f0aa3 Bug: https://bugs.gentoo.org/677724 Signed-off-by: Sergei Trofimovich gentoo.org> 7.4.0/gentoo/22_all_lto-ctor-dtor-target.patch | 64 ++ 7.4.0/gentoo/README.history| 1 + 2 files changed, 65 insertions(+) diff --git a/7.4.0/gentoo/22_all_lto-ctor-dtor-target.patch b/7.4.0/gentoo/22_all_lto-ctor-dtor-target.patch new file mode 100644 index 000..206daae --- /dev/null +++ b/7.4.0/gentoo/22_all_lto-ctor-dtor-target.patch @@ -0,0 +1,64 @@ +https://bugs.gentoo.org/677724 + +Apply file-specific target-specific optimisation to constructors and +destructors. Fixes leaking of target-specific options from one unit +to another. On firefox this change fixes -mavx2 leak from files guarded +by CPU flag detection into other files. + +From 332446ac24e5b37f441f7c9cb0b97fc36f9f0aa3 Mon Sep 17 00:00:00 2001 +From: hubicka +Date: Sat, 15 Dec 2018 10:31:37 + +Subject: [PATCH] * ipa.c (cgraph_build_static_cdtor_1): Add + OPTIMIZATION and TARGET parameters. (cgraph_build_static_cdtor): + Update. (build_cdtor): Use OPTIMIZATION and TARGET of the first real + cdtor callsed. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267168 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/ipa.c | 12 +--- + +--- a/gcc/ipa.c b/gcc/ipa.c +@@ -831,7 +831,9 @@ ipa_discover_variable_flags (void) +be produced. */ + + static void +-cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) ++cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final, ++ tree optimization, ++ tree target) + { + static int counter = 0; + char which_buf[16]; +@@ -862,6 +864,8 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) + + TREE_STATIC (decl) = 1; + TREE_USED (decl) = 1; ++ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) = optimization; ++ DECL_FUNCTION_SPECIFIC_TARGET (decl) = target; + DECL_ARTIFICIAL (decl) = 1; + DECL_IGNORED_P (decl) = 1; + DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1; +@@ -911,7 +915,7 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final) + void + cgraph_build_static_cdtor (char which, tree body, int priority) + { +- cgraph_build_static_cdtor_1 (which, body, priority, false); ++ cgraph_build_static_cdtor_1 (which, body, priority, false, NULL, NULL); + } + + /* When target does not have ctors and dtors, we call all constructor +@@ -993,7 +997,9 @@ build_cdtor (bool ctor_p, const vec ) + gcc_assert (body != NULL_TREE); + /* Generate a function to call all the function of like +priority. */ +- cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true); ++ cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true, ++ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (cdtors[0]), ++ DECL_FUNCTION_SPECIFIC_TARGET (cdtors[0])); + } + } + +-- +2.20.1 + diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history index b6f486d..54c6d3d 100644 --- a/7.4.0/gentoo/README.history +++ b/7.4.0/gentoo/README.history @@ -1,6 +1,7 @@ 1.22 Feb 2019 U 01_all_default-fortify-source.patch + 21_all_kr-decl-PR88214.patch + + 22_all_lto-ctor-dtor-target.patch 1.19 Dec 2018 + 01_all_default-fortify-source.patch
[gentoo-commits] proj/gcc-patches:master commit in: 7.4.0/gentoo/
commit: eb9a9488c22065db8e428184ef4b0a711c646f3a Author: Sergei Trofimovich gentoo org> AuthorDate: Sat Feb 9 11:11:00 2019 + Commit: Sergei Trofimovich gentoo org> CommitDate: Sat Feb 9 11:11:00 2019 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=eb9a9488 7.4.0: cut 1.2 patchset Signed-off-by: Sergei Trofimovich gentoo.org> 7.4.0/gentoo/README.history | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history index bc7f40a..b6f486d 100644 --- a/7.4.0/gentoo/README.history +++ b/7.4.0/gentoo/README.history @@ -1,8 +1,8 @@ -1.12 Feb 2019 +1.22 Feb 2019 U 01_all_default-fortify-source.patch + 21_all_kr-decl-PR88214.patch -1.09 Dec 2018 +1.19 Dec 2018 + 01_all_default-fortify-source.patch + 02_all_default-warn-format-security.patch + 03_all_default-warn-trampolines.patch
[gentoo-commits] proj/gcc-patches:master commit in: 7.4.0/gentoo/
commit: a40856c8621381218e13356e052a5ae9f561e38b Author: Sergei Trofimovich gentoo org> AuthorDate: Sat Feb 9 11:03:33 2019 + Commit: Sergei Trofimovich gentoo org> CommitDate: Sat Feb 9 11:03:33 2019 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=a40856c8 7.4.0: cut 1.1 patchset Signed-off-by: Sergei Trofimovich gentoo.org> 7.4.0/gentoo/README.history | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history index e51f83e..bc7f40a 100644 --- a/7.4.0/gentoo/README.history +++ b/7.4.0/gentoo/README.history @@ -1,8 +1,8 @@ -1.1TODO +1.12 Feb 2019 U 01_all_default-fortify-source.patch + 21_all_kr-decl-PR88214.patch -1.0[not released, a copy of 7.3.0] +1.09 Dec 2018 + 01_all_default-fortify-source.patch + 02_all_default-warn-format-security.patch + 03_all_default-warn-trampolines.patch
[gentoo-commits] proj/gcc-patches:master commit in: 7.4.0/gentoo/
commit: ef2a97ee34b85bfb7865ce9d78d28b4a31294706 Author: Sergei Trofimovich gentoo org> AuthorDate: Mon Dec 10 22:48:02 2018 + Commit: Sergei Trofimovich gentoo org> CommitDate: Mon Dec 10 22:48:02 2018 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=ef2a97ee 7.4.0: fix gcc SIGSEGV on k style declarations, bug #672032 Fix gcc SIGSEGV on net-analyzer/netcat-110 (IPA analysis assumed pointer argument where it was not). Reported-by: ernsteiswuerfel https://bugs.gentoo.org/672032 https://gcc.gnu.org/PR88214 Signed-off-by: Sergei Trofimovich gentoo.org> 7.4.0/gentoo/21_all_kr-decl-PR88214.patch | 46 +++ 7.4.0/gentoo/README.history | 1 + 2 files changed, 47 insertions(+) diff --git a/7.4.0/gentoo/21_all_kr-decl-PR88214.patch b/7.4.0/gentoo/21_all_kr-decl-PR88214.patch new file mode 100644 index 000..182ff07 --- /dev/null +++ b/7.4.0/gentoo/21_all_kr-decl-PR88214.patch @@ -0,0 +1,46 @@ +https://bugs.gentoo.org/672032 +https://gcc.gnu.org/PR88214 + +From a2fd08219c82eba4d1d15f260db98c2e154268f2 Mon Sep 17 00:00:00 2001 +From: jamborm +Date: Mon, 10 Dec 2018 12:45:47 + +Subject: [PATCH] [PR 88214] Check that an argument is a pointer + +2018-12-10 Martin Jambor + + PR ipa/88214 + * ipa-prop.c (determine_locally_known_aggregate_parts): Make sure + we check pointers against pointers. + + testsuite/ + * gcc.dg/ipa/pr88214.c: New test. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266953 138bc75d-0d04-0410-961f-82ee72b054a4 +--- a/gcc/ipa-prop.c b/gcc/ipa-prop.c +@@ -1569,7 +1569,8 @@ determine_locally_known_aggregate_parts (gcall *call, tree arg, + if (TREE_CODE (arg) == SSA_NAME) + { + tree type_size; +- if (!tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (arg_type ++ if (!tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (arg_type))) ++|| !POINTER_TYPE_P (TREE_TYPE (arg))) + return; + check_ref = true; + arg_base = arg; +--- /dev/null b/gcc/testsuite/gcc.dg/ipa/pr88214.c +@@ -0,0 +1,10 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2" } */ ++ ++void i(); ++ short a; ++ void b(e) char * e; ++ { ++i(); ++b(a); ++ } +-- +2.19.2 + diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history index b1796a4..e51f83e 100644 --- a/7.4.0/gentoo/README.history +++ b/7.4.0/gentoo/README.history @@ -1,5 +1,6 @@ 1.1TODO U 01_all_default-fortify-source.patch + + 21_all_kr-decl-PR88214.patch 1.0[not released, a copy of 7.3.0] + 01_all_default-fortify-source.patch
[gentoo-commits] proj/gcc-patches:master commit in: 7.4.0/gentoo/
commit: f972c07952bc783c87784f823ba779c40632d705 Author: Sergei Trofimovich gentoo org> AuthorDate: Sun Dec 9 11:14:13 2018 + Commit: Sergei Trofimovich gentoo org> CommitDate: Sun Dec 9 11:14:13 2018 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=f972c079 7.4.0/README.history: fix comment to mention correct base for patches Signed-off-by: Sergei Trofimovich gentoo.org> 7.4.0/gentoo/README.history | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history index 57a1e8f..b1796a4 100644 --- a/7.4.0/gentoo/README.history +++ b/7.4.0/gentoo/README.history @@ -1,7 +1,7 @@ 1.1TODO U 01_all_default-fortify-source.patch -1.0[not released, a copy of 8.2.0] +1.0[not released, a copy of 7.3.0] + 01_all_default-fortify-source.patch + 02_all_default-warn-format-security.patch + 03_all_default-warn-trampolines.patch
[gentoo-commits] proj/gcc-patches:master commit in: 7.4.0/gentoo/
commit: 0402657947045ebe81a9806e8dfdeaf69591e6a0 Author: Sergei Trofimovich gentoo org> AuthorDate: Fri Dec 7 22:53:01 2018 + Commit: Sergei Trofimovich gentoo org> CommitDate: Fri Dec 7 22:53:01 2018 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=04026579 7.4.0: pull 10_all_default-fortify-source.patch from Debian, bug #621036 Reported-by: Martin Kletzander Bug: https://bugs.gentoo.org/621036 Signed-off-by: Sergei Trofimovich gentoo.org> 7.4.0/gentoo/01_all_default-fortify-source.patch | 17 - 7.4.0/gentoo/README.history | 5 - 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/7.4.0/gentoo/01_all_default-fortify-source.patch b/7.4.0/gentoo/01_all_default-fortify-source.patch index 36c5762..d307474 100644 --- a/7.4.0/gentoo/01_all_default-fortify-source.patch +++ b/7.4.0/gentoo/01_all_default-fortify-source.patch @@ -1,14 +1,21 @@ -Enable -D_FORTIFY_SOURCE=2 by default. - +Taken Debian's patch and removed docs matches: +https://salsa.debian.org/toolchain-team/gcc.git +Also see https://bugs.gentoo.org/621036 where +initially Gentoo used too complicated macro. +# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++, +# DP: if the optimization level is > 0 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c -@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile) +@@ -951,6 +951,12 @@ c_cpp_builtins (cpp_reader *pfile) builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); -+ /* Fortify Source enabled by default w/optimization. */ -+ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)"); ++#if !defined(ACCEL_COMPILER) ++ /* Fortify Source enabled by default for optimization levels > 0 */ ++ if (optimize) ++builtin_define_with_int_value ("_FORTIFY_SOURCE", 2); ++#endif + /* Misc. */ if (flag_gnu89_inline) diff --git a/7.4.0/gentoo/README.history b/7.4.0/gentoo/README.history index 14581f5..57a1e8f 100644 --- a/7.4.0/gentoo/README.history +++ b/7.4.0/gentoo/README.history @@ -1,4 +1,7 @@ -1.0TODO +1.1TODO + U 01_all_default-fortify-source.patch + +1.0[not released, a copy of 8.2.0] + 01_all_default-fortify-source.patch + 02_all_default-warn-format-security.patch + 03_all_default-warn-trampolines.patch
[gentoo-commits] proj/gcc-patches:master commit in: 7.4.0/gentoo/
commit: ad0f148e782c3ddfbe3bb33da63d26ac6dccc211 Author: Sergei Trofimovich gentoo org> AuthorDate: Fri Dec 7 00:24:41 2018 + Commit: Sergei Trofimovich gentoo org> CommitDate: Fri Dec 7 00:24:41 2018 + URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=ad0f148e 7.4.0: initial copy/rename of 7.3.0 patches not included in 7.4.0 No existing patches were changes safe the rename. Signed-off-by: Sergei Trofimovich gentoo.org> 7.4.0/gentoo/01_all_default-fortify-source.patch | 15 .../02_all_default-warn-format-security.patch | 22 ++ 7.4.0/gentoo/03_all_default-warn-trampolines.patch | 13 +++ 7.4.0/gentoo/04_all_default-ssp-fix.patch | 32 7.4.0/gentoo/05_all_alpha-mieee-default.patch | 39 + 7.4.0/gentoo/06_all_ia64_note.GNU-stack.patch | 92 ++ 7.4.0/gentoo/07_all_libiberty-asprintf.patch | 18 + 7.4.0/gentoo/08_all_libiberty-pic.patch| 10 +++ 7.4.0/gentoo/09_all_nopie-all-flags.patch | 18 + 7.4.0/gentoo/10_all_extra-options.patch| 87 .../11_all_pr55930-dependency-tracking.patch | 18 + 7.4.0/gentoo/12_all_sh-drop-sysroot-suffix.patch | 32 7.4.0/gentoo/13_all_respect-build-cxxflags.patch | 39 + 7.4.0/gentoo/14_all_libgfortran-Werror.patch | 20 + 7.4.0/gentoo/15_all_libgomp-Werror.patch | 20 + 7.4.0/gentoo/16_all_libitm-Werror.patch| 19 + 7.4.0/gentoo/17_all_libatomic-Werror.patch | 19 + 7.4.0/gentoo/18_all_libbacktrace-Werror.patch | 17 .../19_all_libsanitizer-libbacktrace-Werror.patch | 17 7.4.0/gentoo/20_all_libstdcxx-no-vtv.patch | 61 ++ 7.4.0/gentoo/README.history| 21 + 21 files changed, 629 insertions(+) diff --git a/7.4.0/gentoo/01_all_default-fortify-source.patch b/7.4.0/gentoo/01_all_default-fortify-source.patch new file mode 100644 index 000..36c5762 --- /dev/null +++ b/7.4.0/gentoo/01_all_default-fortify-source.patch @@ -0,0 +1,15 @@ +Enable -D_FORTIFY_SOURCE=2 by default. + + +--- a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c +@@ -951,6 +951,9 @@ c_cpp_builtins (cpp_reader *pfile) + builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0); + builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0); + ++ /* Fortify Source enabled by default w/optimization. */ ++ cpp_define (pfile, "_FORTIFY_SOURCE=((defined __OPTIMIZE__ && __OPTIMIZE__ > 0) ? 2 : 0)"); ++ + /* Misc. */ + if (flag_gnu89_inline) + cpp_define (pfile, "__GNUC_GNU_INLINE__"); diff --git a/7.4.0/gentoo/02_all_default-warn-format-security.patch b/7.4.0/gentoo/02_all_default-warn-format-security.patch new file mode 100644 index 000..8994654 --- /dev/null +++ b/7.4.0/gentoo/02_all_default-warn-format-security.patch @@ -0,0 +1,22 @@ +Enable -Wformat and -Wformat-security by default. + +--- a/gcc/c-family/c.opt 2016-03-23 18:51:56.0 +0100 b/gcc/c-family/c.opt 2016-04-28 23:45:54.063351272 +0200 +@@ -459,7 +459,7 @@ C ObjC C++ ObjC++ Var(warn_format_nonlit + Warn about format strings that are not literals. + + Wformat-security +-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) ++C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0) + Warn about possible security problems with format functions. + + Wformat-signedness +@@ -475,7 +475,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_l + Warn about zero-length formats. + + Wformat= +-C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) ++C ObjC C++ ObjC++ Joined RejectNegative UInteger Var(warn_format) Init(1) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall, 1, 0) + Warn about printf/scanf/strftime/strfmon format string anomalies. + + Wignored-qualifiers diff --git a/7.4.0/gentoo/03_all_default-warn-trampolines.patch b/7.4.0/gentoo/03_all_default-warn-trampolines.patch new file mode 100644 index 000..7a644cb --- /dev/null +++ b/7.4.0/gentoo/03_all_default-warn-trampolines.patch @@ -0,0 +1,13 @@ +Enable -Wtrampolines by default. + +--- a/gcc/common.opt b/gcc/common.opt +@@ -712,7 +712,7 @@ Common Var(warn_system_headers) Warning + Do not suppress warnings from system headers. + + Wtrampolines +-Common Var(warn_trampolines) Warning ++Common Var(warn_trampolines) Init(1) Warning + Warn whenever a trampoline is generated. + + Wtype-limits diff --git a/7.4.0/gentoo/04_all_default-ssp-fix.patch b/7.4.0/gentoo/04_all_default-ssp-fix.patch new file mode 100644 index 000..2cd1b8d --- /dev/null +++ b/7.4.0/gentoo/04_all_default-ssp-fix.patch @@ -0,0 +1,32 @@ +Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding +Change the buffer size. +