diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2016-12-07 14:55:31 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco@gcc.gnu.org> | 2016-12-07 14:55:31 +0000 |
commit | 0064f49e76154354fa41c13403cac1da9069093a (patch) | |
tree | 310218f84b0a695466c72952cfa30dbf18f7f661 /gcc/cfgexpand.c | |
parent | 8734dfacbbd841ccf1fb9682a631896013442807 (diff) | |
download | gcc-0064f49e76154354fa41c13403cac1da9069093a.zip gcc-0064f49e76154354fa41c13403cac1da9069093a.tar.gz gcc-0064f49e76154354fa41c13403cac1da9069093a.tar.bz2 |
GCC caches the whether a function is a leaf in crtl->is_leaf.
GCC caches the whether a function is a leaf in crtl->is_leaf. Using this
in the backend is best as leaf_function_p may not work correctly (eg. while
emitting prolog or epilog code). There are many reads of crtl->is_leaf
before it is initialized. Many targets do in targetm.frame_pointer_required
(eg. arm, aarch64, i386, mips, sparc), which is called before register
allocation by ira_setup_eliminable_regset and sched_init.
Additionally, SHRINK_WRAPPING_ENABLED calls targetm.have_simple_return,
which evaluates the condition of the simple_return instruction. On ARM
this results in a call to use_simple_return_p which requires crtl->is_leaf
to be set correctly.
To fix this, initialize crtl->is_leaf in ira_setup_eliminable_regset and
early on in ira. A bootstrap did not find any uninitialized reads of
crtl->is_leaf on Thumb-2. A follow-up patch will remove incorrect uses
of leaf_function_p from the ARM backend.
gcc/
* gcc/ira.c (ira_setup_eliminable_regset): Initialize crtl->is_leaf.
(ira): Move initialization of crtl->is_leaf earlier.
From-SVN: r243347
Diffstat (limited to 'gcc/cfgexpand.c')
0 files changed, 0 insertions, 0 deletions