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

--- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> ---
Picking the smallest failing testcase:

(In reply to Mikael Morin from comment #3)
> PASS->FAIL:gfortran.dg/typebound_generic_6.f03

dse2 is changing this...

  <bb 4> [local count: 1073312328]:
  afab._vptr = &__vtab_foo2_mod_Foo2;
  _17 = MEM[(struct __class_foo2_mod_Foo2_t &)&a.3]._data;
  *_17.foo.i = 2;
  *_17.j = 3;
  a.3 ={v} {CLOBBER(eos)};
  _13 = MEM[(struct foo *)_7].i;
  if (_13 != 2)
    goto <bb 5>; [0.04%]
  else
    goto <bb 6>; [99.96%]

  <bb 5> [local count: 429324]:
  _gfortran_stop_numeric (3, 0);


into this:

  <bb 4> [local count: 1073312328]:
  afab._vptr = &__vtab_foo2_mod_Foo2;
  a.3 ={v} {CLOBBER(eos)};
  _13 = MEM[(struct foo *)_7].i;
  if (_13 != 2)
    goto <bb 5>; [0.04%]
  else
    goto <bb 6>; [99.96%]

  <bb 5> [local count: 429324]:
  _gfortran_stop_numeric (3, 0);


So it's removing a store that should remain there.
I don't know why he thinks that struct __class_foo2_mod_Foo2_t & cannot contain
any struct foo *.
I'm stopping the investigations here.

Reply via email to