[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
gcc-bugzilla@gcc.gnu.org
Sat Sep 16 01:23:27 GMT 2023
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.
More information about the Gcc-bugs
mailing list