[Bug tree-optimization/48822] [4.5/4.6/4.7 Regression] G++ gets stucks and never finishes compilation when enabling -O2/3 optimization options.

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon May 2 11:41:00 GMT 2011


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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|4.6.0                       |
      Known to fail|                            |4.6.0, 4.7.0

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-02 11:39:58 UTC ---
Testcase that breaks since 4.5:

void foo (int *, int *);
int bar ()
{
  int a = 0;
  int b = 0;
  if (b != 0)
    {
      int ax = a;
      int bx = b;
      while (bx != 0)
        {
          int tem = ax % bx;
          ax = bx;
          bx = tem;
        }
    }
  foo (&a, &b);
}

4.4 has different PHI ordering and does

Value numbering bx_2 stmt = bx_2 = PHI <bx_5(3), tem_6(4)>
Setting value number of bx_2 to 0 (changed)
Value numbering ax_1 stmt = ax_1 = PHI <ax_4(3), bx_2(4)>
Setting value number of ax_1 to 0 (changed)
Value numbering tem_6 stmt = tem_6 = ax_1 % bx_2;
Setting value number of tem_6 to tem_6 (changed)
Value numbering bx_2 stmt = bx_2 = PHI <bx_5(3), tem_6(4)>
Setting value number of bx_2 to bx_2 (changed)
Value numbering ax_1 stmt = ax_1 = PHI <ax_4(3), bx_2(4)>
Setting value number of ax_1 to ax_1 (changed)

to avoid the issue.



More information about the Gcc-bugs mailing list