This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50346] Function call foils VRP/jump-threading of redundant predicate on struct member


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50346

Steven Bosscher <steven at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |alias
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-09-10
                 CC|                            |rguenth at gcc dot gnu.org,
                   |                            |steven at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Steven Bosscher <steven at gcc dot gnu.org> 2011-09-10 13:35:50 UTC ---
Confirmed. Here is the .143t.optimized dump for trunk r178747:

void test() ()
{
  struct foo f;
  bool D.2119;
  bool retval.0;

<bb 2>:
  # .MEM_13 = VDEF <.MEM_8(D)>
  f.b = 0;
  # .MEM_10 = VDEF <.MEM_13>
  retval.0_2 = bar ();
  if (retval.0_2 != 0)
    goto <bb 3>;
  else
    goto <bb 4>;

<bb 3>:
  # .MEM_11 = VDEF <.MEM_10>
  f.b = 1;
  goto <bb 5>;

<bb 4>:
  # VUSE <.MEM_10>
  D.2119_5 = f.b;
  if (D.2119_5 != 0)
    goto <bb 5>;
  else
    goto <bb 6>;

<bb 5>:
Invalid sum of incoming frequencies 5000, should be 3898
  # .MEM_16 = PHI <.MEM_10(4), .MEM_11(3)>
  # .MEM_12 = VDEF <.MEM_16>
  foo::baz (&f);

<bb 6>:
Invalid sum of incoming frequencies 8898, should be 10000
  # .MEM_7 = PHI <.MEM_10(4), .MEM_12(5)>
  # VUSE <.MEM_7>
  return;

}

Note how the call to bar() clobbers .MEM_13 which is f.b.

Alias related => Richi in CC.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]