Merge lp:~cltang/gcc-linaro/lp-687406-save-temps-difference-backport into lp:gcc-linaro/4.5

Proposed by Chung-Lin Tang
Status: Merged
Merged at revision: 99448
Proposed branch: lp:~cltang/gcc-linaro/lp-687406-save-temps-difference-backport
Merge into: lp:gcc-linaro/4.5
Diff against target: 155 lines (+106/-3)
5 files modified
ChangeLog.linaro (+18/-0)
gcc/jump.c (+7/-1)
gcc/rtl.c (+18/-2)
gcc/testsuite/gcc.target/i386/pr46865-1.c (+31/-0)
gcc/testsuite/gcc.target/i386/pr46865-2.c (+32/-0)
To merge this branch: bzr merge lp:~cltang/gcc-linaro/lp-687406-save-temps-difference-backport
Reviewer Review Type Date Requested Status
Linaro Toolchain Developers Pending
Review via email: mp+43507@code.launchpad.net

Description of the change

Backports mainline trunk rev.167686, to fix LP:687406
http://gcc.gnu.org/viewcvs?view=revision&revision=167686

To post a comment you must log in.
Revision history for this message
Ulrich Weigand (uweigand) wrote :

Looks good to me.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ChangeLog.linaro'
--- ChangeLog.linaro 2010-12-10 18:52:01 +0000
+++ ChangeLog.linaro 2010-12-13 11:16:17 +0000
@@ -1,3 +1,21 @@
12010-12-13 Chung-Lin Tang <cltang@codesourcery.com>
2
3 Backport from mainline:
4
5 2010-12-10 Jakub Jelinek <jakub@redhat.com>
6
7 PR rtl-optimization/46865
8
9 gcc/
10 * rtl.c (rtx_equal_p_cb, rtx_equal_p): For last operand of
11 ASM_OPERANDS and ASM_INPUT if integers are different,
12 call locator_eq.
13 * jump.c (rtx_renumbered_equal_p): Likewise.
14
15 gcc/testsuite/
16 * gcc.target/i386/pr46865-1.c: New test.
17 * gcc.target/i386/pr46865-2.c: New test.
18
12010-12-10 Andrew Stubbs <ams@codesourcery.com>192010-12-10 Andrew Stubbs <ams@codesourcery.com>
220
3 gcc/21 gcc/
422
=== modified file 'gcc/jump.c'
--- gcc/jump.c 2009-11-25 10:55:54 +0000
+++ gcc/jump.c 2010-12-13 11:16:17 +0000
@@ -1728,7 +1728,13 @@
17281728
1729 case 'i':1729 case 'i':
1730 if (XINT (x, i) != XINT (y, i))1730 if (XINT (x, i) != XINT (y, i))
1731 return 0;1731 {
1732 if (((code == ASM_OPERANDS && i == 6)
1733 || (code == ASM_INPUT && i == 1))
1734 && locator_eq (XINT (x, i), XINT (y, i)))
1735 break;
1736 return 0;
1737 }
1732 break;1738 break;
17331739
1734 case 't':1740 case 't':
17351741
=== modified file 'gcc/rtl.c'
--- gcc/rtl.c 2009-11-25 10:55:54 +0000
+++ gcc/rtl.c 2010-12-13 11:16:17 +0000
@@ -429,7 +429,15 @@
429 case 'n':429 case 'n':
430 case 'i':430 case 'i':
431 if (XINT (x, i) != XINT (y, i))431 if (XINT (x, i) != XINT (y, i))
432 return 0;432 {
433#ifndef GENERATOR_FILE
434 if (((code == ASM_OPERANDS && i == 6)
435 || (code == ASM_INPUT && i == 1))
436 && locator_eq (XINT (x, i), XINT (y, i)))
437 break;
438#endif
439 return 0;
440 }
433 break;441 break;
434442
435 case 'V':443 case 'V':
@@ -549,7 +557,15 @@
549 case 'n':557 case 'n':
550 case 'i':558 case 'i':
551 if (XINT (x, i) != XINT (y, i))559 if (XINT (x, i) != XINT (y, i))
552 return 0;560 {
561#ifndef GENERATOR_FILE
562 if (((code == ASM_OPERANDS && i == 6)
563 || (code == ASM_INPUT && i == 1))
564 && locator_eq (XINT (x, i), XINT (y, i)))
565 break;
566#endif
567 return 0;
568 }
553 break;569 break;
554570
555 case 'V':571 case 'V':
556572
=== added file 'gcc/testsuite/gcc.target/i386/pr46865-1.c'
--- gcc/testsuite/gcc.target/i386/pr46865-1.c 1970-01-01 00:00:00 +0000
+++ gcc/testsuite/gcc.target/i386/pr46865-1.c 2010-12-13 11:16:17 +0000
@@ -0,0 +1,31 @@
1/* PR rtl-optimization/46865 */
2/* { dg-do compile } */
3/* { dg-options "-O2" } */
4
5extern unsigned long f;
6
7#define m1(f) \
8 if (f & 1) \
9 asm volatile ("nop /* asmnop */\n"); \
10 else \
11 asm volatile ("nop /* asmnop */\n");
12
13#define m2(f) \
14 if (f & 1) \
15 asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx"); \
16 else \
17 asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");
18
19void
20foo (void)
21{
22 m1 (f);
23}
24
25void
26bar (void)
27{
28 m2 (f);
29}
30
31/* { dg-final { scan-assembler-times "asmnop" 2 } } */
032
=== added file 'gcc/testsuite/gcc.target/i386/pr46865-2.c'
--- gcc/testsuite/gcc.target/i386/pr46865-2.c 1970-01-01 00:00:00 +0000
+++ gcc/testsuite/gcc.target/i386/pr46865-2.c 2010-12-13 11:16:17 +0000
@@ -0,0 +1,32 @@
1/* PR rtl-optimization/46865 */
2/* { dg-do compile } */
3/* { dg-options "-O2 -save-temps" } */
4
5extern unsigned long f;
6
7#define m1(f) \
8 if (f & 1) \
9 asm volatile ("nop /* asmnop */\n"); \
10 else \
11 asm volatile ("nop /* asmnop */\n");
12
13#define m2(f) \
14 if (f & 1) \
15 asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx"); \
16 else \
17 asm volatile ("nop /* asmnop */\n" : : "i" (6) : "cx");
18
19void
20foo (void)
21{
22 m1 (f);
23}
24
25void
26bar (void)
27{
28 m2 (f);
29}
30
31/* { dg-final { scan-assembler-times "asmnop" 2 } } */
32/* { dg-final { cleanup-saved-temps } } */

Subscribers

People subscribed via source and target branches