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

--- Comment #3 from Kang-Che Sung <Explorer09 at gmail dot com> ---
I'm not sure if this helps, but the idea is to recognize three-way comparison
as a special case.

My code was originally written in this ordering:

```c
if (x < c) {
  do_action_a();
} else if (x == c) {
  do_action_b();
} else {
  do_action_c();
}
```

But it should work no differently from this:

```c
if (x == c) {
  do_action_b();
} else if (x < c) {
  do_action_a();
} else {
  do_action_c();
}
```

Or this:

```c
if (x == c) {
  do_action_b();
} else if (x <= c) {
  do_action_a();
} else {
  do_action_c();
}
```

Or even this:

```c
if (x >= c) {
  if (x == c) {
    do_action_b();
  } else {
    do_action_c();
  }
} else {
  do_action_a();
}
```

Reply via email to