This is the mail archive of the gcc-patches@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]

Fix pr18133


My last patch to tree-ssa-threadupdate.c reminded me that we had the
patch for pr18133 pending.

To refresh everyone's memory, pr18133 is a missed optimization,
namely we fail to thread through blocks ending with a computed
goto.  This is a pretty simple extension to the existing jump
threading code.  Nothing particularly special here.

It's also the case that the CFG cleanup code wasn't simplifying
the CFG if DOM, CCP or some other pass const-propagated a label
address into a computed goto.  Specifically, it left the GOTO_EXPR
in the IL, would sometimes leave unnecessary edges in the CFG and
would leave those edges marked as abnormals.

This patch addresses both problems.  I wouldn't expect any
noticable benefit for normal C/C++ code.  Interpreters and
statement machines implemented with computed gotos might
benefit as may certain Fortran programs.  I was able to see
improvement in the generated code for various tests in our
testsuite (both new tests and existing tests).

Bootstrapped and regression tested on i686-pc-linux-gnu.




Attachment: PPP
Description: Text document


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