public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114753] New: from_chars aborts with -m32 -ftrapv when passed -9223372036854775808
@ 2024-04-17 10:30 gnu.ojxq8 at dralias dot com
  2024-04-17 10:45 ` [Bug c++/114753] " redi at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: gnu.ojxq8 at dralias dot com @ 2024-04-17 10:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114753

            Bug ID: 114753
           Summary: from_chars aborts with -m32 -ftrapv when passed
                    -9223372036854775808
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gnu.ojxq8 at dralias dot com
  Target Milestone: ---

std::from_chars may abort when used with -m32 -ftrapv on some values.

Without -m32, or without -ftrapv, or using clang, the code works correctly.

To reproduce:

$ cat a.cpp 
#include <charconv>
#include <cstdint>
#include <string_view>
int main() {
  int64_t result{};
  std::string_view str{"-9223372036854775808"};
  (void)std::from_chars(str.begin(), str.end(), result);
  return result != -9223372036854775807 - 1;
}


$  g++ -m32 -ftrapv -std=c++17 ./a.cpp && ./a.out 
Aborted (core dumped)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-04-23  6:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 10:30 [Bug c++/114753] New: from_chars aborts with -m32 -ftrapv when passed -9223372036854775808 gnu.ojxq8 at dralias dot com
2024-04-17 10:45 ` [Bug c++/114753] " redi at gcc dot gnu.org
2024-04-17 10:49 ` redi at gcc dot gnu.org
2024-04-17 10:56 ` [Bug middle-end/114753] " rguenth at gcc dot gnu.org
2024-04-17 11:00 ` rguenth at gcc dot gnu.org
2024-04-17 11:30 ` jakub at gcc dot gnu.org
2024-04-17 12:00 ` jakub at gcc dot gnu.org
2024-04-18  7:45 ` cvs-commit at gcc dot gnu.org
2024-04-18  7:51 ` jakub at gcc dot gnu.org
2024-04-19 16:16 ` cvs-commit at gcc dot gnu.org
2024-04-21  4:09 ` cvs-commit at gcc dot gnu.org
2024-04-23  6:43 ` jakub at gcc dot gnu.org

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).