https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106822
--- Comment #5 from Benjamin B. Meier ---
Thx for the very quick reaction and also you additional example:)!
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106822
--- Comment #3 from Benjamin B. Meier ---
> The reason for the difference is because in the case where there is an int in
> the structure, the alignment is 4 bytes so a 2 or 4 byte read for a and b
> will not cause an fault while in the first
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106822
--- Comment #1 from Benjamin B. Meier ---
It might also be worth to note that the following code always compiles without
any jumps:
bool f2(const MyStruct *s)
{
return s->a | s ->b;
}
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106822
Bug ID: 106822
Summary: "Boolean-or" optimization opportunity not consistently
used
Product: gcc
Version: 12.2.1
Status: UNCONFIRMED
Severity: normal
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97307
--- Comment #6 from Benjamin B. Meier ---
Thanks for the super quick reaction:)!
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97307
Bug ID: 97307
Summary: Optimization for pure vs. const function
Product: gcc
Version: 10.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c