public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/21829] New: [4.1 Regression] missed jump threading after unroller
@ 2005-05-30 19:06 pinskia at gcc dot gnu dot org
  2005-05-30 19:21 ` [Bug tree-optimization/21829] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-30 19:06 UTC (permalink / raw)
  To: gcc-bugs

Take the following code:
int test(int v)
{
  int x = 0;
  for (int u=0;u<2;u++)
  {
    if (u>v)  // v is input-arg the compiler can't deside at compiletime
    {
      if (u%2==1) // can only happen for u==1 (so loops for 0 and 2 does not do
        x++;      // anything. Hoped gcc would notice when unrolling.
    }
  }  
  return x;
}

We get:
<bb 0>:
  if (v_8 < 0) goto <L1>; else goto <L15>;

<L15>:;
  if (v_8 <= 0) goto <L1>; else goto <L3>;

<L1>:;

  # x_1 = PHI <0(3), 1(1)>;
<L3>:;
  return x_1;

}

Notice that the if in L15 is always true.
The 4.0 branch gets this correct.

-- 
           Summary: [4.1 Regression] missed jump threading after unroller
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: minor
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2006-03-30 17:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-21829-6528@http.gcc.gnu.org/bugzilla/>
2005-10-29 15:52 ` [Bug tree-optimization/21829] [4.1 Regression] missed jump threading after unroller pinskia at gcc dot gnu dot org
2005-10-30 23:32 ` pinskia at gcc dot gnu dot org
2006-02-09  3:20 ` [Bug tree-optimization/21829] [4.1/4.2 " law at redhat dot com
2006-02-11  0:59 ` pinskia at gcc dot gnu dot org
2006-02-28 20:39 ` mmitchel at gcc dot gnu dot org
2006-03-21  5:09 ` law at redhat dot com
2006-03-21  5:10 ` law at redhat dot com
2006-03-22 11:14 ` richard dot guenther at gmail dot com
2006-03-22 14:01 ` law at redhat dot com
2006-03-22 15:06 ` richard dot guenther at gmail dot com
2006-03-22 15:36 ` law at redhat dot com
2006-03-28 19:14 ` law at redhat dot com
2006-03-30 17:15 ` law at redhat dot com
2005-05-30 19:06 [Bug tree-optimization/21829] New: [4.1 " pinskia at gcc dot gnu dot org
2005-05-30 19:21 ` [Bug tree-optimization/21829] " pinskia at gcc dot gnu dot org
2005-06-12  3:44 ` pinskia at gcc dot gnu dot org
2005-09-10  5:56 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).