diff options
author | Hans-Peter Nilsson <hp@bitrange.com> | 2018-09-09 18:05:48 +0000 |
---|---|---|
committer | Hans-Peter Nilsson <hp@gcc.gnu.org> | 2018-09-09 18:05:48 +0000 |
commit | a236f9d6402901a67d6e41797e6be5a9ab24e865 (patch) | |
tree | 4a07e45e1969fadbfcf83dd1676f4ee397d97deb /gcc | |
parent | b8106e8fd7e7bf20b5f1b5a842931a51fc6dbdfa (diff) | |
download | gcc-a236f9d6402901a67d6e41797e6be5a9ab24e865.zip gcc-a236f9d6402901a67d6e41797e6be5a9ab24e865.tar.gz gcc-a236f9d6402901a67d6e41797e6be5a9ab24e865.tar.bz2 |
re PR target/85666 (gcc-8.0.1 fails to build mmix target: gcc/libgcc/libgcc2.h:203:20: internal compiler error: in leaf_function_p, at final.c:4488)
PR target/85666
* config/mmix/mmix.c (MMIX_CFUN_NEEDS_SAVED_EH_RETURN_ADDRESS): Don't
call leaf_function_p, instead use has_hard_reg_initial_val.
From-SVN: r264182
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/mmix/mmix.c | 19 |
2 files changed, 14 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e8b6237..270c67e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-09 Hans-Peter Nilsson <hp@bitrange.com> + + PR target/85666 + * config/mmix/mmix.c (MMIX_CFUN_NEEDS_SAVED_EH_RETURN_ADDRESS): Don't + call leaf_function_p, instead use has_hard_reg_initial_val. + 2018-09-09 Nathan Sidwell <nathan@acm.org> * gcc.h (pfatal_with_name): Don't declare here. diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 9da826c..5ee9930 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -60,19 +60,16 @@ along with GCC; see the file COPYING3. If not see /* We have no means to tell DWARF 2 about the register stack, so we need to store the return address on the stack if an exception can get into - this function. FIXME: Narrow condition. Before any whole-function - analysis, df_regs_ever_live_p () isn't initialized. We know it's up-to-date - after reload_completed; it may contain incorrect information some time - before that. Within a RTL sequence (after a call to start_sequence, - such as in RTL expanders), leaf_function_p doesn't see all insns - (perhaps any insn). But regs_ever_live is up-to-date when - leaf_function_p () isn't, so we "or" them together to get accurate - information. FIXME: Some tweak to leaf_function_p might be - preferable. */ + this function. We'll have an "initial value" recorded for the + return-register if we've seen a call instruction emitted. This note + will be inaccurate before instructions are emitted, but the only caller + at that time is looking for modulo from stack-boundary, to which the + return-address does not contribute, and which is always 0 for MMIX + anyway. Beware of calling leaf_function_p here, as it'll abort if + called within a sequence. */ #define MMIX_CFUN_NEEDS_SAVED_EH_RETURN_ADDRESS \ (flag_exceptions \ - && ((reload_completed && df_regs_ever_live_p (MMIX_rJ_REGNUM)) \ - || !leaf_function_p ())) + && has_hard_reg_initial_val (Pmode, MMIX_INCOMING_RETURN_ADDRESS_REGNUM)) #define IS_MMIX_EH_RETURN_DATA_REG(REGNO) \ (crtl->calls_eh_return \ |