[Bug target/93235] [AArch64] ICE with __fp16 in a struct

2020-01-11 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93235

--- Comment #3 from Andrew Pinski  ---
aarch64 is one of the few targets that has a floating point type which is less
than SImode :).

A simple workaround for this bug is to change the code slightly:
struct sfp16 {
  __fp16 f;
};

struct sfp16 get(short x) {
  union {
__fp16 f;
short w;
  } u;
  u.w = x;
  return (struct sfp16){u.f};
}

[Bug target/93235] [AArch64] ICE with __fp16 in a struct

2020-01-11 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93235

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-01-12
Summary|[AArch64] ICE with __fp16   |[AArch64] ICE with __fp16
   |and union   |in a struct
 Ever confirmed|0   |1

--- Comment #2 from Andrew Pinski  ---
This one also ICEs in the same way:
struct sfp16 {
  __fp16 f;
};
struct sfp16 get(short x) {
  struct sfp16 a;
  *(short*)&(a.f) = x;
  return a;
}