diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-05-23 23:40:10 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2024-08-07 09:57:51 -0500 |
commit | 93cf7fc8b05fe3003b6f16b766622544cdf3830b (patch) | |
tree | 594b1c2e06144b9e0b0dae1310399b5935ddc5ff /system/gcc/backport-r267157-posix-conformant-snprintf.patch | |
parent | d15fa95546e4f4200700750986fb5e249d9bfbe1 (diff) | |
download | packages-93cf7fc8b05fe3003b6f16b766622544cdf3830b.tar.gz packages-93cf7fc8b05fe3003b6f16b766622544cdf3830b.tar.bz2 packages-93cf7fc8b05fe3003b6f16b766622544cdf3830b.tar.xz packages-93cf7fc8b05fe3003b6f16b766622544cdf3830b.zip |
system/gcc: Update to 13.3.0
0012-static-pie and 201-ada were forward-ported by my own paws.
Three digit 0xx underscore patches are from Gentoo. This is also the
source of the insn-split and match-split patches, which significantly
increase performance on build. They are also the source of the new
configure option --with-matchpd-partitions. On systems with very many
cores/threads, a number higher than 32 would probably perform even
better, but 32 should give decent perf on 8+ threads, and runs quite
nicely on the 64-thread Talos II I ran the testbuild on.
202 is from Void. The 300s are originally written by me.
The Ada patch now includes an improvement to use posix_openpt instead
of getpt, which fixes link errors later on.
We also now use STAGE1_CFLAGS and BOOT_CFLAGS to improve build times.
Improvement was clocked from 40m to 32m (-8m, or 20%) on gwyn.
The patch for Go name mangling is needed to build packages that use
reflect2, which includes user/gitlab-runner.
Diffstat (limited to 'system/gcc/backport-r267157-posix-conformant-snprintf.patch')
-rw-r--r-- | system/gcc/backport-r267157-posix-conformant-snprintf.patch | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/system/gcc/backport-r267157-posix-conformant-snprintf.patch b/system/gcc/backport-r267157-posix-conformant-snprintf.patch deleted file mode 100644 index adedf0ce9..000000000 --- a/system/gcc/backport-r267157-posix-conformant-snprintf.patch +++ /dev/null @@ -1,80 +0,0 @@ -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87096 - -GCC's "optimised" snprintf is not POSIX conformant - ---- trunk/gcc/gimple-ssa-sprintf.c 2018/12/07 17:02:11 266897 -+++ trunk/gcc/gimple-ssa-sprintf.c 2018/12/14 22:38:08 267157 -@@ -3899,6 +3899,7 @@ - /* True when the destination size is constant as opposed to the lower - or upper bound of a range. */ - bool dstsize_cst_p = true; -+ bool posunder4k = true; - - if (idx_dstsize == HOST_WIDE_INT_M1U) - { -@@ -3931,11 +3932,20 @@ - "specified bound %wu exceeds maximum object size " - "%wu", - dstsize, target_size_max () / 2); -+ /* POSIX requires snprintf to fail if DSTSIZE is greater -+ than INT_MAX. Even though not all POSIX implementations -+ conform to the requirement, avoid folding in this case. */ -+ posunder4k = false; - } - else if (dstsize > target_int_max ()) -- warning_at (gimple_location (info.callstmt), info.warnopt (), -- "specified bound %wu exceeds %<INT_MAX%>", -- dstsize); -+ { -+ warning_at (gimple_location (info.callstmt), info.warnopt (), -+ "specified bound %wu exceeds %<INT_MAX%>", -+ dstsize); -+ /* POSIX requires snprintf to fail if DSTSIZE is greater -+ than INT_MAX. Avoid folding in that case. */ -+ posunder4k = false; -+ } - } - else if (TREE_CODE (size) == SSA_NAME) - { -@@ -3944,9 +3954,29 @@ - if (vr->type == VR_RANGE - && TREE_CODE (vr->min) == INTEGER_CST - && TREE_CODE (vr->max) == INTEGER_CST) -- dstsize = (warn_level < 2 -- ? TREE_INT_CST_LOW (vr->max) -- : TREE_INT_CST_LOW (vr->min)); -+ { -+ unsigned HOST_WIDE_INT minsize = TREE_INT_CST_LOW (vr->min); -+ unsigned HOST_WIDE_INT maxsize = TREE_INT_CST_LOW (vr->max); -+ dstsize = warn_level < 2 ? maxsize : minsize; -+ -+ if (minsize > target_int_max ()) -+ warning_at (gimple_location (info.callstmt), info.warnopt (), -+ "specified bound range [%wu, %wu] exceeds " -+ "%<INT_MAX%>", -+ minsize, maxsize); -+ -+ /* POSIX requires snprintf to fail if DSTSIZE is greater -+ than INT_MAX. Avoid folding if that's possible. */ -+ if (maxsize > target_int_max ()) -+ posunder4k = false; -+ } -+ else if (vr->type == VR_VARYING) -+ { -+ /* POSIX requires snprintf to fail if DSTSIZE is greater -+ than INT_MAX. Since SIZE's range is unknown, avoid -+ folding. */ -+ posunder4k = false; -+ } - - /* The destination size is not constant. If the function is - bounded (e.g., snprintf) a lower bound of zero doesn't -@@ -4033,7 +4073,7 @@ - the call. Avoid this optimization when -frounding-math is in effect - and the format string contains a floating point directive. */ - bool call_removed = false; -- if (success && optimize > 0) -+ if (!posunder4k && success && optimize > 0) - { - /* Save a copy of the iterator pointing at the call. The iterator - may change to point past the call in try_substitute_return_value |