public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114997] New: ICE with -std=c++20: unexpected expression ‘static_cast<UnsignedType>('\"')’ of kind static_cast_expr
@ 2024-05-08 21:20 clopez at igalia dot com
  2024-05-08 21:30 ` [Bug c++/114997] " clopez at igalia dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: clopez at igalia dot com @ 2024-05-08 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114997
           Summary: ICE with -std=c++20: unexpected expression
                    ‘static_cast<UnsignedType>('\"')’ of kind
                    static_cast_expr
           Product: gcc
           Version: 12.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: clopez at igalia dot com
  Target Milestone: ---

Created attachment 58137
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58137&action=edit
preprocessed file from JSONObject.cpp to reproduce the problem

On the WebKit project recently this commit landed:
https://github.com/WebKit/WebKit/commit/4855c7a1dc4214523c0b3d0c430215456ed7a0a9

It caused GCC-12 to fail with an ICE.

./Source/JavaScriptCore/runtime/JSONObject.cpp: In lambda function:
./Source/JavaScriptCore/runtime/JSONObject.cpp:1124:89: internal compiler
error: unexpected expression ‘static_cast<UnsignedType>('\"')’ of kind
static_cast_expr
 1124 |                 constexpr auto quoteMask =
WTF::splatBulk(static_cast<UnsignedType>('"'));
      |                                                                        
                ^
0x7ffb005ff1c9 __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0x7ffb005ff284 __libc_start_main_impl
        ../csu/libc-start.c:360
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

I checked that it fails with the last released version of GCC 12 (12.3.0) both
from Yocto
when cross-building for ARM64 as well as the GCC 12.3.0 shipped in
Debian/testing.

On Debian I tested with gcc-13 and with it builds fine.

I'm attaching the .ii file to reproduce the problem (compressed with xz as it
is quite big)

To reproduce it, download the .ii file and simple execute this command:


  g++-12 -O3 --std=c++20 -c JSONObject.ii


Not sure if useful information, but the original compiler command had the
following switches enabled

g++-12 -DBUILDING_JavaScriptCore -DBUILDING_WEBKIT=1 -DBUILDING_WITH_CMAKE=1
-DBUILDING_WPE__=1 -DBWRAP_EXECUTABLE=\"/usr/bin/bwrap\"
-DDBUS_PROXY_EXECUTABLE=\"/usr/bin/xdg-dbus-proxy\" -DGETTEXT_PACKAGE=\"WPE\"
-DHAVE_CONFIG_H=1 -DJSC_GLIB_API_ENABLED -DPAS_BMALLOC=1
-DPKGLIBDIR=\"/usr/local/lib/wpe-webkit-2.0\" -DSTATICALLY_LINKED_WITH_WTF
-DSTATICALLY_LINKED_WITH_bmalloc
[...-I/long/list/of/includes/excluded/for/clarity...]
-fdiagnostics-color=always -Wextra -Wall  -fmax-errors=20 -Wno-odr
-Wno-stringop-overread -Wno-stringop-overflow -Wno-nonnull -Wno-array-bounds
-Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi
-Wno-misleading-indentation -Wno-maybe-uninitialized -Wundef -Wpointer-arith
-Wmissing-format-attribute -Wformat-security -Wcast-align
-Wno-tautological-compare -fno-strict-aliasing -fno-exceptions -fno-rtti
-ffunction-sections -fdata-sections -O3 -DNDEBUG -fPIC -fvisibility=hidden
-fvisibility-inlines-hidden -ffp-contract=off -std=c++20 -c
Source/JavaScriptCore/runtime/JSONObject.cpp

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

end of thread, other threads:[~2024-05-09  6:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-08 21:20 [Bug c++/114997] New: ICE with -std=c++20: unexpected expression ‘static_cast<UnsignedType>('\"')’ of kind static_cast_expr clopez at igalia dot com
2024-05-08 21:30 ` [Bug c++/114997] " clopez at igalia dot com
2024-05-08 22:10 ` clopez at igalia dot com
2024-05-09  5:53 ` pinskia at gcc dot gnu.org
2024-05-09  6:03 ` [Bug c++/114997] ICE: " pinskia at gcc dot gnu.org
2024-05-09  6:07 ` [Bug c++/114997] [11/12 Only] " pinskia 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).