public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/99919] New: [9/10/11 Regression] bogus -Wmaybe-uninitialized with a _Bool bit-field
@ 2021-04-05 20:29 msebor at gcc dot gnu.org
  2021-04-05 20:51 ` [Bug tree-optimization/99919] " msebor at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-04-05 20:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99919
           Summary: [9/10/11 Regression] bogus -Wmaybe-uninitialized with
                    a _Bool bit-field
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

This is the -Wmaybe-uninitialized subset of pr99918 showing how the failure to
fail _Bool bit-field expressions can cause bogus warnings.  (Like pr99918, this
was most likely caused by r225825.)

$ cat z.c && gcc -O2 -S -Wall z.c
struct B { _Bool i: 1; _Bool j: 1; };

_Bool z;

void g (struct B b)
{
  _Bool x;

  if (b.i)
    b.j = 0;
  else
    {
      b.j = b.i;
      x = b.i;
    }

  if (b.j)
    z = x;
}

z.c: In function ‘g’:
z.c:18:7: warning: ‘x’ may be used uninitialized in this function
[-Wmaybe-uninitialized]
   18 |     z = x;
      |     ~~^~~
z.c:7:9: note: ‘x’ was declared here
    7 |   _Bool x;
      |         ^

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

end of thread, other threads:[~2024-05-21  9:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 20:29 [Bug tree-optimization/99919] New: [9/10/11 Regression] bogus -Wmaybe-uninitialized with a _Bool bit-field msebor at gcc dot gnu.org
2021-04-05 20:51 ` [Bug tree-optimization/99919] " msebor at gcc dot gnu.org
2021-04-06  8:39 ` rguenth at gcc dot gnu.org
2021-04-08 14:22 ` rguenth at gcc dot gnu.org
2021-06-01  8:20 ` [Bug tree-optimization/99919] [9/10/11/12 " rguenth at gcc dot gnu.org
2021-11-30 11:58 ` aldyh at gcc dot gnu.org
2021-11-30 12:06 ` pinskia at gcc dot gnu.org
2021-11-30 14:22 ` aldyh at gcc dot gnu.org
2022-12-08  9:25 ` [Bug tree-optimization/99919] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-12-08 10:47 ` rguenth at gcc dot gnu.org
2023-04-26  6:55 ` [Bug tree-optimization/99919] [10/11/12/13/14 " rguenth at gcc dot gnu.org
2023-07-27  9:22 ` [Bug tree-optimization/99919] [11/12/13/14 " rguenth at gcc dot gnu.org
2023-12-15 13:33 ` rguenth at gcc dot gnu.org
2024-05-21  9:10 ` [Bug tree-optimization/99919] [11/12/13/14/15 " jakub 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).