https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124405

            Bug ID: 124405
           Summary: cselim sometimes does not handle conditional store
                    elimination
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
            Blocks: 124006
  Target Milestone: ---

Take:
```
void f(int *a, int b)
{
  *a &= ~3;
  if (b)
    *a |= 1;
}
```

cselim does not handle this case.
If we change `*a &= ~3;` to `*a = ~3;` then cselim handles it.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124006
[Bug 124006] Improve another conditional sequence for RISC-V

Reply via email to