[Bug middle-end/89351] internal compiler error: in exact_div, at poly-int.h:2139 with -fgnu-tm

2019-02-18 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89351

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-02-18
Summary|internal compiler error: in |internal compiler error: in
   |exact_div, at   |exact_div, at
   |poly-int.h:2139 |poly-int.h:2139 with
   ||-fgnu-tm
 Ever confirmed|0   |1

--- Comment #2 from Richard Biener  ---
IIRC seeing dups with bitfield handling of TM.

[Bug middle-end/89351] internal compiler error: in exact_div, at poly-int.h:2139

2019-02-14 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89351

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||rth at gcc dot gnu.org,
   ||torvald at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek  ---
Cleaned up testcase with -fgnu-tm:

struct S { int a : 5; unsigned b : 7; } c[1][1];

void
foo (int x)
{
}

void
bar (void)
{
  __transaction_relaxed {
foo (c[0][1].b);
  }
}

Seems the TM code can't deal with bitfields properly:
  _15 = __builtin__ITM_RU1 ([0][1].b);
taking address of a bitfield is invalid.  Dunno what exactly it should do,
perhaps tak address of the DECL_BIT_FIELD_REPRESENTATIVE and read the
DECL_BIT_FIELD_REPRESENTATIVE instead and then BIT_FIELD_REF or something
similar out of this?  And similarly deal somehow with the stores to bitfields
(that is actually a read modify write cycle that likely would need to be
exposed.

That said, -fgnu-tm is pretty much unmaintained for years, so maybe best would
be to remove that support (e.g. I believe it doesn't handle internal functions
at all, which appear commonly in the IL these days, doesn't handle various
builtins correctly, etc.).