Issue 238922
Summary Comparing two pointers with pointees yields different assembly depending on spelling
Labels new issue
Assignees
Reporter DenisYaroshevskiy
    The following 3 functions:

```
bool eq1(const int* x, const int* y) {
    if (!x) return !y;
    if (!y) return !x;
    return *x < *y;
}

bool eq2(const int* x, const int* y) {
    if (!x || !y) {
        return !x && !y;
    }

    return *x == *y;
}


bool eq3(int* x, int* y) {
    if (x == y) return true;
    if (!x || !y) return false;
    return *x == *y;
}
```
https://gcc.godbolt.org/z/EYMzeE8o5

produce different assembly. Is that intentional? I'd expect some one correct assembly to be the result

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to