re PR rtl-optimization/46865 (Using -save-temps (or ccache, distcc) produces different results with multiline macros containing asm code)
PR rtl-optimization/46865 * rtl.c (rtx_equal_p_cb, rtx_equal_p): For last operand of ASM_OPERANDS and ASM_INPUT if integers are different, call locator_eq. * jump.c (rtx_renumbered_equal_p): Likewise. * gcc.target/i386/pr46865-1.c: New test. * gcc.target/i386/pr46865-2.c: New test. From-SVN: r167686
This commit is contained in:
parent
6391db6814
commit
fee457233e
|
@ -1,5 +1,11 @@
|
||||||
2010-12-10 Jakub Jelinek <jakub@redhat.com>
|
2010-12-10 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR rtl-optimization/46865
|
||||||
|
* rtl.c (rtx_equal_p_cb, rtx_equal_p): For last operand of
|
||||||
|
ASM_OPERANDS and ASM_INPUT if integers are different,
|
||||||
|
call locator_eq.
|
||||||
|
* jump.c (rtx_renumbered_equal_p): Likewise.
|
||||||
|
|
||||||
PR tree-optimization/46864
|
PR tree-optimization/46864
|
||||||
* tree-ssa-loop-im.c (loop_suitable_for_sm): Return false even
|
* tree-ssa-loop-im.c (loop_suitable_for_sm): Return false even
|
||||||
when there are EDGE_EH exit edges.
|
when there are EDGE_EH exit edges.
|
||||||
|
|
|
@ -1727,7 +1727,13 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
|
||||||
|
|
||||||
case 'i':
|
case 'i':
|
||||||
if (XINT (x, i) != XINT (y, i))
|
if (XINT (x, i) != XINT (y, i))
|
||||||
return 0;
|
{
|
||||||
|
if (((code == ASM_OPERANDS && i == 6)
|
||||||
|
|| (code == ASM_INPUT && i == 1))
|
||||||
|
&& locator_eq (XINT (x, i), XINT (y, i)))
|
||||||
|
break;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
|
|
20
gcc/rtl.c
20
gcc/rtl.c
|
@ -431,7 +431,15 @@ rtx_equal_p_cb (const_rtx x, const_rtx y, rtx_equal_p_callback_function cb)
|
||||||
case 'n':
|
case 'n':
|
||||||
case 'i':
|
case 'i':
|
||||||
if (XINT (x, i) != XINT (y, i))
|
if (XINT (x, i) != XINT (y, i))
|
||||||
return 0;
|
{
|
||||||
|
#ifndef GENERATOR_FILE
|
||||||
|
if (((code == ASM_OPERANDS && i == 6)
|
||||||
|
|| (code == ASM_INPUT && i == 1))
|
||||||
|
&& locator_eq (XINT (x, i), XINT (y, i)))
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'V':
|
case 'V':
|
||||||
|
@ -555,7 +563,15 @@ rtx_equal_p (const_rtx x, const_rtx y)
|
||||||
case 'n':
|
case 'n':
|
||||||
case 'i':
|
case 'i':
|
||||||
if (XINT (x, i) != XINT (y, i))
|
if (XINT (x, i) != XINT (y, i))
|
||||||
return 0;
|
{
|
||||||
|
#ifndef GENERATOR_FILE
|
||||||
|
if (((code == ASM_OPERANDS && i == 6)
|
||||||
|
|| (code == ASM_INPUT && i == 1))
|
||||||
|
&& locator_eq (XINT (x, i), XINT (y, i)))
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'V':
|
case 'V':
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
2010-12-10 Jakub Jelinek <jakub@redhat.com>
|
2010-12-10 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR rtl-optimization/46865
|
||||||
|
* gcc.target/i386/pr46865-1.c: New test.
|
||||||
|
* gcc.target/i386/pr46865-2.c: New test.
|
||||||
|
|
||||||
PR tree-optimization/46864
|
PR tree-optimization/46864
|
||||||
* g++.dg/opt/pr46864.C: New test.
|
* g++.dg/opt/pr46864.C: New test.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
/* PR rtl-optimization/46865 */
|
||||||
|
/* { dg-do compile } */
|
||||||
|
/* { dg-options "-O2" } */
|
||||||
|
|
||||||
|
extern unsigned long f;
|
||||||
|
|
||||||
|
#define m1(f) \
|
||||||
|
if (f & 1) \
|
||||||
|
asm volatile ("nop /* asmnop */\n"); \
|
||||||
|
else \
|
||||||
|
asm volatile ("nop /* asmnop */\n");
|
||||||
|
|
||||||
|
#define m2(f) \
|
||||||
|
if (f & 1) \
|
||||||
|
asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx"); \
|
||||||
|
else \
|
||||||
|
asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");
|
||||||
|
|
||||||
|
void
|
||||||
|
foo (void)
|
||||||
|
{
|
||||||
|
m1 (f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
bar (void)
|
||||||
|
{
|
||||||
|
m2 (f);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* { dg-final { scan-assembler-times "asmnop" 2 } } */
|
|
@ -0,0 +1,32 @@
|
||||||
|
/* PR rtl-optimization/46865 */
|
||||||
|
/* { dg-do compile } */
|
||||||
|
/* { dg-options "-O2 -save-temps" } */
|
||||||
|
|
||||||
|
extern unsigned long f;
|
||||||
|
|
||||||
|
#define m1(f) \
|
||||||
|
if (f & 1) \
|
||||||
|
asm volatile ("nop /* asmnop */\n"); \
|
||||||
|
else \
|
||||||
|
asm volatile ("nop /* asmnop */\n");
|
||||||
|
|
||||||
|
#define m2(f) \
|
||||||
|
if (f & 1) \
|
||||||
|
asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx"); \
|
||||||
|
else \
|
||||||
|
asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");
|
||||||
|
|
||||||
|
void
|
||||||
|
foo (void)
|
||||||
|
{
|
||||||
|
m1 (f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
bar (void)
|
||||||
|
{
|
||||||
|
m2 (f);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* { dg-final { scan-assembler-times "asmnop" 2 } } */
|
||||||
|
/* { dg-final { cleanup-saved-temps } } */
|
Loading…
Reference in New Issue