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 tree-optimization/71335] [7 Regression] wrong code at -O2 and -O3 in 32-bit and 64-bit modes on x86_64-linux-gnu


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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at redhat dot com

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The return goes away in thread1 pass.  Before:

main ()
{
  int b;
  int a.0_1;

  <bb 2>:

  <bb 3>:
  # b_3 = PHI <0(2), 9(4), 9(3)>
  a.0_1 = a;
  if (a.0_1 < 0)
    goto <bb 3>;
  else
    goto <bb 4>;

  <bb 4>:
  if (b_3 != 0)
    goto <bb 3>;
  else
    goto <bb 5>;

  <bb 5>:
  return 0;

}

after:

main ()
{
  int b;
  int a.0_1;
  int a.0_8;

  <bb 2>:

  <bb 3>:
  # b_3 = PHI <0(2), 9(4), 9(3)>
  a.0_1 = a;
  if (a.0_1 < 0)
    goto <bb 3>;
  else
    goto <bb 4>;

  <bb 4>:
  # b_4 = PHI <9(3)>
  a.0_8 = a;
  goto <bb 3>;

}

The first code still is finite: a is 0 and thus it should execute
BB2->BB3 (b_3=0,a.0_1=0)->BB4->BB5.

Jeff, any idea?

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