Bug 2214847

Summary: internal compiler error: output_operand: invalid %-code
Product: Red Hat Enterprise Linux 8 Reporter: Jan Horak <jhorak>
Component: gccAssignee: Marek Polacek <mpolacek>
gcc sub component: system-version QA Contact: Václav Kadlčík <vkadlcik>
Status: VERIFIED --- Docs Contact:
Severity: unspecified    
Priority: unspecified CC: ahajkova, fweimer, jakub, ohudlick, sipoyare, vkadlcik
Version: 8.8Keywords: Bugfix, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: s390x   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-8.5.0-20.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
preprocessed source none

Description Jan Horak 2023-06-13 20:15:44 UTC
Created attachment 1970746 [details]
preprocessed source

/usr/bin/g++ -std=gnu++17 -o generated_message_tctable_lite.o -c  -I/root/rpmbuild/BUILD/firefox-115.0/objdir/dist/stl_wrappers -I/root/rpmbuild/BUILD/firefox-115.0/objdir/dist/system_wrappers -include /root/rpmbuild/BUILD/firefox-115.0/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DHAVE_ZLIB -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -I/root/rpmbuild/BUILD/firefox-115.0/toolkit/components/protobuf -I/root/rpmbuild/BUILD/firefox-115.0/objdir/toolkit/components/protobuf -I/root/rpmbuild/BUILD/firefox-115.0/objdir/dist/include -I/root/rpmbuild/BUILD/firefox-115.0/objdir/dist/include/nspr -I/root/rpmbuild/BUILD/firefox-115.0/objdir/dist/include/nss -DMOZILLA_CLIENT -include /root/rpmbuild/BUILD/firefox-115.0/objdir/mozilla-config.h -fno-sized-deallocation -fno-aligned-new -O2 -g -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=z13 -mtune=z14 -fasynchronous-unwind-tables -fstack-clash-protection -Wformat-security -Wformat -Werror=format-security -fPIC -Wl,-z,relro -Wl,-z,now -DNSS_PKCS11_3_0_STRICT -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -gdwarf-4 -g -O1 -fomit-frame-pointer -funwind-tables -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wno-error=deprecated -Wduplicated-cond -Wimplicit-fallthrough -Wlogical-op -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wformat -Wformat-overflow=2 -Wno-psabi -Wno-error=builtin-macro-redefined -Wno-ignored-qualifiers -Wno-maybe-uninitialized -Wno-return-type -Wno-sign-compare -Wno-subobject-linkage -Wno-unused-function -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/uuid -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0/unix-print -pthread -fno-strict-aliasing -ffp-contract=off  -MD -MP -MF .deps/generated_message_tctable_lite.o.pp   /root/rpmbuild/BUILD/firefox-115.0/toolkit/components/protobuf/src/google/protobuf/generated_message_tctable_lite.cc
*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_FINISH_UNIT               | annobin: Generate final annotations
PLUGIN_START_UNIT                | annobin: Generate global annotations
PLUGIN_ALL_PASSES_START          | annobin: Generate per-function annotations
PLUGIN_ALL_PASSES_END            | annobin: Register per-function end symbols
during RTL pass: final
/root/rpmbuild/BUILD/firefox-115.0/toolkit/components/protobuf/src/google/protobuf/generated_message_tctable_lite.cc: In static member function ‘static const char* google::protobuf::internal::TcParser::MiniParse(google::protobuf::MessageLite*, const char*, google::protobuf::internal::ParseContext*, const google::protobuf::internal::TcParseTableBase*, uint64_t, google::protobuf::internal::TcFieldData)’:
/root/rpmbuild/BUILD/firefox-115.0/toolkit/components/protobuf/src/google/protobuf/generated_message_tctable_lite.cc:342:1: internal compiler error: output_operand: invalid %-code
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
{standard input}: Assembler messages:
{standard input}:15334: Warning: end of file not at end of a line; newline inserted
{standard input}:15514: Error: missing operand
{standard input}:15514: Error: syntax error; expected ','
{standard input}:15514: Error: missing operand
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive

Comment 2 Jakub Jelinek 2023-06-14 08:02:57 UTC
This was fixed upstream for GCC 9 and later in https://gcc.gnu.org/PR87723
We just need to cherry-pick that fix, should apply cleanly.

Short testcase -O2 -march=z10:
unsigned long
foo (unsigned long x, unsigned long y)
{
  unsigned long z = (x << 57) | (x >> 7);
  z &= 0xfe00000000000000UL;
  return z | y;
}

Comment 3 Marek Polacek 2023-06-15 21:20:16 UTC
# rpm -q gcc
gcc-8.5.0-19.el8.s390x
# gcc bz.c -c -O2 -march=z10
during RTL pass: final
bz.c: In function ‘foo’:
bz.c:7:1: internal compiler error: output_operand: invalid %-code
 }
 ^
# rpm -q gcc
gcc-8.5.0-20.el8.s390x
# gcc bz.c -c -O2 -march=z10
# OK