[Bug c++/104052] Modules ICE on powerpc64le-linux with -mabi=ieeelongdouble

2022-01-18 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104052

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #6 from Jakub Jelinek  ---
Dup.

*** This bug has been marked as a duplicate of bug 98645 ***

[Bug c++/104052] Modules ICE on powerpc64le-linux with -mabi=ieeelongdouble

2022-01-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104052

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2022-01-16
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

--- Comment #5 from Andrew Pinski  ---
Seems like when register_builtin_type is called, there should be another vector
holding those types and handling those in module.cc too. That would fix this
and the vector type issues I think.

[Bug c++/104052] Modules ICE on powerpc64le-linux with -mabi=ieeelongdouble

2022-01-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104052

--- Comment #4 from Andrew Pinski  ---
There are other types it messes up with too. E.g. the opaque types (PR 98688).
I noticed vector types are not handled correctly either. It assumes all vector
types of the same size are the same which is definitely not true for aarch64.

[Bug c++/104052] Modules ICE on powerpc64le-linux with -mabi=ieeelongdouble

2022-01-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104052

--- Comment #3 from Jakub Jelinek  ---
config/aarch64/aarch64-builtins.c:  aarch64_fp16_type_node = make_node
(REAL_TYPE);
config/aarch64/aarch64-builtins.c:  aarch64_bf16_type_node = make_node
(REAL_TYPE);
config/arm/arm-builtins.c:  arm_bf16_type_node = make_node (REAL_TYPE);
config/arm/arm-builtins.c:  arm_fp16_type_node = make_node (REAL_TYPE);
config/csky/csky.c:  static tree csky_floatHF_type_node = make_node
(REAL_TYPE);
config/i386/i386-builtins.c:  ix86_float16_type_node = make_node
(REAL_TYPE);
config/i386/i386-builtins.c:  float80_type_node = make_node (REAL_TYPE);
config/ia64/ia64.c:  fpreg_type = make_node (REAL_TYPE);
config/ia64/ia64.c:  float80_type = make_node (REAL_TYPE);
config/rs6000/rs6000-call.c:  ibm128_float_type_node = make_node
(REAL_TYPE);

is all I could find, now the question is what from these types are already in
some global_trees.  But the upper bound for target specific floating point
types will be most likely either 2 or 1.

[Bug c++/104052] Modules ICE on powerpc64le-linux with -mabi=ieeelongdouble

2022-01-16 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104052

--- Comment #2 from Jakub Jelinek  ---
I bet we don't reach this because modules.cc has:
/* Global trees.  */
static const std::pair global_tree_arys[] =
  {
std::pair (sizetype_tab, stk_type_kind_last),
std::pair (integer_types, itk_none),
std::pair (global_trees, TI_MODULE_HWM),
std::pair (c_global_trees, CTI_MODULE_HWM),
std::pair (cp_global_trees, CPTI_MODULE_HWM),
std::pair (NULL, 0)
  };
and special cases those somehow.  So e.g. long_double_type_node and others
#define float_type_node global_trees[TI_FLOAT_TYPE]
#define double_type_nodeglobal_trees[TI_DOUBLE_TYPE]
#define long_double_type_node   global_trees[TI_LONG_DOUBLE_TYPE]
or
#define float128_type_node  global_trees[TI_FLOAT128_TYPE]
all go through that.  But modules.cc doesn't know about types the backend
creates
like __ibm128.  __int24 etc. is probably ok due to integer_types
containing
  itk_intN_0,
  itk_unsigned_intN_0,
  itk_intN_1,
  itk_unsigned_intN_1,
  itk_intN_2,
  itk_unsigned_intN_2,
  itk_intN_3,
  itk_unsigned_intN_3,
So, one way through this would be to reserve one or more global_trees for the
extra backend floating point types.

[Bug c++/104052] Modules ICE on powerpc64le-linux with -mabi=ieeelongdouble

2022-01-16 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104052

Andrew Pinski  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org

--- Comment #1 from Andrew Pinski  ---
  ibm128_float_type_node = make_node (REAL_TYPE);
  TYPE_PRECISION (ibm128_float_type_node) = 128;
  SET_TYPE_MODE (ibm128_float_type_node, IFmode);
  layout_type (ibm128_float_type_node);


  long_double_type_node = make_node (REAL_TYPE);
  TYPE_PRECISION (long_double_type_node) = LONG_DOUBLE_TYPE_SIZE;
  layout_type (long_double_type_node);

I don't see any difference there either.
I don't see any reference to long_double_type_node in module.cc either. Nor
TYPE_MODE.