<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/77290>77290</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[ConstraintElim] GCC-C-execute-950704-1.test failed
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
fhahn,
topperc
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jerryzj
</td>
</tr>
</table>
<pre>
The `ConstraintEliminationPass` seems to be buggy in handling `long long`
Reduced test case
```
#include <stdlib.h>
int a;
int b(long long c, long long d) {
long long e = c + d;
if (c >= 0)
return e;
else if (d > 0 || e < 0)
return e;
a = 1;
return 0;
}
int main() {
b(0x8000000000000000LL, 0x8000000000000000LL);
if (!a)
abort();
}
```
The test case passed under `O1` but failed since `O2`. Using `opt-bisect`, I located that the test started failing after running `ConstraintEliminationPass` with a bisect limit set to 40.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVN1uozoQfprhZhTkGMLPBRctaY6OVKlHR7sPYOwJuHJMZJttu0-_MtAkbVe7CBnN7zc_nxHe694SNbC7B86PgxgscA68Bc7DeD6Tk1He7RMxhWF0zTM59_bzOelG9dZ8GwihYO1ofXBC2_Bg9ElbEfRo_xPeQ8HQE508hhE7wm7q-zfUFgdhldG2j9FmtD3GAwoGbA_sbjn_JzVJUhjIB5TC060x-i7vIvJMW2kmRQhZ64MyuksHyB4Ws7YBBWT3V6kDXl2AUQJv8Soq4DVCubrjjSWm36NE4PeoLgkR9RGBVxIjYrZHBrx-NyE6CpOzSDf-ZDytQSoGIUMoWyjbGaH9ewIxF7K90axO7KKCcn_t9yS0BV59aixOgb1W7OPz-BjH8Xt9_aVp4FvxoVrRjS4sWF9r-by3-Yw0umwZz8J7UjhZRS7y42kbadRNAY9CG1LotZUz7544FCzF735l0ngOm057kiEC8Bb_RTNKESKJBhEwvOP4IFzUxoQxVhwDOXSTtWumPzL6RYcBBS5IGO0BPYXI8ZyliWoyVWe1SKjZliwvWbEr6mRoJCPR7VipqmNRsqqsqkp1Mq_YLq-LmteJbjjjOduyitVZweqUVYzTMcvkUeS5rEvIGZ2ENqkxP07p6PpEez9RU5a8ZokRHRm_3mRLLzgb19vrmhiz6abeQ86M9sFfswQdzPwL-Ng27Pb4T9tu2g29kpwCbeodK1m-2abzFJd1JJMzzRDC2UN2B_wA_NDrMExdKscT8ENEWT-bsxuf43b4Ya7NAz_Mtf8KAAD__0_PT04">