[Bug tree-optimization/42971] New: GCC cannot perform partial inlining

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Feb 5 11:08:00 GMT 2010


Inlining of guards is important for optimizing.  Consider

int flag;

int foo (void)
{
  if (!flag)
    return 0;

  ...
}

we should be able to partially inline foo into its callers transforming


  if (foo ())
    {
       ...
    }
  else
    {
       ...
    }

to

   if (!flag)
     <ret> = 0;
   else
     <ret> = foo.clone();
   if (<ret>)
     {
        ...
     }
   else
     {
        ...
     }

to be able to perform optimizations across the path where foo.clone
is not executed.


-- 
           Summary: GCC cannot perform partial inlining
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: hubicka at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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



More information about the Gcc-bugs mailing list