public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/102608] New: [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures
@ 2021-10-05 14:51 law at gcc dot gnu.org
  2021-10-05 15:37 ` [Bug tree-optimization/102608] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: law at gcc dot gnu.org @ 2021-10-05 14:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102608
           Summary: [12 regression] Recent change to VN causes bogus
                    Wuninitialized warnings & kernel build failures
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: law at gcc dot gnu.org
  Target Milestone: ---

Created attachment 51555
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51555&action=edit
Testcase

This change:
55a3be2f5255d69e740d61b2c5aaba1ccbc643b8 is the first bad commit
commit 55a3be2f5255d69e740d61b2c5aaba1ccbc643b8
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Oct 4 10:57:45 2021 +0200

    tree-optimization/102570 - teach VN about internal functions

    We're now using internal functions for a lot of stuff but there's
    still missing VN support out of laziness.  The following instantiates
    support and adds testcases for FRE and PRE (hoisting).

Is causing mips64-linux-gnu and mips64el-linux-gnu kernel build failures due to
a bogus uninitialized warning with the attached file when compiled with -O2
-ftrivial-auto-var-init=zero:

../arch/mips/kernel/cmpxchg.c: In function '__xchg_small':
../arch/mips/kernel/cmpxchg.c:44:36: warning: 'old32' is used uninitialized
[-Wuninitialized]
../arch/mips/kernel/cmpxchg.c:12:6: note: 'old32' was declared here
 __cmpxchg_small
../arch/mips/kernel/cmpxchg.c: In function '__cmpxchg_small':
../arch/mips/kernel/cmpxchg.c:100:36: warning: 'mask' may be used uninitialized
[-Wmaybe-uninitialized]
../arch/mips/kernel/cmpxchg.c:53:6: note: 'mask' was declared here


I haven't tracked this down any further.

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

* [Bug tree-optimization/102608] [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures
  2021-10-05 14:51 [Bug tree-optimization/102608] New: [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures law at gcc dot gnu.org
@ 2021-10-05 15:37 ` pinskia at gcc dot gnu.org
  2021-10-05 15:38 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-05 15:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
   old32_34 = .DEFERRED_INIT (4, 2, 0);

...

-  _24 = .DEFERRED_INIT (4, 2, 0);
-  __res ={v} _24;
+  __res ={v} old32_34;


# 68 "../arch/mips/include/asm/cmpxchg.h"
This is due to __typeof(*((volatile u32 *)ptr)) __ret



The warning is kinda of correct but wrong as it uses the wrong decl :).

Fre maybe should be disabled for DEFERRED_INIT ....

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

* [Bug tree-optimization/102608] [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures
  2021-10-05 14:51 [Bug tree-optimization/102608] New: [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures law at gcc dot gnu.org
  2021-10-05 15:37 ` [Bug tree-optimization/102608] " pinskia at gcc dot gnu.org
@ 2021-10-05 15:38 ` pinskia at gcc dot gnu.org
  2021-10-06  8:39 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-05 15:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug tree-optimization/102608] [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures
  2021-10-05 14:51 [Bug tree-optimization/102608] New: [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures law at gcc dot gnu.org
  2021-10-05 15:37 ` [Bug tree-optimization/102608] " pinskia at gcc dot gnu.org
  2021-10-05 15:38 ` pinskia at gcc dot gnu.org
@ 2021-10-06  8:39 ` rguenth at gcc dot gnu.org
  2021-10-07 12:28 ` cvs-commit at gcc dot gnu.org
  2021-10-07 12:29 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-06  8:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|11.0                        |12.0
   Last reconfirmed|                            |2021-10-06
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
>    old32_34 = .DEFERRED_INIT (4, 2, 0);
> 
> ...
> 
> -  _24 = .DEFERRED_INIT (4, 2, 0);
> -  __res ={v} _24;
> +  __res ={v} old32_34;
> 
> 
> # 68 "../arch/mips/include/asm/cmpxchg.h"
> This is due to __typeof(*((volatile u32 *)ptr)) __ret
> 
> 
> 
> The warning is kinda of correct but wrong as it uses the wrong decl :).
> 
> Fre maybe should be disabled for DEFERRED_INIT ....

Hmm, I did consider that but then I thought it wouldn't matter (there were no
testsuite FAILs).

But sure, I can easily make .DEFERRED_INIT always produce a VARYING value.

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

* [Bug tree-optimization/102608] [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures
  2021-10-05 14:51 [Bug tree-optimization/102608] New: [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures law at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-10-06  8:39 ` rguenth at gcc dot gnu.org
@ 2021-10-07 12:28 ` cvs-commit at gcc dot gnu.org
  2021-10-07 12:29 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-07 12:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:1ebf2c14c60f5f37c00bea66aba46c25d4bcf473

commit r12-4225-g1ebf2c14c60f5f37c00bea66aba46c25d4bcf473
Author: Richard Biener <rguenther@suse.de>
Date:   Thu Oct 7 14:24:03 2021 +0200

    tree-optimization/102608 - avoid CSEing .DEFERRED_INIT

    This makes VN not CSE .DEFERRED_INIT which confuses uninit
    analysis which reports the wrong decl when facing copies
    of not initialized data.

    2021-10-07  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/102608
            * tree-ssa-sccvn.c (visit_stmt): Drop .DEFERRED_INIT to
            varying.

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

* [Bug tree-optimization/102608] [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures
  2021-10-05 14:51 [Bug tree-optimization/102608] New: [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures law at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-10-07 12:28 ` cvs-commit at gcc dot gnu.org
@ 2021-10-07 12:29 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-07 12:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
fixed

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

end of thread, other threads:[~2021-10-07 12:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 14:51 [Bug tree-optimization/102608] New: [12 regression] Recent change to VN causes bogus Wuninitialized warnings & kernel build failures law at gcc dot gnu.org
2021-10-05 15:37 ` [Bug tree-optimization/102608] " pinskia at gcc dot gnu.org
2021-10-05 15:38 ` pinskia at gcc dot gnu.org
2021-10-06  8:39 ` rguenth at gcc dot gnu.org
2021-10-07 12:28 ` cvs-commit at gcc dot gnu.org
2021-10-07 12:29 ` 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).