[Bug tree-optimization/120342] wrong code at -O{s,2,3} with "-fno-tree-ccp -fno-tree-forwprop" on x86_64-linux-gnu

2025-05-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120342

--- Comment #2 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #1)
> This is an aliasing violation.
> 
> You write to p via int and then again via the struct and then read it back
> via int.

I should say write partially via the struct.
It does not matter that the field of the struct is char or not, you are still
writing via the struct type.

[Bug tree-optimization/120342] wrong code at -O{s,2,3} with "-fno-tree-ccp -fno-tree-forwprop" on x86_64-linux-gnu

2025-05-18 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120342

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Andrew Pinski  ---
This is an aliasing violation.

You write to p via int and then again via the struct and then read it back via
int.