public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/101674] New: gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite
@ 2021-07-29 10:30 aldyh at gcc dot gnu.org
  2021-07-29 15:38 ` [Bug middle-end/101674] " msebor at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: aldyh at gcc dot gnu.org @ 2021-07-29 10:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101674
           Summary: gcc.dg/uninit-pred-9_b.c fails after jump threading
                    rewrite
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: aldyh at gcc dot gnu.org
  Target Milestone: ---

The ranger-based jump threader (commit
2e96b5f14e4025691b57d2301d71aa6092ed44bc) shuffles things around in such a way
as to confuse the -Wuninitialized pass.

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

* [Bug middle-end/101674] gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite
  2021-07-29 10:30 [Bug middle-end/101674] New: gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite aldyh at gcc dot gnu.org
@ 2021-07-29 15:38 ` msebor at gcc dot gnu.org
  2021-07-29 15:50 ` aldyh at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-07-29 15:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Target|ppc64*-*-*                  |powerpc64*-*-*
   Last reconfirmed|                            |2021-07-29
                 CC|                            |msebor at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
I can confirm the test fails (despite the xfail):

FAIL: gcc.dg/uninit-pred-9_b.c bogus warning (test for bogus messages, line 25)

The xfail target should probably be powerpc64*-*-*.  Since the failure is on
line 25 would it make sense to xfail just that assertion?

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

* [Bug middle-end/101674] gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite
  2021-07-29 10:30 [Bug middle-end/101674] New: gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite aldyh at gcc dot gnu.org
  2021-07-29 15:38 ` [Bug middle-end/101674] " msebor at gcc dot gnu.org
@ 2021-07-29 15:50 ` aldyh at gcc dot gnu.org
  2021-07-29 16:14 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: aldyh at gcc dot gnu.org @ 2021-07-29 15:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #1)
> I can confirm the test fails (despite the xfail):
> 
> FAIL: gcc.dg/uninit-pred-9_b.c bogus warning (test for bogus messages, line
> 25)
> 
> The xfail target should probably be powerpc64*-*-*.  Since the failure is on
> line 25 would it make sense to xfail just that assertion?

Ahhh. Yes, that seems appropriate.  Feel free to commit it as obvious.  Thanks
for taking care of this.

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

* [Bug middle-end/101674] gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite
  2021-07-29 10:30 [Bug middle-end/101674] New: gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite aldyh at gcc dot gnu.org
  2021-07-29 15:38 ` [Bug middle-end/101674] " msebor at gcc dot gnu.org
  2021-07-29 15:50 ` aldyh at gcc dot gnu.org
@ 2021-07-29 16:14 ` cvs-commit at gcc dot gnu.org
  2021-07-31  0:32 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-29 16:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Sebor <msebor@gcc.gnu.org>:

https://gcc.gnu.org/g:2f6bdd51cfe15403085b69c133065ebda4af9bb9

commit r12-2600-g2f6bdd51cfe15403085b69c133065ebda4af9bb9
Author: Martin Sebor <msebor@redhat.com>
Date:   Thu Jul 29 10:11:18 2021 -0600

    Xfail just the failing assertion and correct target.

    Related to:
    PR middle-end/101674 - gcc.dg/uninit-pred-9_b.c fails after jump threading
rewrite

    gcc/testsuite:
            PR middle-end/101674
            * gcc.dg/uninit-pred-9_b.c: Xfail just the failing assertion and
            correct target.

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

* [Bug middle-end/101674] gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite
  2021-07-29 10:30 [Bug middle-end/101674] New: gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite aldyh at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-07-29 16:14 ` cvs-commit at gcc dot gnu.org
@ 2021-07-31  0:32 ` cvs-commit at gcc dot gnu.org
  2021-08-11  0:37 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-31  0:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Hans-Peter Nilsson <hp@gcc.gnu.org>:

https://gcc.gnu.org/g:309ddde04f2335f51062690328f03ce889be7e22

commit r12-2647-g309ddde04f2335f51062690328f03ce889be7e22
Author: Hans-Peter Nilsson <hp@bitrange.com>
Date:   Sat Jul 31 01:23:20 2021 +0200

    gcc.dg/uninit-pred-9_b.c: Xfail for MMIX too

    Looks like MMIX is the "correct target" too (cf. 2f6bdd51cfe15)
    and from
    https://gcc.gnu.org/pipermail/gcc-testresults/2021-July/710188.html
    it seems powerpc-ibm-aix7.2.3.0 is too, but I've not found
    other targets failing.

    gcc/testsuite:
            PR middle-end/101674
            * gcc.dg/uninit-pred-9_b.c: Xfail for mmix-*-* too.

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

* [Bug middle-end/101674] gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite
  2021-07-29 10:30 [Bug middle-end/101674] New: gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite aldyh at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-07-31  0:32 ` cvs-commit at gcc dot gnu.org
@ 2021-08-11  0:37 ` cvs-commit at gcc dot gnu.org
  2021-11-10 18:17 ` sandra at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-11  0:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Hans-Peter Nilsson <hp@gcc.gnu.org>:

https://gcc.gnu.org/g:92f7016940e5a7281e3fd7628fbf1360d900b581

commit r12-2843-g92f7016940e5a7281e3fd7628fbf1360d900b581
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Wed Aug 11 01:40:12 2021 +0200

    gcc.dg/uninit-pred-9_b.c: Xfail for CRIS too

    Adding to the growing list, for autotester accounting purposes.

    FWIW I see this fails for m68k too:
    https://gcc.gnu.org/pipermail/gcc-testresults/2021-August/712395.html
    and moxie:
    https://gcc.gnu.org/pipermail/gcc-testresults/2021-August/712389.html
    and pru:
    https://gcc.gnu.org/pipermail/gcc-testresults/2021-August/712366.html

    testsuite:
            PR middle-end/101674
            * gcc.dg/uninit-pred-9_b.c: Xfail for cris-*-* too.

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

* [Bug middle-end/101674] gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite
  2021-07-29 10:30 [Bug middle-end/101674] New: gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite aldyh at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-08-11  0:37 ` cvs-commit at gcc dot gnu.org
