diff options
author | Michael Matz <matz@suse.de> | 2009-05-10 18:40:16 +0000 |
---|---|---|
committer | Michael Matz <matz@gcc.gnu.org> | 2009-05-10 18:40:16 +0000 |
commit | af618949a430bf38b27a7e897dae4413a78ca8dc (patch) | |
tree | 59df119981f2831e61155fd1c19f3604ae41c562 /gcc/config | |
parent | b7d7a473ab0813c0f52f71248f3c204dfb2451f0 (diff) | |
download | gcc-af618949a430bf38b27a7e897dae4413a78ca8dc.zip gcc-af618949a430bf38b27a7e897dae4413a78ca8dc.tar.gz gcc-af618949a430bf38b27a7e897dae4413a78ca8dc.tar.bz2 |
re PR target/40031 (ARM broken with addresses in PHIs with -fPIC)
PR target/40031
* config/arm/arm.c (require_pic_register): Emit on entry
edge, not at entry of function.
testsuite/
* gcc.dg/pr40031.c: New test.
From-SVN: r147350
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/arm/arm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 9264760..1d9b426 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -3596,7 +3596,11 @@ require_pic_register (void) seq = get_insns (); end_sequence (); - emit_insn_after (seq, entry_of_function ()); + /* We can be called during expansion of PHI nodes, where + we can't yet emit instructions directly in the final + insn stream. Queue the insns on the entry edge, they will + be committed after everything else is expanded. */ + insert_insn_on_edge (seq, single_succ_edge (ENTRY_BLOCK_PTR)); } } } |