public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105539] New: -ftrivial-auto-var-init=zero happening too late?
@ 2022-05-09 18:27 kees at outflux dot net
  2022-05-09 18:28 ` [Bug c/105539] " kees at outflux dot net
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: kees at outflux dot net @ 2022-05-09 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105539
           Summary: -ftrivial-auto-var-init=zero happening too late?
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kees at outflux dot net
  Target Milestone: ---

It looks like some pass is being run before the initializers are added:

int x (int z) {
    int y;
    if (z)
        y = 10;
    return y;
}

under "gcc -ftrivial-auto-var-init=zero -Wuninitialized -O2" does not test "z":

$ gcc -ftrivial-auto-var-init=zero -Wuninitialized -O2 -S x.c -o -
...
        movl    $10, %eax
        ret
...

This should be testing "z", e.g.:

        testl   %edi, %edi
        movl    $10, %eax
        cmovel  %edi, %eax
        retq

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

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

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 18:27 [Bug c/105539] New: -ftrivial-auto-var-init=zero happening too late? kees at outflux dot net
2022-05-09 18:28 ` [Bug c/105539] " kees at outflux dot net
2022-05-09 18:33 ` kees at outflux dot net
2022-05-09 20:10 ` [Bug middle-end/105539] " pinskia at gcc dot gnu.org
2022-05-10  7:44 ` rguenth at gcc dot gnu.org
2022-05-10 16:35 ` qinzhao at gcc dot gnu.org
2022-05-10 16:40 ` qinzhao at gcc dot gnu.org
2022-05-10 22:13 ` kees at outflux dot net
2022-05-11  6:42 ` rguenth at gcc dot gnu.org
2022-05-11 14:09 ` qing.zhao at oracle dot com

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).