public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e
@ 2022-08-03  9:14 marxin at gcc dot gnu.org
  2022-08-03  9:14 ` [Bug tree-optimization/106511] " marxin at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-08-03  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106511
           Summary: [13 Regression] New -Werror=maybe-uninitialized since
                    r13-1268-g8c99e307b20c502e
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: aldyh at gcc dot gnu.org
  Target Milestone: ---

Created attachment 53404
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53404&action=edit
test-case

Knowing the warning has a significant false-positive rate, but still, it may be
an interesting test-case. It's reduced from xen package:

$ gcc bunzip.i -Werror=maybe-uninitialized -O1
bunzip2.c: In function ‘get_next_block’:
bunzip2.c:261:27: error: ‘length’ may be used uninitialized
[-Werror=maybe-uninitialized]
bunzip2.c:224:17: note: ‘length’ declared here
cc1: some warnings being treated as errors

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

* [Bug tree-optimization/106511] [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e
  2022-08-03  9:14 [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e marxin at gcc dot gnu.org
@ 2022-08-03  9:14 ` marxin at gcc dot gnu.org
  2022-08-04  9:17 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-08-03  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

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

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

* [Bug tree-optimization/106511] [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e
  2022-08-03  9:14 [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e marxin at gcc dot gnu.org
  2022-08-03  9:14 ` [Bug tree-optimization/106511] " marxin at gcc dot gnu.org
@ 2022-08-04  9:17 ` rguenth at gcc dot gnu.org
  2022-12-20 14:39 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-04  9:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |24639
   Target Milestone|---                         |13.0
           Keywords|                            |diagnostic


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
[Bug 24639] [meta-bug] bug to track all Wuninitialized issues

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

* [Bug tree-optimization/106511] [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e
  2022-08-03  9:14 [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e marxin at gcc dot gnu.org
  2022-08-03  9:14 ` [Bug tree-optimization/106511] " marxin at gcc dot gnu.org
  2022-08-04  9:17 ` rguenth at gcc dot gnu.org
@ 2022-12-20 14:39 ` rguenth at gcc dot gnu.org
  2023-03-29 13:10 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-20 14:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |85316

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
There was a recent other PR with the very same issue.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85316
[Bug 85316] [meta-bug] VRP range propagation missed cases

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

* [Bug tree-optimization/106511] [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e
  2022-08-03  9:14 [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-12-20 14:39 ` rguenth at gcc dot gnu.org
@ 2023-03-29 13:10 ` rguenth at gcc dot gnu.org
  2023-04-08 14:42 ` law at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-29 13:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |12.2.0

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Earlier GCC were confused enough to not diagnose this, they have the same
missed-optimization.

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

* [Bug tree-optimization/106511] [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e
  2022-08-03  9:14 [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-03-29 13:10 ` rguenth at gcc dot gnu.org
@ 2023-04-08 14:42 ` law at gcc dot gnu.org
  2023-04-26  6:56 ` [Bug tree-optimization/106511] [13/14 " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: law at gcc dot gnu.org @ 2023-04-08 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
                 CC|                            |law at gcc dot gnu.org

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

* [Bug tree-optimization/106511] [13/14 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e
  2022-08-03  9:14 [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-04-08 14:42 ` law at gcc dot gnu.org
@ 2023-04-26  6:56 ` rguenth at gcc dot gnu.org
  2023-07-27  9:23 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-26  6:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.0                        |13.2

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 13.1 is being released, retargeting bugs to GCC 13.2.

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

* [Bug tree-optimization/106511] [13/14 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e
  2022-08-03  9:14 [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-04-26  6:56 ` [Bug tree-optimization/106511] [13/14 " rguenth at gcc dot gnu.org
@ 2023-07-27  9:23 ` rguenth at gcc dot gnu.org
  2023-11-06 21:38 ` amacleod at redhat dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-27  9:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|13.2                        |13.3

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 13.2 is being released, retargeting bugs to GCC 13.3.

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

* [Bug tree-optimization/106511] [13/14 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e
  2022-08-03  9:14 [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e marxin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-07-27  9:23 ` rguenth at gcc dot gnu.org
@ 2023-11-06 21:38 ` amacleod at redhat dot com
  2023-11-07 19:18 ` amacleod at redhat dot com
  2023-12-06  8:55 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: amacleod at redhat dot com @ 2023-11-06 21:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Andrew Macleod <amacleod at redhat dot com> ---
(In reply to Richard Biener from comment #2)
> VRP could use max_stmt_executions here (note it doesn't properly handle loop
> nests so the name is somewhat misleading)

Given some arbitrary statement S, how do I find the relevant loop pointer to
pass to max_stmt_executions?    I don't suppose there is a generic version
which will take care of that lookup?

This seems like something the phi analyzer could easily use to calculate the
number of times the modifier statement triggers when we have loop PHIs and some
other PHI in parallel.. if I can easily ask how many times stmt S is
executed...

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

* [Bug tree-optimization/106511] [13/14 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e
  2022-08-03  9:14 [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e marxin at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-11-06 21:38 ` amacleod at redhat dot com
@ 2023-11-07 19:18 ` amacleod at redhat dot com
  2023-12-06  8:55 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: amacleod at redhat dot com @ 2023-11-07 19:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Andrew Macleod <amacleod at redhat dot com> ---
(In reply to Richard Biener from comment #2)
> VRP could use max_stmt_executions here (note it doesn't properly handle loop
> nests so the name is somewhat misleading)

Do you have to ask for max_stmt_executions on each loop nest for the stmt to
get the real total?  and multiple them all together?  or can you only count on
loop_outer()?

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

* [Bug tree-optimization/106511] [13/14 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e
  2022-08-03  9:14 [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e marxin at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-11-07 19:18 ` amacleod at redhat dot com
@ 2023-12-06  8:55 ` rguenth at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-12-06  8:55 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Macleod from comment #8)
> (In reply to Richard Biener from comment #2)
> > VRP could use max_stmt_executions here (note it doesn't properly handle loop
> > nests so the name is somewhat misleading)
> 
> Do you have to ask for max_stmt_executions on each loop nest for the stmt to
> get the real total?  and multiple them all together?  or can you only count
> on loop_outer()?

max_stmt_executions is for the loop you pass, not including outer loop
(or containing irreducible region) iterations.

The loop you usually pass is gimple_bb (stmt)->loop_father which is the
immediately containing loop.  This will be useful only when the PHI
we want to analyze is in the very same loop, if it is in an outer loop
then things become more complicated (you then could multiply by
max_loop_iterations of the containing loop maybe - but start simple ;))

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

end of thread, other threads:[~2023-12-06  8:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03  9:14 [Bug tree-optimization/106511] New: [13 Regression] New -Werror=maybe-uninitialized since r13-1268-g8c99e307b20c502e marxin at gcc dot gnu.org
2022-08-03  9:14 ` [Bug tree-optimization/106511] " marxin at gcc dot gnu.org
2022-08-04  9:17 ` rguenth at gcc dot gnu.org
2022-12-20 14:39 ` rguenth at gcc dot gnu.org
2023-03-29 13:10 ` rguenth at gcc dot gnu.org
2023-04-08 14:42 ` law at gcc dot gnu.org
2023-04-26  6:56 ` [Bug tree-optimization/106511] [13/14 " rguenth at gcc dot gnu.org
2023-07-27  9:23 ` rguenth at gcc dot gnu.org
2023-11-06 21:38 ` amacleod at redhat dot com
2023-11-07 19:18 ` amacleod at redhat dot com
2023-12-06  8:55 ` rguenth 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).