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

--- Comment #35 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 55055
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55055&action=edit
gcc14-set-precision.patch

Untested preparation patch which prepares fo the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102989#c25
idea of keeping 16-bit precision for all types but the new bit-precise integer
types and 32-bit precision.  Unfortunately it isn't just starting to use
SET_TYPE_PRECISION when it is used as an lvalue, but unfortunately the current
TYPE_PRECISION definition which is a unsigned:16 non-static data member for
-Wsign-compare acts as either signed or unsigned int and no warning is emitted,
while even if the new larger precision in some types was unsigned:31, using
those two options in a conditional leads to -Wsign-compare warnings because all
of sudden the macro is considered to be either int or unsigned depending on how
exactly it is defined.  There are more -Wsign-compare warnings if
TYPE_PRECISION is signed int than when it is unsigned int, so I want to
implement the latter and this patch also adjusts all spots I've noticed to
avoid the -Wsign-compare warnings.  Precision is never negative...

Reply via email to