public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/73550] Another wrong -Wmaybe-uninitialized warning in switch statement
       [not found] <bug-73550-4@http.gcc.gnu.org/bugzilla/>
@ 2021-03-31 22:46 ` msebor at gcc dot gnu.org
  2022-08-30 11:43 ` [Bug tree-optimization/73550] " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-03-31 22:46 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org
      Known to fail|                            |10.2.0, 11.0, 7.3.0, 8.3.0,
                   |                            |9.2.0
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-03-31

--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed with GCC 11.

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

* [Bug tree-optimization/73550] Another wrong -Wmaybe-uninitialized warning in switch statement
       [not found] <bug-73550-4@http.gcc.gnu.org/bugzilla/>
  2021-03-31 22:46 ` [Bug middle-end/73550] Another wrong -Wmaybe-uninitialized warning in switch statement msebor at gcc dot gnu.org
@ 2022-08-30 11:43 ` rguenth at gcc dot gnu.org
  2022-08-30 12:39 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-30 11:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
The diagnostic is gone in GCC 12+ and re-appears with adding -fno-thread-jumps
because:

MAX_NUM_CHAINS exceeded: 8

and the logic is extra stupid in building 8 chains but no more but then
when building predicates rejecting exactly the case of 8 chains ...

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

* [Bug tree-optimization/73550] Another wrong -Wmaybe-uninitialized warning in switch statement
       [not found] <bug-73550-4@http.gcc.gnu.org/bugzilla/>
  2021-03-31 22:46 ` [Bug middle-end/73550] Another wrong -Wmaybe-uninitialized warning in switch statement msebor at gcc dot gnu.org
  2022-08-30 11:43 ` [Bug tree-optimization/73550] " rguenth at gcc dot gnu.org
@ 2022-08-30 12:39 ` rguenth at gcc dot gnu.org
  2022-08-30 13:13 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-30 12:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
If you fix that then the issue is that predicate::init_from_control_deps, when
failing to process any edge will fatally fail.  In this case we have a case
label with a range which isn't handled.

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

* [Bug tree-optimization/73550] Another wrong -Wmaybe-uninitialized warning in switch statement
       [not found] <bug-73550-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2022-08-30 12:39 ` rguenth at gcc dot gnu.org
@ 2022-08-30 13:13 ` rguenth at gcc dot gnu.org
  2022-08-30 13:38 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-30 13:13 UTC (permalink / raw)
  To: gcc-bugs

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

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> ---
Note the main issue is that we don't handle the case where an edge from a
switch reaches a case with more than a single case value.  There's a
representational
issue here in the predicate analysis code - one would think that amending it
with a new "kind" implementing a falls-in-range operation and recording an
irange (but conservative precise or lose depending on who is asking, so maybe
better "exact") would be a good fix, possibly also handling range checking in
general this way.

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

* [Bug tree-optimization/73550] Another wrong -Wmaybe-uninitialized warning in switch statement
       [not found] <bug-73550-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2022-08-30 13:13 ` rguenth at gcc dot gnu.org
@ 2022-08-30 13:38 ` cvs-commit at gcc dot gnu.org
  2022-08-31  6:52 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-08-30 13:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:ce776225249d99b089d02424b9472811a6bbd7f5

commit r13-2279-gce776225249d99b089d02424b9472811a6bbd7f5
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Aug 30 14:37:23 2022 +0200

    tree-optimization/73550 - apply MAX_NUM_CHAINS consistently

    The MAX_NUM_CHAINS is applied once with <= and once with < which
    results in the chains not limited but analyis dropped completely.
    That's one issue in the PR.

            PR tree-optimization/73550
            * gimple-predicate-analysis.cc (predicate::init_from_control_deps):
            Do not apply MAX_NUM_CHAINS again.

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

* [Bug tree-optimization/73550] Another wrong -Wmaybe-uninitialized warning in switch statement
       [not found] <bug-73550-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2022-08-30 13:38 ` cvs-commit at gcc dot gnu.org
@ 2022-08-31  6:52 ` rguenth at gcc dot gnu.org
  2022-08-31 11:04 ` cvs-commit at gcc dot gnu.org
  2022-08-31 11:05 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-31  6:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Another thing we have is that with

After normalization [USE]:
        fp_5 (a.3_4, b.2_3);
  is conditional on:
        ((_27 & 20500) AND (NOT (_26 != 0)) AND (NOT (_20 > 14)))

and

After normalization [DEF]:
        fp_5 = PHI <fun1(6), fun3(24), fp_11(D)(21), fun2(3), fun3(26)>
  is conditional on:
        ((code_9(D) == 2))
        OR ((code_9(D) <= 4) AND (code_9(D) >= 3))
        OR ((code_9(D) == 1))
        OR ((code_9(D) == 12))
        OR ((code_9(D) <= 14) AND (code_9(D) >= 13))
        OR ((code_9(D) == 11))

the negated _26 != 0 predicate is not "normalized", it's defined as

  _20 = (unsigned int) code_9(D);
...
  _27 = 1 << _20;
  _26 = _27 & 480;

so ultimatively switch lowering lowers the second switch statement which
confuses us greatly here.  OTOH without switch lowering we'd fail to
process the use predicate because it's reached by multiple case
labels.

Solving this case fully is going to be interesting, but I have some more
incremental improvements here.

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

* [Bug tree-optimization/73550] Another wrong -Wmaybe-uninitialized warning in switch statement
       [not found] <bug-73550-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2022-08-31  6:52 ` rguenth at gcc dot gnu.org
@ 2022-08-31 11:04 ` cvs-commit at gcc dot gnu.org
  2022-08-31 11:05 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-08-31 11:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:0cf736575286f841f6144bd58b981c269652b82e

commit r13-2304-g0cf736575286f841f6144bd58b981c269652b82e
Author: Richard Biener <rguenther@suse.de>
Date:   Wed Aug 31 08:52:58 2022 +0200

    tree-optimization/73550 - more switch handling improvements for uninit

    The following makes predicate analysis handle case labels with
    a non-singleton contiguous range.

            PR tree-optimization/73550
            * gimple-predicate-analysis.cc (predicate::init_from_control_deps):
            Sanitize debug dumping.  Handle case labels with a CASE_HIGH.
            (predicate::dump): Adjust for better readability.

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

* [Bug tree-optimization/73550] Another wrong -Wmaybe-uninitialized warning in switch statement
       [not found] <bug-73550-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2022-08-31 11:04 ` cvs-commit at gcc dot gnu.org
@ 2022-08-31 11:05 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-31 11:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2021-03-31 00:00:00         |2022-8-31

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
comment #11 still holds.

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

end of thread, other threads:[~2022-08-31 11:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-73550-4@http.gcc.gnu.org/bugzilla/>
2021-03-31 22:46 ` [Bug middle-end/73550] Another wrong -Wmaybe-uninitialized warning in switch statement msebor at gcc dot gnu.org
2022-08-30 11:43 ` [Bug tree-optimization/73550] " rguenth at gcc dot gnu.org
2022-08-30 12:39 ` rguenth at gcc dot gnu.org
2022-08-30 13:13 ` rguenth at gcc dot gnu.org
2022-08-30 13:38 ` cvs-commit at gcc dot gnu.org
2022-08-31  6:52 ` rguenth at gcc dot gnu.org
2022-08-31 11:04 ` cvs-commit at gcc dot gnu.org
2022-08-31 11:05 ` 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).