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/47271] [4.6 Regression] if-conversion removes a test (if), the function generates invalid outputs


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

--- Comment #5 from Sebastian Pop <spop at gcc dot gnu.org> 2011-01-18 18:45:27 UTC ---
In this loop:

  for (i=0, nops=0 ; i<codelen ; i += ((codestr[i] >= 90) ? 3 : 1))
    {
      addrmap[i] = i - nops;
      if (codestr[i] == 9)
    nops++;
    }

it looks like this part: i += ((codestr[i] >= 90) ? 3 : 1)
is miscompiled into:

  # i_35 = PHI <i_19(8), 0(2)>
  iftmp.0_4 = [cond_expr] D.2702_12 != 9 ? 3 : 1;
  i_19 = iftmp.0_4 + i_35;

the predicate for the increment is wrongly computed.


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