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

            Bug ID: 119299
           Summary: Jump followed by jump not optimized.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hiraditya at msn dot com
  Target Milestone: ---

Testcase

```
void g2(T x) {
    T y = x & ~1;
    if (y == 0 || y == 4) f(x);
}
```


clang -O3
```
g2(unsigned int):
        test    edi, -6
        je      f(unsigned int)@PLT
        ret
```

gcc -O3
```
g2(unsigned int):
        test    edi, -6
        je      .L8
        ret
.L8:
        jmp     f(unsigned int)
```

https://godbolt.org/z/3xh6Mxq4j

Reply via email to