public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/107184] New: Copy warnings in dump files
@ 2022-10-08 12:27 glisse at gcc dot gnu.org
  2022-10-09  4:57 ` [Bug tree-optimization/107184] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: glisse at gcc dot gnu.org @ 2022-10-08 12:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107184
           Summary: Copy warnings in dump files
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org
  Target Milestone: ---

One irritation with warnings like -Wuse-after-free and all the other
optimization-based warnings is how hard they are to track. Yes, it tells me
where the call is in my code, but that's far from enough. With
-fdump-tree-waccess, I can have some idea of what the code looks like, after
various optimizations, that makes the compiler warn. However, identifying the
relevant statements in the dump file can take a long time, and it remains
faster to break out the debugger on the compiler :-(
It seems that a small thing that could help a bit would be to print a copy of
the warnings and notes in the dump file, next to the relevant statements. Or at
least some easy to find marker.
I most certainly don't claim that this will solve anything, I just see it as a
low (?) hanging fruit.

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

* [Bug tree-optimization/107184] Copy warnings in dump files
  2022-10-08 12:27 [Bug tree-optimization/107184] New: Copy warnings in dump files glisse at gcc dot gnu.org
@ 2022-10-09  4:57 ` pinskia at gcc dot gnu.org
  2022-10-10  7:13 ` rguenth at gcc dot gnu.org
  2022-10-10  8:42 ` glisse at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-09  4:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is where analyzer comes into hand really.

Maybe the warning should suggest using analyzer for more details? Even if they
are two different code bases for the warning and analyzer it seems like they
could work together ....

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

* [Bug tree-optimization/107184] Copy warnings in dump files
  2022-10-08 12:27 [Bug tree-optimization/107184] New: Copy warnings in dump files glisse at gcc dot gnu.org
  2022-10-09  4:57 ` [Bug tree-optimization/107184] " pinskia at gcc dot gnu.org
@ 2022-10-10  7:13 ` rguenth at gcc dot gnu.org
  2022-10-10  8:42 ` glisse at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-10  7:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-10-10
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed - for array-bounds I added some "array-bound warning for %E" printing
the SSA name/stmt in the dump file.

What I find useful in tracking down things is to -fdump-tree-FOO-lineno which
at least gets you the locations in the dump.

So - patches to amend dump files welcome!

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

* [Bug tree-optimization/107184] Copy warnings in dump files
  2022-10-08 12:27 [Bug tree-optimization/107184] New: Copy warnings in dump files glisse at gcc dot gnu.org
  2022-10-09  4:57 ` [Bug tree-optimization/107184] " pinskia at gcc dot gnu.org
  2022-10-10  7:13 ` rguenth at gcc dot gnu.org
@ 2022-10-10  8:42 ` glisse at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: glisse at gcc dot gnu.org @ 2022-10-10  8:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #2)
> Confirmed - for array-bounds I added some "array-bound warning for %E"
> printing the SSA name/stmt in the dump file.

Sounds good, I'll try that next time the warning is of the array-bound type.

> What I find useful in tracking down things is to -fdump-tree-FOO-lineno which
> at least gets you the locations in the dump.

Ah, I didn't know that one (-lineno isn't part of -all). It is nice, but with
inlining and all the corresponding source line actually appears hundreds of
times in the dump, and this does not tell me which of those causes the warning.

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

end of thread, other threads:[~2022-10-10  8:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-08 12:27 [Bug tree-optimization/107184] New: Copy warnings in dump files glisse at gcc dot gnu.org
2022-10-09  4:57 ` [Bug tree-optimization/107184] " pinskia at gcc dot gnu.org
2022-10-10  7:13 ` rguenth at gcc dot gnu.org
2022-10-10  8:42 ` glisse 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).