aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2018-05-09 14:48:43 +0200
committerSegher Boessenkool <segher@gcc.gnu.org>2018-05-09 14:48:43 +0200
commit826f35d8124731d0f4f5415c84fb59d2b6adf58b (patch)
tree1910a313b5a9cb60b3a35d1183deadcd113a548a /gcc/fortran
parent97741c118180621e47edb6350571077eb0bc28ca (diff)
downloadgcc-826f35d8124731d0f4f5415c84fb59d2b6adf58b.zip
gcc-826f35d8124731d0f4f5415c84fb59d2b6adf58b.tar.gz
gcc-826f35d8124731d0f4f5415c84fb59d2b6adf58b.tar.bz2
shrink-wrap: Improve spread_components (PR85645)
In the testcase for PR85645 we do a pretty dumb placement of the prologue/epilogue for the LR component: we place an epilogue for LR before a control flow split where one of the branches clobbers LR eventually, and the other does not. The branch that does clobber it will need a prologue again some time later. Because saving and restoring LR is a two step process---it needs to be moved via a GPR--- the backend emits CFI directives so that we get correct unwind information. But both regcprop and regrename do not properly handle such CFI directives leading to ICEs. Now, neither of the two branches needs to have LR restored at all, because both of the branches end up in an infinite loop. This patch makes spread_component return a boolean saying if anything was changed, and if so, it is called again. This obviously is finite (there is a finite number of basic blocks, each with a finite number of components, and spread_components can only assign more components to a block, never less). I also instrumented the code, and on a bootstrap+regtest spread_components made changes a maximum of two times. Interestingly though it made changes on two iterations in a third of the cases it did anything at all! PR rtl-optimization/85645 * shrink-wrap.c (spread_components): Return a boolean saying if anything was changed. (try_shrink_wrapping_separate): Iterate spread_components until nothing changes anymore. From-SVN: r260076
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions