[Bug optimization/13599] New: [tree-ssa] Inefficient ordering low GIMPLE lowering

steven at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Jan 7 15:14:00 GMT 2004


Removing useless statements and lowering interact rather poorly with 
GIMPLE lowering.  We sometimes produce extra labels, and remove  
statements that we reintroduce during lowering.  For example, consider 
this code: 
 
void 
foo (void) 
{ 
  int i, a; 
  for (i = 0; i < 10; i++) 
    { a = i; } 
} 
 
 
t.c.t06.gimple 
------------------------------------- 
;; Function foo (foo) 
 
foo () 
{ 
  int i; 
  int a; 
 
  i = 0; 
  goto <D1056>; 
  <D1054>:; 
  { 
    a = 10; 
  } 
  i = i + 1; 
  <D1056>:; 
  if (i <= 9) 
    { 
      goto <D1054>; 
    } 
  else 
    { 
      goto <D1053>; 
    } 
  <D1053>:; 
} 
------------------------------------- 
 
t.c.t07.useless 
------------------------------------- 
;; Function foo (foo) 
 
foo () 
{ 
  int i; 
  int a; 
 
  i = 0; 
  goto <D1056>; 
  <D1054>:; 
  a = 10; 
  i = i + 1; 
  <D1056>:; 
  if (i <= 9) 
    { 
      goto <D1054>; 
    } 
  else 
    { 
 
    } 
  <D1053>:; 
} 
------------------------------------- 
 
t.c.t09.lower 
------------------------------------- 
;; Function foo (foo) 
 
foo () 
{ 
  int a; 
  int i; 
 
  i = 0; 
  goto <D1056>; 
  <D1054>:; 
  a = 10; 
  i = i + 1; 
  <D1056>:; 
  if (i <= 9) goto <D1054>; else goto <D1062>; 
  <D1062>:; 
  <D1053>:; 
} 
------------------------------------- 
 
Notice we first remove a GOTO during "useless" and then resurrect a new 
one while lowering.  Also, there's an extra label, which gives is an extra 
basic block when building the flow graph.

-- 
           Summary: [tree-ssa] Inefficient ordering low GIMPLE lowering
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: steven at gcc dot gnu dot org
                CC: dnovillo at redhat dot com,gcc-bugs at gcc dot gnu dot
                    org


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



More information about the Gcc-bugs mailing list