@ 2021-11-10 18:17 ` sandra at gcc dot gnu.org
  2022-05-24  1:30 ` vineet.gupta at linux dot dev
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: sandra at gcc dot gnu.org @ 2021-11-10 18:17 UTC (permalink / raw)
  To: gcc-bugs

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

sandra at gcc dot gnu.org changed:

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

--- Comment #6 from sandra at gcc dot gnu.org ---
Also fails for nios2 (line 20, same as powerpc64).  Are we really just xfailing
this everywhere instead of fixing the bug and/or testcase?  That kind of seems
like sweeping the whole mess under the rug, to me.  :-S

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

* [Bug middle-end/101674] gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite
  2021-07-29 10:30 [Bug middle-end/101674] New: gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite aldyh at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-11-10 18:17 ` sandra at gcc dot gnu.org
@ 2022-05-24  1:30 ` vineet.gupta at linux dot dev
  2022-08-08 12:30 ` rguenth at gcc dot gnu.org
  2022-09-01 12:56 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: vineet.gupta at linux dot dev @ 2022-05-24  1:30 UTC (permalink / raw)
  To: gcc-bugs

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

Vineet Gupta <vineet.gupta at linux dot dev> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kito at gcc dot gnu.org,
                   |                            |palmer at gcc dot gnu.org,
                   |                            |vineet.gupta at linux dot dev

--- Comment #7 from Vineet Gupta <vineet.gupta at linux dot dev> ---
Failing for riscv as well !

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

* [Bug middle-end/101674] gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite
  2021-07-29 10:30 [Bug middle-end/101674] New: gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite aldyh at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2022-05-24  1:30 ` vineet.gupta at linux dot dev
@ 2022-08-08 12:30 ` rguenth at gcc dot gnu.org
  2022-09-01 12:56 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-08-08 12:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Bumping MAX_CHAIN_LEN to 7 removes warnings of it being exceeded during
analysis but the diagnostic still happens.

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

* [Bug middle-end/101674] gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite
  2021-07-29 10:30 [Bug middle-end/101674] New: gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite aldyh at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2022-08-08 12:30 ` rguenth at gcc dot gnu.org
@ 2022-09-01 12:56 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-09-01 12:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
For the remaining superset_of path we now have

        ((m_16(D) != 0) AND (r_18(D) <= 19) AND (m_16(D) != 100) AND (n_15(D)
<= 9))
        OR ((l_22(D) > 100) AND (NOT (m_16(D) != 0)) AND (r_18(D) <= 19) AND
(m_16(D) != 100) AND (n_15(D) <= 9))

guarding the well-definedness of

        v_59 = PHI <v_58(25), r_18(D)(21)>

and

       ((r_18(D) <= 18))

guarding the use.  The use predicate fails to prove either of the definition
guards which possibly is because the use predicate does not cover the path
from the upthread PHIs to the PHI in question:

<bb 13> [local count: 716722667]:
# v_58 = PHI <v_57(11), v_17(D)(12)>    // related PHI
if (l_22(D) > 100)
  goto <bb 14>; [50.00%]
else
  goto <bb 24>; [50.00%]

<bb 14> [local count: 358361334]:
_6 = m_16(D) <= 99;
_7 = _1 & _6;
if (_7 != 0)
  goto <bb 25>; [37.31%]
else
  goto <bb 26>; [62.69%]

<bb 15> [local count: 183623112]:
# v_59 = PHI <v_58(25), r_18(D)(21)>   // main PHI
if (r_18(D) <= 18)
  goto <bb 16>; [52.89%]
else
  goto <bb 27>; [47.11%]

<bb 16> [local count: 88583700]:
blah (v_59);

here the related PHI def v_58 is marked as possibly undefined so we use
the predicates from its incoming edges (and one more related PHI in BB11).
But the use predicate of v_58 in the v_59 PHI def isn't taken into
account.  That one would be

        ((m_16(D) <= 99) AND (n_15(D) <= 9) AND (l_22(D) > 100))

but that still looks insufficent when combined with (r_18(D) <= 18) to prove

((m_16(D) != 0) AND (r_18(D) <= 19) AND (m_16(D) != 100) AND (n_15(D) <= 9))

in particular the m_16(D) != 0 predicate.  I'm also seeing a missed
simplifcation of NOT (m_16(D) != 0) but that will not help either.

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

end of thread, other threads:[~2022-09-01 12:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 10:30 [Bug middle-end/101674] New: gcc.dg/uninit-pred-9_b.c fails after jump threading rewrite aldyh at gcc dot gnu.org
2021-07-29 15:38 ` [Bug middle-end/101674] " msebor at gcc dot gnu.org
2021-07-29 15:50 ` aldyh at gcc dot gnu.org
2021-07-29 16:14 ` cvs-commit at gcc dot gnu.org
2021-07-31  0:32 ` cvs-commit at gcc dot gnu.org
2021-08-11  0:37 ` cvs-commit at gcc dot gnu.org
2021-11-10 18:17 ` sandra at gcc dot gnu.org
2022-05-24  1:30 ` vineet.gupta at linux dot dev
2022-08-08 12:30 ` rguenth at gcc dot gnu.org
2022-09-01 12:56 ` 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).