public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/111430] New: IPA read only variable analysis should handle the case where the storing was the same as the initialization
@ 2023-09-16  1:23 pinskia at gcc dot gnu.org
  2023-09-16  1:23 ` [Bug ipa/111430] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-16  1:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111430
           Summary: IPA read only variable analysis should handle the case
                    where the storing was the same as the initialization
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Take:
```
#define CST 1025
static int b = CST;

void f(int a)
{
        if (a)
          b = CST;
}

int g(void)
{
        return b;
}
```

We should be able to optimize out the store to b in f and even the load in g.

This is another way of solving the original testcase in PR 110992.

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

end of thread, other threads:[~2023-09-18  8:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-16  1:23 [Bug ipa/111430] New: IPA read only variable analysis should handle the case where the storing was the same as the initialization pinskia at gcc dot gnu.org
2023-09-16  1:23 ` [Bug ipa/111430] " pinskia at gcc dot gnu.org
2023-09-16  1:23 ` pinskia at gcc dot gnu.org
2023-09-18  8:59 ` 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).