re PR rtl-optimization/17825 (ICE in reg_bitfield_target_p)

PR rtl-optimization/17825
	* combine.c (subst): Ignore STRICT_LOW_PART no matter if REG_P (new)
	or not.

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

From-SVN: r91369
This commit is contained in:
Jakub Jelinek 2004-11-27 10:39:00 +01:00 committed by Jakub Jelinek
parent fcfbdb74da
commit b78b8bd83e
4 changed files with 44 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2004-11-27 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/17825
* combine.c (subst): Ignore STRICT_LOW_PART no matter if REG_P (new)
or not.
2004-11-27 Alan Modra <amodra@bigpond.net.au>
PR target/12769

View File

@ -3556,10 +3556,10 @@ subst (rtx x, rtx from, rtx to, int in_dest, int unique_copy)
/* If this is a register being set, ignore it. */
new = XEXP (x, i);
if (in_dest
&& (code == SUBREG || code == STRICT_LOW_PART
|| code == ZERO_EXTRACT)
&& i == 0
&& REG_P (new))
&& (((code == SUBREG || code == ZERO_EXTRACT)
&& REG_P (new))
|| code == STRICT_LOW_PART))
;
else if (COMBINE_RTX_EQUAL_P (XEXP (x, i), from))

View File

@ -1,3 +1,8 @@
2004-11-27 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/17825
* gcc.c-torture/compile/20041119-1.c: New test.
2004-11-27 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* lib/target-libpath.exp (restore_ld_library_path_env_vars):

View File

@ -0,0 +1,30 @@
/* PR rtl-optimization/17825 */
#ifdef __i386__
register unsigned int reg __asm ("esi");
#elif defined __x86_64__
register unsigned int reg __asm ("r14");
#else
unsigned int reg;
#endif
struct S
{
unsigned int h[8];
} *b;
unsigned int c;
void foo (int);
void
bar (void)
{
unsigned int j, k, l, m;
j = (reg & 0xffff) | ((b->h[2] & 0xffff) << 16);
k = c & 0xffff;
if (k == 0)
foo (0);
l = (j / k) & 0xffff;
m = (j % k) & 0xffff;
reg = (reg & 0xffff0000) | l;
b->h[2] = (b->h[2] & 0xffff0000) | m;
}