https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118115
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Last reconfirmed| |2024-12-19 Summary|Missed Optimization: |Missed Optimization: |Failure to Elide Branch |Failure to Elide Branch |When Copying Overlapping |When Copying Overlapping |Union Members |Union Members from | |arguments to returns Blocks| |101926 Depends on| |61810 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So GCC is in this case is doing: `b = is_ab ? b : 0` Which is coming from init-regs which means it might only be an issue from argument and return case. Do you have a better benchmark instead of this micro-benchmark where the conditional move will show up? This is just a bad artifact of how GCC handles arguments/returns and even uninitialized registers usage (PR 61810). Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61810 [Bug 61810] init-regs.c papers over issues elsewhere https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101926 [Bug 101926] [meta-bug] struct/complex/other argument passing and return should be improved