This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/66984] ICE: fold_binary changes type of operand, causing failure in verify_gimple_assign_binary
- From: "jay.krell at cornell dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 24 Jul 2015 09:45:23 +0000
- Subject: [Bug middle-end/66984] ICE: fold_binary changes type of operand, causing failure in verify_gimple_assign_binary
- Auto-submitted: auto-generated
- References: <bug-66984-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66984
--- Comment #2 from Jay <jay.krell at cornell dot edu> ---
1 please be sure that dividing the most negative number by -1 "works".
Perhaps just don't optimize anything with negstive numbers.
2 I suggest that gcc's C/C++ frontends expose these other forms of division,
for the sake of testability.
Thank you,
- Jay
On Jul 24, 2015, at 2:09 AM, "rguenth at gcc dot gnu.org"
<gcc-bugzilla@gcc.gnu.org> wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66984
>
> Richard Biener <rguenth at gcc dot gnu.org> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> Status|UNCONFIRMED |NEW
> Last reconfirmed| |2015-07-24
> Ever confirmed|0 |1
>
> --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
> The usual fix in fold-const.c is to make sure to convert operands to the
> required type when building the final expression. Thus instead of
>
> 10828 return fold_build2_loc (loc, EXACT_DIV_EXPR, type, arg0, arg1);
>
> do
>
> return fold_build2_loc (loc, EXACT_DIV_EXPR, type,
> fold_convert (type, arg0), fold_convert (type,
> arg1));
>
> you can see this pattern in many places.
>
> Care to post a patch? It's pre-approved.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.