[Bug tree-optimization/109543] Avoid using BLKmode for unions with a non-BLKmode member when possible

2023-12-14 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109543 --- Comment #7 from Richard Biener --- Yeah, guess we still have target code doing ABI decisions based on mode ...

[Bug tree-optimization/109543] Avoid using BLKmode for unions with a non-BLKmode member when possible

2023-12-14 Thread richard.sandiford at arm dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109543 --- Comment #6 from richard.sandiford at arm dot com --- Here's a proof of concept patch that fixes the testcase for -mstrict-align. The VECTOR_MODE_P part would need to be behind a new target hook, to avoid accidentally breaking someone's ABI.

[Bug tree-optimization/109543] Avoid using BLKmode for unions with a non-BLKmode member when possible

2023-12-14 Thread rsandifo at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109543 --- Comment #5 from Richard Sandiford --- I think the loop in compute_mode_layout needs to be smarter for unions. At the moment it's sensitive to field order, which doesn't make much conceptual sense. E.g. for the admittedly contrived

[Bug tree-optimization/109543] Avoid using BLKmode for unions with a non-BLKmode member when possible

2023-07-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109543 --- Comment #4 from Richard Biener --- I think for SRA the issue is that there's no access to any of the unions components and as Martin says it disqualifies total scalarization. I think total scalarization would be possible if we can use the

[Bug tree-optimization/109543] Avoid using BLKmode for unions with a non-BLKmode member when possible

2023-04-24 Thread avieira at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109543 --- Comment #3 from avieira at gcc dot gnu.org --- Err that should be 'double d[4];' so: typedef struct { float __attribute__ ((vector_size(16))) v[2]; } STRUCT; #ifdef GOOD typedef STRUCT TYPE; #else typedef union { STRUCT s;

[Bug tree-optimization/109543] Avoid using BLKmode for unions with a non-BLKmode member when possible

2023-04-24 Thread avieira at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109543 --- Comment #2 from avieira at gcc dot gnu.org --- Sorry for the delay. Here's the typedefs with GNU vectors. typedef struct { float __attribute__ ((vector_size(16))) v[2]; } STRUCT; #ifdef GOOD typedef STRUCT TYPE; #else typedef union

[Bug tree-optimization/109543] Avoid using BLKmode for unions with a non-BLKmode member when possible

2023-04-18 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109543 Richard Biener changed: What|Removed |Added Keywords||missed-optimization