public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/94150] New: Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location
@ 2020-03-11 21:29 romain.geissler at amadeus dot com
  2020-03-12  9:21 ` [Bug lto/94150] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: romain.geissler at amadeus dot com @ 2020-03-11 21:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94150
           Summary: Improve LTO diagnosis for LTO triggered
                    warnings/error: print source.o or source.a(lib.o) when
                    printing location
           Product: gcc
           Version: lto
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: romain.geissler at amadeus dot com
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Hi,

When LTO warnings/error are reported and print a given location, it would be
nice to not only print the C/C++ file name, but also from which .o or .a
library it comes from.

Example of -Werror=lto-type-mistmatch I just got because I was mixing
incompatible .o built against different version of the same header file
"toolbox/UTF8Utils.h":

/remote/intdeliv/components/mdw/Toolbox/18-0-0-56/include/toolbox/UTF8Utils.h:106:
error: type of ‘operator[]’ does not match original declaration
[-Werror=lto-type-mismatch]
     char operator[] (size_t x);

src/UTF8Utils.cpp:148: note: implicit this pointer type mismatch
include/toolbox/UTF8Utils.h:23: note: type ‘struct UTF8Char’ itself violates
the C++ One Definition Rule
/remote/tmp/rnd-aqg/software_factory/bms_replication/mdw/Toolbox/18-0-0-48/include/toolbox/UTF8Utils.h:22:
note: the incompatible type is defined here
 class TOOLBOX_EXPORT UTF8Char

src/UTF8Utils.cpp:148: note: ‘operator[]’ was previously declared here
src/UTF8Utils.cpp:148: note: code may be misoptimized unless
-fno-strict-aliasing is used


The problem here is that I mixed our own version of a library named "Toolbox"
from version 18-0-0-56 and 18-0-0-48 which are incompatible. I need to rebuild
the .o which is using version 18-0-0-48 as given in the error, however I have
no idea which libraries is that, and I have hundreds of them, which
unfortunately I can't rebuild massively easily.

So if the location in LTO mode could print something like:

/path/to/wrong/lib.a(name_of_o_file.o):/remote/tmp/rnd-aqg/software_factory/bms_replication/mdw/Toolbox/18-0-0-48/include/toolbox/UTF8Utils.h:22:
note: the incompatible type is defined here
 class TOOLBOX_EXPORT UTF8Char

that would help identifying which files need rebuilding.

Cheers,
Romain

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

* [Bug lto/94150] Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location
  2020-03-11 21:29 [Bug lto/94150] New: Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location romain.geissler at amadeus dot com
@ 2020-03-12  9:21 ` rguenth at gcc dot gnu.org
  2020-03-12  9:23 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-03-12  9:21 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
   Last reconfirmed|                            |2020-03-12
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  Probably easy for the special LTO aware diagnostics but harder in
general since there's no concept of a translation unit in our locations
and locations are also used for debug info generation.

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

* [Bug lto/94150] Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location
  2020-03-11 21:29 [Bug lto/94150] New: Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location romain.geissler at amadeus dot com
  2020-03-12  9:21 ` [Bug lto/94150] " rguenth at gcc dot gnu.org
@ 2020-03-12  9:23 ` marxin at gcc dot gnu.org
  2021-12-24 11:50 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-03-12  9:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
You can probably use -fdump-ipa-cgraph where you will see object files:
...
  Read from file: pr91307-1.o
...

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

* [Bug lto/94150] Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location
  2020-03-11 21:29 [Bug lto/94150] New: Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location romain.geissler at amadeus dot com
  2020-03-12  9:21 ` [Bug lto/94150] " rguenth at gcc dot gnu.org
  2020-03-12  9:23 ` marxin at gcc dot gnu.org
@ 2021-12-24 11:50 ` pinskia at gcc dot gnu.org
  2021-12-24 11:51 ` pinskia at gcc dot gnu.org
  2021-12-24 11:51 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-24 11:50 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alan at octopull dot co.uk

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 96969 has been marked as a duplicate of this bug. ***

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

* [Bug lto/94150] Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location
  2020-03-11 21:29 [Bug lto/94150] New: Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location romain.geissler at amadeus dot com
                   ` (2 preceding siblings ...)
  2021-12-24 11:50 ` pinskia at gcc dot gnu.org
@ 2021-12-24 11:51 ` pinskia at gcc dot gnu.org
  2021-12-24 11:51 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-24 11:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There is a nice testcase in bug 96969 comment #1.

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

* [Bug lto/94150] Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location
  2020-03-11 21:29 [Bug lto/94150] New: Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location romain.geissler at amadeus dot com
                   ` (3 preceding siblings ...)
  2021-12-24 11:51 ` pinskia at gcc dot gnu.org
@ 2021-12-24 11:51 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-24 11:51 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement

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

end of thread, other threads:[~2021-12-24 11:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 21:29 [Bug lto/94150] New: Improve LTO diagnosis for LTO triggered warnings/error: print source.o or source.a(lib.o) when printing location romain.geissler at amadeus dot com
2020-03-12  9:21 ` [Bug lto/94150] " rguenth at gcc dot gnu.org
2020-03-12  9:23 ` marxin at gcc dot gnu.org
2021-12-24 11:50 ` pinskia at gcc dot gnu.org
2021-12-24 11:51 ` pinskia at gcc dot gnu.org
2021-12-24 11:51 ` 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).