public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/111343] New: [SH] Including <cmath> in C++23 causes an ICE with -m4-single-only
@ 2023-09-08 20:56 gyrovorbis at gmail dot com
  2023-09-08 21:13 ` [Bug target/111343] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gyrovorbis at gmail dot com @ 2023-09-08 20:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111343
           Summary: [SH] Including <cmath> in C++23 causes an ICE with
                    -m4-single-only
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gyrovorbis at gmail dot com
  Target Milestone: ---

We recently updated from GCC12 to GCC13 in the Sega Dreamcast indie SDK,
KallistiOS, and while pretty much everything has worked fantastically, we are
encountering a pretty serious ICE when attempting to include the <cmath> header
with the -m4-single-only SH-specific flag (which treats doubles as floats),
when compiling as C++23.

The minimal program to reproduce the issue is here:

#include <cmath>

int main(int argc, char* argv[]) { 
    return 0;
}

We are building with: -std=c++23 -m4-single-only


Note that without the -m4-single-only flag, the ICE disappears. Note also that
without including <cmath>, with this flag, the following static assertion
fails:

static_assert(sizeof(__STDCPP_FLOAT64_T__) == 8,
             "Oh god, Dreamcast broke!");


Here is a link to a repro in Compiler Explorer: https://godbolt.org/z/MrE8a47oq

I'm assuming the addition of the new C++23 <stdfloat> types is clashing with
the `-m4-single-only` flag, as it doesn't seem as though when these types are
created, there is any checking for sizeof(double) or anything target-specific:
https://github.com/gcc-mirror/gcc/blob/a7d052b3200c7928d903a0242b8cfd75d131e374/gcc/c-family/c-cppbuiltin.cc#L1265

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

end of thread, other threads:[~2024-06-17 17:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08 20:56 [Bug c++/111343] New: [SH] Including <cmath> in C++23 causes an ICE with -m4-single-only gyrovorbis at gmail dot com
2023-09-08 21:13 ` [Bug target/111343] " pinskia at gcc dot gnu.org
2023-09-27  5:02 ` olegendo at gcc dot gnu.org
2024-06-17  8:48 ` jakub at gcc dot gnu.org
2024-06-17 16:59 ` cvs-commit at gcc dot gnu.org
2024-06-17 17:19 ` cvs-commit at gcc dot gnu.org
2024-06-17 17:23 ` cvs-commit 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).