public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/66657] New: Feature request - assembly output from lto compiler
@ 2015-06-24 20:35 kalmquist1 at hotmail dot com
  2015-06-24 20:36 ` [Bug driver/66657] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kalmquist1 at hotmail dot com @ 2015-06-24 20:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66657
           Summary: Feature request - assembly output from lto compiler
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kalmquist1 at hotmail dot com
  Target Milestone: ---

There should be a gcc command line option to generate the assembly language
output of the lto compiler.  The -S option doesn't do this because it prevents
the lto compilation phase from running at all.

Currently, the only way to accomplish this is to run the lto compiler directly,
as in the following example:

  ld -r -plugin /usr/lib/gcc/x86_64-linux-gnu/4.8/liblto_plugin.so \
     -plugin-opt=/bin/true -plugin-opt=-fresolution=out.res in1.o in2.o
  /usr/lib/gcc/x86_64-linux-gnu/4.8/lto1 -quiet \
     -fresolution=out.res -o out.s -O2 in1.o in2.o

This is ugly and undocumented.


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

* [Bug driver/66657] Feature request - assembly output from lto compiler
  2015-06-24 20:35 [Bug driver/66657] New: Feature request - assembly output from lto compiler kalmquist1 at hotmail dot com
@ 2015-06-24 20:36 ` pinskia at gcc dot gnu.org
  2015-06-25 21:51 ` kalmquist1 at hotmail dot com
  2021-09-01 22:24 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-06-24 20:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>There should be a gcc command line option to generate the assembly language output of the lto compiler. 

Use -save-temps.


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

* [Bug driver/66657] Feature request - assembly output from lto compiler
  2015-06-24 20:35 [Bug driver/66657] New: Feature request - assembly output from lto compiler kalmquist1 at hotmail dot com
  2015-06-24 20:36 ` [Bug driver/66657] " pinskia at gcc dot gnu.org
@ 2015-06-25 21:51 ` kalmquist1 at hotmail dot com
  2021-09-01 22:24 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: kalmquist1 at hotmail dot com @ 2015-06-25 21:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Kenneth Almquist <kalmquist1 at hotmail dot com> ---
(In reply to Andrew Pinski from comment #2)
> What are you trying to do with the assembly after the fact?

In this particular case, I wanted to look at it for two reasons:

1)  To determine which functions were being inlined.

2)  To identify errant calls to printf and puts.  When compiled to run in
background mode, my program should send all messages to the log rather than
stdout/stderr, so calls to printf/puts that the compiler doesn't discard as
unreachable represent program bugs.

Gcc has had the -S option for essentially forever, and I've probably used it
more times and for more reasons than I can remember at this point.


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

* [Bug driver/66657] Feature request - assembly output from lto compiler
  2015-06-24 20:35 [Bug driver/66657] New: Feature request - assembly output from lto compiler kalmquist1 at hotmail dot com
  2015-06-24 20:36 ` [Bug driver/66657] " pinskia at gcc dot gnu.org
  2015-06-25 21:51 ` kalmquist1 at hotmail dot com
@ 2021-09-01 22:24 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-01 22:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Kenneth Almquist from comment #3)
> (In reply to Andrew Pinski from comment #2)
> > What are you trying to do with the assembly after the fact?
> 
> In this particular case, I wanted to look at it for two reasons:
> 
> 1)  To determine which functions were being inlined.

For recent compilers you can use -fopt-info option which should supply this; if
it does not then we should improve it to supply what you need.

> 
> 2)  To identify errant calls to printf and puts.  When compiled to run in
> background mode, my program should send all messages to the log rather than
> stdout/stderr, so calls to printf/puts that the compiler doesn't discard as
> unreachable represent program bugs.

For this, as mentioned you can use post tools like objdump/nm/etc. and even the
you can use a GNU linker option to warn at link time.

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

end of thread, other threads:[~2021-09-01 22:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-24 20:35 [Bug driver/66657] New: Feature request - assembly output from lto compiler kalmquist1 at hotmail dot com
2015-06-24 20:36 ` [Bug driver/66657] " pinskia at gcc dot gnu.org
2015-06-25 21:51 ` kalmquist1 at hotmail dot com
2021-09-01 22:24 ` 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).