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
This commit is contained in:
Michael Matz 2009-05-10 18:40:16 +00:00 committed by Michael Matz
parent b7d7a473ab
commit af618949a4
4 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2009-05-10 Michael Matz <matz@suse.de>
PR target/40031
* config/arm/arm.c (require_pic_register): Emit on entry edge,
not at entry of function.
2009-05-10 Richard Guenther <rguenther@suse.de>
PR tree-optimization/40081

View File

@ -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));
}
}
}

View File

@ -1,3 +1,8 @@
2009-05-10 Michael Matz <matz@suse.de>
PR target/40031
* gcc.dg/pr40031.c: New test.
2009-05-10 Paul Thomas <pault@gcc.gnu.org>
PR fortran/40018

View File

@ -0,0 +1,9 @@
/* { dg-do compile { target fpic } } */
/* { dg-options "-O2 -fPIC" } */
double c;
double d;
double *f(int a)
{
if(a) return &c;
return &d;
}