This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/31375] New: missed loop-if transformation / branch reduction.


long condition( void );
long f1( void );
long f2( void );

void foo( void )
{
        for ( ;; )
                if ( condition() )
                        f1();
                else
                        f2();
}

foo() could be transformed to bar():

void bar( void )
{
        long (* f[ 2 ])() = { &f2, &f1 };
        for ( ;; )
                f[ condition() ]();
}


-- 
           Summary: missed loop-if transformation / branch reduction.
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]