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/55616] bogus warning about undefined overflow after overflow check


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

--- Comment #7 from Florian Weimer <fweimer at redhat dot com> 2013-01-31 11:05:48 UTC ---
(In reply to comment #6)
> Just write
> number_of_elements_in_path+100U
> or use unsigned type for
> number_of_elements_in_path

Thanks, this is helpful.  It seems you need both (number_of_elements_in_path
already is of type quint16), otherwise the expression is promoted to int.  I
think it might be a permanent fix (not dependent on current optimizer behavior)
because of the GCC extension ensuring that unsigned -> int conversion is always
defined.  Interesting.


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