public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/21883] New: tree-ssa-dom.c causing excessive code duplication
@ 2005-06-02 18:55 jakub at gcc dot gnu dot org
  2005-06-02 19:04 ` [Bug tree-optimization/21883] [4.1 Regression] jump threading " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-06-02 18:55 UTC (permalink / raw)
  To: gcc-bugs

extern int foo1 (void), foo2 (int);

int bar (int x)
{
  int varvar1, varvar2;
  int z;
  if (x > 913)
    varvar1 = foo1 ();
  else
    varvar2 = foo2 (6);
#define A foo1 (); foo1 (); foo1 (); foo1 (); foo1 ();
#define B A A A A A A A A A A
#define C B B B B B B B B B B
  C C C C C C C C C C C
  if (x > 913)
    z = varvar1 + foo1 ();
  else
    z = varvar2 + foo2 (6);
  return z;
}

Current HEAD will duplicate all the 2500 foo1 () calls to save a if (x > 913)
comparison.  With -Os almost no duplication should be allowed (only if the
duplicated instructions are expected to be shorter than the compare and branch),
and even with -O2 there should be some sensible limit.

-- 
           Summary: tree-ssa-dom.c causing excessive code duplication
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-09-01 11:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-02 18:55 [Bug tree-optimization/21883] New: tree-ssa-dom.c causing excessive code duplication jakub at gcc dot gnu dot org
2005-06-02 19:04 ` [Bug tree-optimization/21883] [4.1 Regression] jump threading " pinskia at gcc dot gnu dot org
2005-07-12  6:43 ` pinskia at gcc dot gnu dot org
2005-09-01 11:23 ` steven at gcc dot gnu dot org
2005-09-01 11:37 ` steven 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).