re PR bootstrap/4128 (Bootstrap on solaris2.7 fails compiling libf2c/libF77/l_gt.c)

PR bootstrap/4128
	* config/sparc/sparc.c (gen_v9_scc): Move early clobber test
	before movrXX only, use reg_overlap_mentioned_p.
	Only special case NE if just one insn can be generated.

	* gcc.c-torture/compile/20020315-1.c: New test.

From-SVN: r50826
This commit is contained in:
Jakub Jelinek 2002-03-15 19:51:36 +01:00 committed by Jakub Jelinek
parent 1540944868
commit a42519bebd
4 changed files with 56 additions and 14 deletions

View File

@ -1,3 +1,10 @@
2002-03-15 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/4128
* config/sparc/sparc.c (gen_v9_scc): Move early clobber test
before movrXX only, use reg_overlap_mentioned_p.
Only special case NE if just one insn can be generated.
2002-03-15 Jason Merrill <jason@redhat.com>
* varasm.c (assemble_variable): Call resolve_unique_section before

View File

@ -2343,16 +2343,7 @@ gen_v9_scc (compare_code, operands)
|| GET_MODE (operands[0]) == DImode))
return 0;
/* Handle the case where operands[0] == sparc_compare_op0.
We "early clobber" the result. */
if (REGNO (operands[0]) == REGNO (sparc_compare_op0))
{
op0 = gen_reg_rtx (GET_MODE (sparc_compare_op0));
emit_move_insn (op0, sparc_compare_op0);
}
else
op0 = sparc_compare_op0;
/* For consistency in the following. */
op0 = sparc_compare_op0;
op1 = sparc_compare_op1;
/* Try to use the movrCC insns. */
@ -2362,14 +2353,12 @@ gen_v9_scc (compare_code, operands)
&& v9_regcmp_p (compare_code))
{
/* Special case for op0 != 0. This can be done with one instruction if
operands[0] == sparc_compare_op0. We don't assume they are equal
now though. */
operands[0] == sparc_compare_op0. */
if (compare_code == NE
&& GET_MODE (operands[0]) == DImode
&& GET_MODE (op0) == DImode)
&& rtx_equal_p (op0, operands[0]))
{
emit_insn (gen_rtx_SET (VOIDmode, operands[0], op0));
emit_insn (gen_rtx_SET (VOIDmode, operands[0],
gen_rtx_IF_THEN_ELSE (DImode,
gen_rtx_fmt_ee (compare_code, DImode,
@ -2379,6 +2368,14 @@ gen_v9_scc (compare_code, operands)
return 1;
}
if (reg_overlap_mentioned_p (operands[0], op0))
{
/* Handle the case where operands[0] == sparc_compare_op0.
We "early clobber" the result. */
op0 = gen_reg_rtx (GET_MODE (sparc_compare_op0));
emit_move_insn (op0, sparc_compare_op0);
}
emit_insn (gen_rtx_SET (VOIDmode, operands[0], const0_rtx));
if (GET_MODE (op0) != DImode)
{

View File

@ -1,3 +1,7 @@
2002-03-15 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/compile/20020315-1.c: New test.
2002-03-15 Richard Earnshaw <rearnsha@arm.com>
* gcc.dg/weak-1.c: Fix scan tests.

View File

@ -0,0 +1,34 @@
/* PR bootstrap/4128 */
extern int bar (char *, char *, int, int);
extern long baz (char *, char *, int, int);
int sgt (char *a, char *b, int c, int d)
{
return bar (a, b, c, d) > 0;
}
long dgt (char *a, char *b, int c, int d)
{
return baz (a, b, c, d) > 0;
}
int sne (char *a, char *b, int c, int d)
{
return bar (a, b, c, d) != 0;
}
long dne (char *a, char *b, int c, int d)
{
return baz (a, b, c, d) != 0;
}
int seq (char *a, char *b, int c, int d)
{
return bar (a, b, c, d) == 0;
}
long deq (char *a, char *b, int c, int d)
{
return baz (a, b, c, d) == 0;
}