public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/26602]  New: final_cleanup can mess up incoming frequencies
@ 2006-03-08  5:15 pinskia at gcc dot gnu dot org
  2006-03-11  5:00 ` [Bug tree-optimization/26602] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-08  5:15 UTC (permalink / raw)
  To: gcc-bugs

An example (which I got from looking a little at varasm.c):
struct a
{
  int i;
};

int f(int *);

int g(struct a *b)
{
  struct a *b1 =b;
  int t = 0;
  for(;b < b1+3;b++)
    {
      if (b==0) return 1;
      int *c = &b->i;
      if (c == 0) return 1;
      t+=f(c);
    }
  return t;
}

-------

Currently we get:
Removing basic block 9
Merging blocks 2 and 3
g (b)
{
  struct a * b.35;
  int t;
  int D.1525;

<bb 2>:
  if (b == 0B) goto <L7>; else goto <L20>;

Invalid sum of incoming frequencies 2731, should be 2048
<L20>:;
  b.35 = b;
  t = 0;
  goto <bb 5> (<L2>);

<L0>:;
  if (b.35 == 0B) goto <L7>; else goto <L2>;

<L2>:;
  D.1525 = f (&b.35->i);
  t = t + D.1525;
  b.35 = b.35 + 4B;
  if (b.35 != (struct a *) (b + 12B)) goto <L0>; else goto <L21>;

<L7>:;
  t = 1;

Invalid sum of incoming frequencies 2156, should be 2875
<L21>:;
  return t;


-- 
           Summary: final_cleanup can mess up incoming frequencies
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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


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

* [Bug tree-optimization/26602] final_cleanup can mess up incoming frequencies
  2006-03-08  5:15 [Bug tree-optimization/26602] New: final_cleanup can mess up incoming frequencies pinskia at gcc dot gnu dot org
@ 2006-03-11  5:00 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-11  5:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-03-11 05:00 -------
Hmm, what is happening here is we fold the conditional and then update the
frequency for the next bb but not the ones after it which causes us to get the
warnings:
Invalid sum of incoming frequencies 2731, should be 2048

The numbers before the cleanup:
  # BLOCK 9 freq:719
  # BLOCK 3 freq:2156

After:
  # BLOCK 2 freq:2875


But:
  # BLOCK 6 freq:375
  # BLOCK 3 freq:2048


2875-375 == 2731 != 2048


-- 


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


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

end of thread, other threads:[~2006-03-11  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-08  5:15 [Bug tree-optimization/26602] New: final_cleanup can mess up incoming frequencies pinskia at gcc dot gnu dot org
2006-03-11  5:00 ` [Bug tree-optimization/26602] " 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).