This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/55616] bogus warning about undefined overflow after overflow check
- From: "fweimer at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 31 Jan 2013 11:05:48 +0000
- Subject: [Bug tree-optimization/55616] bogus warning about undefined overflow after overflow check
- Auto-submitted: auto-generated
- References: <bug-55616-4@http.gcc.gnu.org/bugzilla/>
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.