[Bug middle-end/98649] Trivial jump table not eliminated

2021-10-02 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98649

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2021-10-02

--- Comment #3 from Andrew Pinski  ---
Confirmed. Interesting LLVM does not do the optimization either ...

[Bug middle-end/98649] Trivial jump table not eliminated

2021-01-13 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98649

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška  ---
Yes, that's the case. Switch lowering pass sees:

   [local count: 1073741809]:
  _1 = v_14(D)->index_;
  switch (_1)  [0.00%], case 0:  [20.00%], case 1: 
[20.00%], case 2:  [20.00%], case 3:  [20.00%], case 4: 
[20.00%]>

   [local count: 214748365]:
:
  _15 = _14(D)->D.2444.t0_;
  _2 = MEM[(struct T0 *)v_14(D) + 8B].D.2369._vptr.Base;
  _3 = *_2;
  OBJ_TYPE_REF(_3;(struct T0)_15->0) (_15, f_16(D));
  goto ; [100.00%]

   [local count: 214748365]:
:
  _18 = _14(D)->D.2444.t1_;
  _4 = MEM[(struct T1 *)v_14(D) + 8B].D.2383._vptr.Base;
  _5 = *_4;
  OBJ_TYPE_REF(_5;(struct T1)_18->0) (_18, f_16(D));
  goto ; [100.00%]

...

[Bug middle-end/98649] Trivial jump table not eliminated

2021-01-12 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98649

Andrew Pinski  changed:

   What|Removed |Added

  Component|c++ |middle-end
   Severity|normal  |enhancement

--- Comment #1 from Andrew Pinski  ---
This might be because there is type based vtable not lowered until expand time.