[Bug middle-end/111711] [14 Regression] ICE: in maybe_legitimize_operand, at optabs.cc:8046 at -O1 with division by zero

2023-10-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111711

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #3 from Andrew Pinski  ---
So I looked further into this and it was actually a dup when I said it was not.

Anyways just marking it as a dup of bug 111260 in the end.

*** This bug has been marked as a duplicate of bug 111260 ***

[Bug middle-end/111711] [14 Regression] ICE: in maybe_legitimize_operand, at optabs.cc:8046 at -O1 with division by zero

2023-10-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111711

--- Comment #2 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #1)
> It was introduced by r14-2667-gceae1400cf24f329393e96dd9720 .
> 
> We have:
>   long int x;
>   int _3;
>   _Bool _5;
>   _3 = 0 / 0;
>   _5 = _3 == 822920;
>   x_7 = _5 ? 822920 : 0;
> 
> If I disable the added checks on dealing with rtx_equal_p, the ICE goes away.

I mean if I disable the added code trying to reuse the constants, the ICE goes
away.

> The problem is the mode for the result does not match the mode for the
> comparison (DImode for the result of the conditional and SImode for the
> comparison).

[Bug middle-end/111711] [14 Regression] ICE: in maybe_legitimize_operand, at optabs.cc:8046 at -O1 with division by zero

2023-10-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111711

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Keywords|needs-bisection |
   Last reconfirmed||2023-10-06
 Status|UNCONFIRMED |NEW

--- Comment #1 from Andrew Pinski  ---
It was introduced by r14-2667-gceae1400cf24f329393e96dd9720 .

We have:
  long int x;
  int _3;
  _Bool _5;
  _3 = 0 / 0;
  _5 = _3 == 822920;
  x_7 = _5 ? 822920 : 0;

If I disable the added checks on dealing with rtx_equal_p, the ICE goes away.
The problem is the mode for the result does not match the mode for the
comparison (DImode for the result of the conditional and SImode for the
comparison).