re PR rtl-optimization/51821 (64bit > 32bit conversion produces incorrect results with optimizations)

PR rtl-optimization/51821
	* recog.c (peep2_find_free_register): Determine clobbered registers
	from insn pattern.

testsuite/ChangeLog:

	PR rtl-optimization/51821
	* gcc.dg/pr51821.c: New test.

From-SVN: r183194
This commit is contained in:
Uros Bizjak 2012-01-15 19:03:46 +01:00 committed by Uros Bizjak
parent 512b60583e
commit bf63ef6c22
4 changed files with 42 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2012-01-15 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/51821
* recog.c (peep2_find_free_register): Determine clobbered registers
from insn pattern.
2012-01-14 Denis Chertykov <chertykov@gmail.com>
PR target/50925

View File

@ -3038,6 +3038,7 @@ peep2_find_free_register (int from, int to, const char *class_str,
static int search_ofs;
enum reg_class cl;
HARD_REG_SET live;
df_ref *def_rec;
int i;
gcc_assert (from < MAX_INSNS_PER_PEEP2 + 1);
@ -3051,12 +3052,14 @@ peep2_find_free_register (int from, int to, const char *class_str,
while (from != to)
{
HARD_REG_SET this_live;
gcc_assert (peep2_insn_data[from].insn != NULL_RTX);
/* Don't use registers set or clobbered by the insn. */
for (def_rec = DF_INSN_DEFS (peep2_insn_data[from].insn);
*def_rec; def_rec++)
SET_HARD_REG_BIT (live, DF_REF_REGNO (*def_rec));
from = peep2_buf_position (from + 1);
gcc_assert (peep2_insn_data[from].insn != NULL_RTX);
REG_SET_TO_HARD_REG_SET (this_live, peep2_insn_data[from].live_before);
IOR_HARD_REG_SET (live, this_live);
}
cl = (class_str[0] == 'r' ? GENERAL_REGS

View File

@ -1,3 +1,8 @@
2012-01-15 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/51821
* gcc.dg/pr51821.c: New test.
2012-01-15 Andreas Schwab <schwab@linux-m68k.org>
* gcc.dg/torture/pr8081.c: Fix char signedness assumption.

View File

@ -0,0 +1,24 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse" { target { i?86-*-* x86_64-*-* } } } */
/* { dg-require-effective-target sse_runtime { target { i?86-*-* x86_64-*-* } } } */
extern void abort (void);
unsigned int __attribute__((noinline))
test (int shift_size)
{
unsigned long long res = ~0;
return res << shift_size;
}
int
main ()
{
int dst = 32;
if (test (dst) != 0)
abort ();
return 0;
}