public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108361] New: Assembly code that is never called emitted on x86_64
@ 2023-01-10 14:05 eric-bugs at omnifarious dot org
  2023-01-10 14:05 ` [Bug c++/108361] " eric-bugs at omnifarious dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: eric-bugs at omnifarious dot org @ 2023-01-10 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108361
           Summary: Assembly code that is never called emitted on x86_64
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eric-bugs at omnifarious dot org
  Target Milestone: ---

Created attachment 54236
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54236&action=edit
Preprocessed C++ code that generates unneeded assembly

The nature of this bug makes a concise test case hard to whittle down to
something minimal...

The attached code generates a whole bunch of assembly that isn't needed. This
assembly references external symbols as well, which creates unnecessary linker
errors.

Clang handles it just fine. :-)

Attached is both the preprocessed C++ code, and the assembly it generates. The
only needed assembly is the code for main and the static data main needs.

_start is defined as a global in a separate file, which is also attached.

The compile command I'm using:

g++ -std=c++20 -march=znver2 -static -O3 -nostartfiles -nostdlib
-I/usr/include/c++/12 -I/home/hopper/src/posixpp/pubincludes -Wl,-e_start
preprocessed.s x86_64_start.s

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

end of thread, other threads:[~2023-01-10 19:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10 14:05 [Bug c++/108361] New: Assembly code that is never called emitted on x86_64 eric-bugs at omnifarious dot org
2023-01-10 14:05 ` [Bug c++/108361] " eric-bugs at omnifarious dot org
2023-01-10 14:06 ` eric-bugs at omnifarious dot org
2023-01-10 18:25 ` pinskia at gcc dot gnu.org
2023-01-10 18:26 ` pinskia at gcc dot gnu.org
2023-01-10 18:30 ` pinskia at gcc dot gnu.org
2023-01-10 19:00 ` eric-bugs at omnifarious dot 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).