public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3025] libstdc++: Don't check always-true condition [PR101965]
@ 2021-08-19 13:57 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-08-19 13:57 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:85a709595005b5df4b2ee9d81717a5df19c0023f

commit r12-3025-g85a709595005b5df4b2ee9d81717a5df19c0023f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Aug 19 13:05:54 2021 +0100

    libstdc++: Don't check always-true condition [PR101965]
    
    Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/101965
            * include/std/charconv (__to_chars_i): Remove redundant check.

Diff:
---
 libstdc++-v3/include/std/charconv | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/include/std/charconv b/libstdc++-v3/include/std/charconv
index ac9c34d4601..2e368843fc9 100644
--- a/libstdc++-v3/include/std/charconv
+++ b/libstdc++-v3/include/std/charconv
@@ -336,12 +336,10 @@ namespace __detail
 	  *__first = '0';
 	  return { __first + 1, errc{} };
 	}
-
-      if _GLIBCXX17_CONSTEXPR (std::is_signed<_Tp>::value)
+      else if _GLIBCXX17_CONSTEXPR (std::is_signed<_Tp>::value)
 	if (__value < 0)
 	  {
-	    if (__builtin_expect(__first != __last, 1))
-	      *__first++ = '-';
+	    *__first++ = '-';
 	    __unsigned_val = _Up(~__value) + _Up(1);
 	  }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-19 13:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 13:57 [gcc r12-3025] libstdc++: Don't check always-true condition [PR101965] Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).