[Bug middle-end/83858] New: [8 Regression] error: invalid cast from type 'poly_uint16' to type 'long long int'

danglin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 15 14:59:00 GMT 2018


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

            Bug ID: 83858
           Summary: [8 Regression] error: invalid cast from type
                    'poly_uint16' to type 'long long int'
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: danglin at gcc dot gnu.org
  Target Milestone: ---
              Host: hppa2.0w-hp-hpux11.11
            Target: hppa2.0w-hp-hpux11.11
             Build: hppa2.0w-hp-hpux11.11

Created attachment 43137
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43137&action=edit
Preprocessed source

In stage1, the following error occurs:

g++ -std=gnu++98 -fno-PIE -c   -g -DIN_GCC     -fno-exceptions -fno-rtti
-fasync
hronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual
-Wno-f
ormat -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long
-
Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I.
-I.
 -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include
-I../../gcc/gcc/..
/libcpp/include -I/opt/gnu/gcc/gmp/include  -I../../gcc/gcc/../libdecnumber
-I..
/../gcc/gcc/../libdecnumber/dpd -I../libdecnumber
-I../../gcc/gcc/../libbacktrac
e   -o varasm.o -MT varasm.o -MMD -MP -MF ./.deps/varasm.TPo
../../gcc/gcc/varas
m.c
In file included from ./tm.h:19:0,
                 from ../../gcc/gcc/backend.h:28,
                 from ../../gcc/gcc/varasm.c:31:
../../gcc/gcc/varasm.c: In function 'void assemble_start_function(tree, const
char*)':
../../gcc/gcc/config/pa/pa.h:601:43: error: invalid cast from type 'poly_uint16
{aka poly_int<1u, short unsigned int>}' to type 'long long int'
      ? (HOST_WIDE_INT) GET_MODE_SIZE (MODE) \
                                           ^
../../gcc/gcc/config/pa/som.h:139:10: note: in expansion of macro
'FUNCTION_ARG_SIZE'
          FUNCTION_ARG_SIZE (TYPE_MODE (DECL_ARG_TYPE (parm)),\
          ^~~~~~~~~~~~~~~~~
../../gcc/gcc/varasm.c:1880:3: note: in expansion of macro
'ASM_DECLARE_FUNCTION_NAME'
   ASM_DECLARE_FUNCTION_NAME (asm_out_file, fnname, current_function_decl);
   ^~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:1110: recipe for target 'varasm.o' failed
make[3]: *** [varasm.o] Error 1

Even if I eliminate the cast from

#define FUNCTION_ARG_SIZE(MODE, TYPE)   \
  ((((MODE) != BLKmode \
     ? (HOST_WIDE_INT) GET_MODE_SIZE (MODE) \
     : int_size_in_bytes (TYPE)) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)

There is no 'operator/' for the poly_int.

Problem doesn't affect 64-bit hpux and linux.


More information about the Gcc-bugs mailing list