public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/102440] New: Uinteger Opt/Param but the underlying type is signed
@ 2021-09-22  3:11 linkw at gcc dot gnu.org
  2021-09-22  3:13 ` [Bug middle-end/102440] " linkw at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: linkw at gcc dot gnu.org @ 2021-09-22  3:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102440
           Summary: Uinteger Opt/Param but the underlying type is signed
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: linkw at gcc dot gnu.org
  Target Milestone: ---

The UInteger type in Opt/Param declaration can easily confuse people that the
variable for this option/parameter is unsigned.  But actually the internal
implementation uses signed for it, it requires users to add explicit type
conversion for some cases, otherwise the bootstrapping fails due to -Werror.
I guess the "UInteger" is mainly to restrict the value range of
option/parameter.  But I think we still can improve it? Like using one
anonymous union with uinteger and integer instead of a single integer, then
name the corresponding member as signedness?

File this as Segher's suggestion from patch reviewing.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-10-26 16:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22  3:11 [Bug tree-optimization/102440] New: Uinteger Opt/Param but the underlying type is signed linkw at gcc dot gnu.org
2021-09-22  3:13 ` [Bug middle-end/102440] " linkw at gcc dot gnu.org
2021-09-22  5:47 ` [Bug other/102440] " pinskia at gcc dot gnu.org
2021-09-23  6:23 ` linkw at gcc dot gnu.org
2021-09-27 13:29 ` marxin at gcc dot gnu.org
2021-10-25 15:00 ` marxin at gcc dot gnu.org
2021-10-25 20:53 ` segher at gcc dot gnu.org
2021-10-25 21:14 ` segher at gcc dot gnu.org
2021-10-26 15:17 ` marxin at gcc dot gnu.org
2021-10-26 16:45 ` segher at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).