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 tree-optimization/60930] [4.8/4.9/4.10 Regression] Wrong folding of - ((unsigned long long) a * (unsigned long long) (unsigned int)-1)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60930

--- Comment #6 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
Perhaps I confused matters a little with the commentary.  What's happening with
the bug is that the multiplication succeeds in the double-int but the product
is then truncated to the size of the stride type on the double_int_to_tree
call.  If the sign changes during the truncation, then we have an effective
overflow when the target is that particular type.  This seemed like a simple
way to detect the problem with minimal changes to the code.  But I'm happy to
use whatever methods are preferred.


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