This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/66984] ICE: fold_binary changes type of operand, causing failure in verify_gimple_assign_binary


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

--- Comment #3 from Gary Funck <gary at intrepid dot com> ---
(In reply to Richard Biener from comment #1)
> 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.

OK, I'll post a patch.  Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]