[Bug tree-optimization/110613] optimization about combined store of adjacent bitfields

2023-07-11 Thread lh_mouse at 126 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110613

--- Comment #3 from LIU Hao  ---
There are some more cases about loading adjacent bitfields; not sure whether I
should create new PRs or paste them here. They seem highly related to the
aliasing characteristics of `unsigned char`; if I inject
`__atomic_signal_fence(__ATOMIC_RELAXED);` between the loads and the stores,
the issue is gone.

[Bug tree-optimization/110613] optimization about combined store of adjacent bitfields

2023-07-11 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110613

--- Comment #2 from Richard Biener  ---
bitfield lowering / store merging might be the enabling passes

[Bug tree-optimization/110613] optimization about combined store of adjacent bitfields

2023-07-10 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110613

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Keywords||missed-optimization
   Last reconfirmed||2023-07-10

--- Comment #1 from Andrew Pinski  ---
Confirmed.
Note neither independently is optimized at the tree level; only at the RTL
level.

Note moving the load from bptr[1] to right before the first usage fixes it at
the RTL level too (most likely due to aliasing of character types being special
in C/C++).