[Bug c/96139] New: Vector element extract mistypes long long int down to long int

munroesj at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jul 9 19:44:38 GMT 2020


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

            Bug ID: 96139
           Summary: Vector element extract mistypes long long int down to
                    long int
           Product: gcc
           Version: 9.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: munroesj at gcc dot gnu.org
  Target Milestone: ---

When printing vector element for example:
  printf ("%s %016llx,%016llx\n", prefix, val[1], val[0]);

where val is a vector unsigned long long int -Wall reports:

../src/printll.c: In function ‘print_v2xint64’:
../src/printll.c:20:21: warning: format ‘%llx’ expects argument of type ‘long
long unsigned int’, but argument 3 has type ‘long unsigned int’ [-Wformat=]
   printf ("%s %016llx,%016llx\n", prefix, val[1], val[0]);
                     ^

Here gcc claims that val[1] is a ‘long unsigned int’ then it is actually typed
as:

typedef __vector unsigned long long int vui64_t;

Some how the vector element extract has dropped the long long int type to long
int. This should not be an issue for PPC64 as long long int and long int are
both 64-bit but would matter for PPC32.


More information about the Gcc-bugs mailing list