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

            Bug ID: 125093
           Summary: `COND_ADD (x != -CST1, x, CST1, 0)` is not optimized
                    to x + CST1
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Created attachment 64322
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64322&action=edit
testcase

forwprop2 has:
```
  _5 = t_4 != { -4, -4, -4, -4 };
  _6 = .COND_ADD (_5, t_4, { 4, 4, 4, 4 }, { 0, 0, 0, 0 });
```

But this is just:
t_4 + { 4, 4, 4, 4 }
Compile the testcase on x86_64 with `-O2 -std=c++98 -march=cascadelake
-fno-early-inlining`

Reply via email to