Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/gcc/5.2.0/gentoo: 69_all_gcc-5-ms_abi-pr66838.patch README.history
Date: Fri, 02 Oct 2015 21:23:06
Message-Id: 20151002212301.E5A5B3EF@oystercatcher.gentoo.org
1 vapier 15/10/02 21:23:01
2
3 Modified: README.history
4 Added: 69_all_gcc-5-ms_abi-pr66838.patch
5 Log:
6 add upstream fix for miscompiles w/ms_abi attributes #549768 by Alexandre Rostovtsev
7
8 Revision Changes Path
9 1.3 src/patchsets/gcc/5.2.0/gentoo/README.history
10
11 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.2.0/gentoo/README.history?rev=1.3&view=markup
12 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.2.0/gentoo/README.history?rev=1.3&content-type=text/plain
13 diff : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.2.0/gentoo/README.history?r1=1.2&r2=1.3
14
15 Index: README.history
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/src/patchsets/gcc/5.2.0/gentoo/README.history,v
18 retrieving revision 1.2
19 retrieving revision 1.3
20 diff -u -r1.2 -r1.3
21 --- README.history 25 Aug 2015 16:47:40 -0000 1.2
22 +++ README.history 2 Oct 2015 21:23:01 -0000 1.3
23 @@ -1,3 +1,6 @@
24 +1.2 02 Oct 2015
25 + + 69_all_gcc-5-ms_abi-pr66838.patch
26 +
27 1.1 25 Aug 2015
28 U 74_all_gcc5_isl-dl.patch
29
30
31
32
33 1.1 src/patchsets/gcc/5.2.0/gentoo/69_all_gcc-5-ms_abi-pr66838.patch
34
35 file : http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.2.0/gentoo/69_all_gcc-5-ms_abi-pr66838.patch?rev=1.1&view=markup
36 plain: http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/gcc/5.2.0/gentoo/69_all_gcc-5-ms_abi-pr66838.patch?rev=1.1&content-type=text/plain
37
38 Index: 69_all_gcc-5-ms_abi-pr66838.patch
39 ===================================================================
40 https://bugs.gentoo.org/549768
41 https://gcc.gnu.org/PR66838
42
43 From 7dc80fc8bf531c5fe17a88fe505d1cd63867c190 Mon Sep 17 00:00:00 2001
44 From: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
45 Date: Fri, 17 Jul 2015 13:50:38 +0000
46 Subject: [PATCH] Backport from mainline:
47
48 2015-07-15 Uros Bizjak <ubizjak@×××××.com>
49
50 PR rtl-optimization/66838
51 * postreload.c (reload_cse_move2add): Also process
52 CALL_INSN_FUNCTION_USAGE when resetting information of
53 call-clobbered registers.
54
55 testsuite/ChangeLog:
56
57 Backport from mainline:
58 2015-07-15 Uros Bizjak <ubizjak@×××××.com>
59
60 PR rtl-optimization/66838
61 * gcc.target/i386/pr66838.c: New test.
62
63 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@225935 138bc75d-0d04-0410-961f-82ee72b054a4
64 ---
65 gcc/ChangeLog | 12 ++++++++++-
66 gcc/postreload.c | 17 ++++++++++++++++
67 gcc/testsuite/ChangeLog | 8 ++++++++
68 gcc/testsuite/gcc.target/i386/pr66838.c | 36 +++++++++++++++++++++++++++++++++
69 4 files changed, 72 insertions(+), 1 deletion(-)
70 create mode 100644 gcc/testsuite/gcc.target/i386/pr66838.c
71
72 diff --git a/gcc/postreload.c b/gcc/postreload.c
73 index 3e2802d..58b586a 100644
74 --- a/gcc/postreload.c
75 +++ b/gcc/postreload.c
76 @@ -2164,12 +2164,29 @@ reload_cse_move2add (rtx_insn *first)
77 unknown values. */
78 if (CALL_P (insn))
79 {
80 + rtx link;
81 +
82 for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--)
83 {
84 if (call_used_regs[i])
85 /* Reset the information about this register. */
86 reg_mode[i] = VOIDmode;
87 }
88 +
89 + for (link = CALL_INSN_FUNCTION_USAGE (insn); link;
90 + link = XEXP (link, 1))
91 + {
92 + rtx setuse = XEXP (link, 0);
93 + rtx usage_rtx = XEXP (setuse, 0);
94 + if (GET_CODE (setuse) == CLOBBER
95 + && REG_P (usage_rtx))
96 + {
97 + unsigned int end_regno = END_REGNO (usage_rtx);
98 + for (unsigned int r = REGNO (usage_rtx); r < end_regno; ++r)
99 + /* Reset the information about this register. */
100 + reg_mode[r] = VOIDmode;
101 + }
102 + }
103 }
104 }
105 return changed;
106 diff --git a/gcc/testsuite/gcc.target/i386/pr66838.c b/gcc/testsuite/gcc.target/i386/pr66838.c
107 new file mode 100644
108 index 0000000..46effed
109 --- /dev/null
110 +++ b/gcc/testsuite/gcc.target/i386/pr66838.c
111 @@ -0,0 +1,36 @@
112 +/* { dg-do run { target lp64 } } */
113 +/* { dg-options "-O2" } */
114 +
115 +void abort (void);
116 +
117 +char global;
118 +
119 +__attribute__((sysv_abi, noinline, noclone))
120 +void sysv_abi_func(char const *desc, void *local)
121 +{
122 + register int esi asm ("esi");
123 + register int edi asm ("edi");
124 +
125 + if (local != &global)
126 + abort ();
127 +
128 + /* Clobber some of the extra SYSV ABI registers. */
129 + asm volatile ("movl\t%2, %0\n\tmovl\t%2, %1"
130 + : "=r" (esi), "=r" (edi)
131 + : "i" (0xdeadbeef));
132 +}
133 +
134 +__attribute__((ms_abi, noinline, noclone))
135 +void ms_abi_func ()
136 +{
137 + sysv_abi_func ("1st call", &global);
138 + sysv_abi_func ("2nd call", &global);
139 + sysv_abi_func ("3rd call", &global);
140 +}
141 +
142 +int
143 +main(void)
144 +{
145 + ms_abi_func();
146 + return 0;
147 +}
148 --
149 2.5.2