public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/46939] New: http://blog.regehr.org/archives/320 example 6
@ 2010-12-14 14:31 jakub at gcc dot gnu.org
  2010-12-15 12:24 ` [Bug ada/46939] " hubicka at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-12-14 14:31 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: http://blog.regehr.org/archives/320 example 6
           Product: gcc
           Version: 4.6.0
               URL: http://blog.regehr.org/archives/320
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: hubicka@gcc.gnu.org


The reason we don't expand / 10 using a multiplication is because gcc thinks it
happens in cold code.

In *.optimized we have:
  # BLOCK 5 freq:9999
  # PRED: 4 [100.0%]  (fallthru,exec) 2 [33.3%]  (exec)
  # PT = nonlocal 

  # strD.1584_1 = PHI <strD.1584_17(4), strD.1584_12(D)(2)>
  # signD.1590_5 = PHI <signD.1590_4(4), 0(2)>
<L39>:
  str.0D.2703_18 = (long unsigned intD.4) strD.1584_1;
  end.1D.2704_19 = (long unsigned intD.4) endD.1592_13;
  if (str.0D.2703_18 < end.1D.2704_19)
    goto <bb 6>;
  else
    goto <bb 22>;
  # SUCC: 6 [4.0%]  (true,exec) 22 [96.0%]  (false,exec)

  # BLOCK 6 freq:400
  # PRED: 5 [4.0%]  (true,exec)
  # VUSE <.MEMD.2753_65(D)>
  D.2701_20 = *strD.1584_1;
  if (D.2701_20 > 48)
    goto <bb 7>;
  else
    goto <bb 22>;
  # SUCC: 7 [4.0%]  (true,exec) 22 [96.0%]  (false,exec)

  # BLOCK 7 freq:16
  # PRED: 6 [4.0%]  (true,exec)
  if (D.2701_20 <= 57)
    goto <bb 8>;
  else
    goto <bb 22>;
  # SUCC: 8 [4.0%]  (true,exec) 22 [96.0%]  (false,exec)
...
  # BLOCK 15 freq:6
  # PRED: 14 [96.0%]  (true,exec)
  D.2735_44 = (long intD.2) digitD.1591_43;
  D.2736_45 = 9223372036854775807 - D.2735_44;
  D.2737_46 = D.2736_45 / 10;
  if (ctx_valueD.1589_3 <= D.2737_46)
    goto <bb 16>;
  else
    goto <bb 22>;
  # SUCC: 16 [96.0%]  (true,exec) 22 [4.0%]  (false,exec)

while ((unsigned long) str < (unsigned long) end) is a loop, not sure why we
predict the loop header to terminate immediately, and both the >= 48 and <= 57
tests have return -1; in the other branch, so it is also strange to see them
predicted so unlikely.  Honza?


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

end of thread, other threads:[~2010-12-17 17:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-14 14:31 [Bug ada/46939] New: http://blog.regehr.org/archives/320 example 6 jakub at gcc dot gnu.org
2010-12-15 12:24 ` [Bug ada/46939] " hubicka at gcc dot gnu.org
2010-12-15 12:54 ` hubicka at gcc dot gnu.org
2010-12-15 13:29 ` hubicka at gcc dot gnu.org
2010-12-16  1:27 ` [Bug tree-optimization/46939] " hubicka at gcc dot gnu.org
2010-12-16  1:40 ` hubicka at gcc dot gnu.org
2010-12-16  9:26 ` jakub at gcc dot gnu.org
2010-12-16 15:11 ` regehr at cs dot utah.edu
2010-12-17 17:11 ` regehr at cs dot utah.edu

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).