Wed Mar 23 15:51:37 2016 UTC ()
Revert previous changes until we can test them better.


(christos)
diff -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/except.c
diff -r1.5 -r1.6 src/external/gpl3/gcc/dist/gcc/config/vax/elf.h
diff -r1.12 -r1.13 src/external/gpl3/gcc/dist/gcc/config/vax/vax.c
diff -r1.6 -r1.7 src/external/gpl3/gcc/dist/gcc/config/vax/vax.h
diff -r1.10 -r1.11 src/external/gpl3/gcc/dist/gcc/config/vax/vax.md

cvs diff -r1.2 -r1.3 src/external/gpl3/gcc/dist/gcc/except.c (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/gcc/except.c 2016/03/23 12:52:43 1.2
+++ src/external/gpl3/gcc/dist/gcc/except.c 2016/03/23 15:51:36 1.3
@@ -2278,28 +2278,27 @@ expand_eh_return (void) @@ -2278,28 +2278,27 @@ expand_eh_return (void)
2278 clobber_return_register (); 2278 clobber_return_register ();
2279 2279
2280#ifdef EH_RETURN_STACKADJ_RTX 2280#ifdef EH_RETURN_STACKADJ_RTX
2281 emit_move_insn (EH_RETURN_STACKADJ_RTX, crtl->eh.ehr_stackadj); 2281 emit_move_insn (EH_RETURN_STACKADJ_RTX, crtl->eh.ehr_stackadj);
2282#endif 2282#endif
2283 2283
2284#ifdef HAVE_eh_return 2284#ifdef HAVE_eh_return
2285 if (HAVE_eh_return) 2285 if (HAVE_eh_return)
2286 emit_insn (gen_eh_return (crtl->eh.ehr_handler)); 2286 emit_insn (gen_eh_return (crtl->eh.ehr_handler));
2287 else 2287 else
2288#endif 2288#endif
2289 { 2289 {
2290#ifdef EH_RETURN_HANDLER_RTX 2290#ifdef EH_RETURN_HANDLER_RTX
2291 rtx insn = emit_move_insn (EH_RETURN_HANDLER_RTX, crtl->eh.ehr_handler); 2291 emit_move_insn (EH_RETURN_HANDLER_RTX, crtl->eh.ehr_handler);
2292 RTX_FRAME_RELATED_P (insn) = 1; 
2293#else 2292#else
2294 error ("__builtin_eh_return not supported on this target"); 2293 error ("__builtin_eh_return not supported on this target");
2295#endif 2294#endif
2296 } 2295 }
2297 2296
2298 emit_label (around_label); 2297 emit_label (around_label);
2299} 2298}
2300 2299
2301/* Convert a ptr_mode address ADDR_TREE to a Pmode address controlled by 2300/* Convert a ptr_mode address ADDR_TREE to a Pmode address controlled by
2302 POINTERS_EXTEND_UNSIGNED and return it. */ 2301 POINTERS_EXTEND_UNSIGNED and return it. */
2303 2302
2304rtx 2303rtx
2305expand_builtin_extend_pointer (tree addr_tree) 2304expand_builtin_extend_pointer (tree addr_tree)

cvs diff -r1.5 -r1.6 src/external/gpl3/gcc/dist/gcc/config/vax/elf.h (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/gcc/config/vax/elf.h 2016/03/23 12:52:43 1.5
+++ src/external/gpl3/gcc/dist/gcc/config/vax/elf.h 2016/03/23 15:51:37 1.6
@@ -35,37 +35,51 @@ along with GCC; see the file COPYING3.  @@ -35,37 +35,51 @@ along with GCC; see the file COPYING3.
35#define PTRDIFF_TYPE "long int" 35#define PTRDIFF_TYPE "long int"
36 36
37/* Profiling routine. */ 37/* Profiling routine. */
38#undef VAX_FUNCTION_PROFILER_NAME 38#undef VAX_FUNCTION_PROFILER_NAME
39#define VAX_FUNCTION_PROFILER_NAME "__mcount" 39#define VAX_FUNCTION_PROFILER_NAME "__mcount"
40 40
41/* Let's be re-entrant. */ 41/* Let's be re-entrant. */
42#undef PCC_STATIC_STRUCT_RETURN 42#undef PCC_STATIC_STRUCT_RETURN
43 43
44/* Before the prologue, the top of the frame is below the argument 44/* Before the prologue, the top of the frame is below the argument
45 count pushed by the CALLS and before the start of the saved registers. */ 45 count pushed by the CALLS and before the start of the saved registers. */
46#define INCOMING_FRAME_SP_OFFSET 0 46#define INCOMING_FRAME_SP_OFFSET 0
47 47
48/* We use R2-R3 (call-clobbered) registers for exceptions. */ 48/* Offset from the frame pointer register value to the top of the stack. */
49#define EH_RETURN_DATA_REGNO(N) ((N) < 2 ? (N) + 2 : INVALID_REGNUM) 49#define FRAME_POINTER_CFA_OFFSET(FNDECL) 0
 50
 51/* We use R2-R5 (call-clobbered) registers for exceptions. */
 52#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 2 : INVALID_REGNUM)
 53
 54/* Place the top of the stack for the DWARF2 EH stackadj value. */
 55#define EH_RETURN_STACKADJ_RTX \
 56 gen_rtx_MEM (SImode, \
 57 plus_constant (Pmode, \
 58 gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
 59 -4))
50 60
51/* Simple store the return handler into the call frame. */ 61/* Simple store the return handler into the call frame. */
52#define EH_RETURN_HANDLER_RTX \ 62#define EH_RETURN_HANDLER_RTX \
53 gen_rtx_MEM (Pmode, \ 63 gen_rtx_MEM (Pmode, \
54 plus_constant (Pmode, \ 64 plus_constant (Pmode, \
55 gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\ 65 gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\
56 16)) 66 16))
57 67
58 68
 69/* Reserve the top of the stack for exception handler stackadj value. */
 70#undef STARTING_FRAME_OFFSET
 71#define STARTING_FRAME_OFFSET -4
 72
59/* The VAX wants no space between the case instruction and the jump table. */ 73/* The VAX wants no space between the case instruction and the jump table. */
60#undef ASM_OUTPUT_BEFORE_CASE_LABEL 74#undef ASM_OUTPUT_BEFORE_CASE_LABEL
61#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) 75#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE)
62 76
63#undef SUBTARGET_OVERRIDE_OPTIONS 77#undef SUBTARGET_OVERRIDE_OPTIONS
64#define SUBTARGET_OVERRIDE_OPTIONS \ 78#define SUBTARGET_OVERRIDE_OPTIONS \
65 do \ 79 do \
66 { \ 80 { \
67 /* Turn off function CSE if we're doing PIC. */ \ 81 /* Turn off function CSE if we're doing PIC. */ \
68 if (flag_pic) \ 82 if (flag_pic) \
69 flag_no_function_cse = 1; \ 83 flag_no_function_cse = 1; \
70 } \ 84 } \
71 while (0) 85 while (0)

cvs diff -r1.12 -r1.13 src/external/gpl3/gcc/dist/gcc/config/vax/vax.c (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.c 2016/03/23 12:52:43 1.12
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.c 2016/03/23 15:51:37 1.13
@@ -185,28 +185,27 @@ vax_add_reg_cfa_offset (rtx insn, int of @@ -185,28 +185,27 @@ vax_add_reg_cfa_offset (rtx insn, int of
185 used in the function. This function is responsible for knowing 185 used in the function. This function is responsible for knowing
186 which registers should not be saved even if used. */ 186 which registers should not be saved even if used. */
187 187
188void 188void
189vax_expand_prologue (void) 189vax_expand_prologue (void)
190{ 190{
191 int regno, offset; 191 int regno, offset;
192 int mask = 0; 192 int mask = 0;
193 HOST_WIDE_INT size; 193 HOST_WIDE_INT size;
194 rtx insn; 194 rtx insn;
195 195
196 offset = 20; 196 offset = 20;
197 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) 197 for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
198 if ((df_regs_ever_live_p (regno) && !call_used_regs[regno]) 198 if (df_regs_ever_live_p (regno) && !call_used_regs[regno])
199 || (crtl->calls_eh_return && regno >= 2 && regno < 4)) 
200 { 199 {
201 mask |= 1 << regno; 200 mask |= 1 << regno;
202 offset += 4; 201 offset += 4;
203 } 202 }
204 203
205 insn = emit_insn (gen_procedure_entry_mask (GEN_INT (mask))); 204 insn = emit_insn (gen_procedure_entry_mask (GEN_INT (mask)));
206 RTX_FRAME_RELATED_P (insn) = 1; 205 RTX_FRAME_RELATED_P (insn) = 1;
207 206
208 /* The layout of the CALLG/S stack frame is follows: 207 /* The layout of the CALLG/S stack frame is follows:
209 208
210 <- CFA, AP 209 <- CFA, AP
211 r11 210 r11
212 r10 211 r10

cvs diff -r1.6 -r1.7 src/external/gpl3/gcc/dist/gcc/config/vax/vax.h (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.h 2016/03/23 12:52:43 1.6
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.h 2016/03/23 15:51:37 1.7
@@ -159,32 +159,32 @@ along with GCC; see the file COPYING3.  @@ -159,32 +159,32 @@ along with GCC; see the file COPYING3.
159 159
160/* VAX PSW for DWARF-2 */ 160/* VAX PSW for DWARF-2 */
161#define PSW_REGNUM VAX_PSW_REGNUM 161#define PSW_REGNUM VAX_PSW_REGNUM
162 162
163/* VAX pc is overloaded on a register. */ 163/* VAX pc is overloaded on a register. */
164#define PC_REGNUM VAX_PC_REGNUM 164#define PC_REGNUM VAX_PC_REGNUM
165 165
166/* Register to use for pushing function arguments. */ 166/* Register to use for pushing function arguments. */
167#define STACK_POINTER_REGNUM VAX_SP_REGNUM 167#define STACK_POINTER_REGNUM VAX_SP_REGNUM
168 168
169/* Base register for access to local variables of the function. */ 169/* Base register for access to local variables of the function. */
170#define FRAME_POINTER_REGNUM VAX_FP_REGNUM 170#define FRAME_POINTER_REGNUM VAX_FP_REGNUM
171 171
 172/* Offset from the frame pointer register value to the top of stack. */
 173#define FRAME_POINTER_CFA_OFFSET(FNDECL) 0
 174
172/* Base register for access to arguments of the function. */ 175/* Base register for access to arguments of the function. */
173#define ARG_POINTER_REGNUM VAX_AP_REGNUM 176#define ARG_POINTER_REGNUM VAX_AP_REGNUM
174 177
175/* Offset from the argument pointer register value to the CFA. */ 
176#define ARG_POINTER_CFA_OFFSET(FNDECL) 0 
177 
178/* Register in which static-chain is passed to a function. */ 178/* Register in which static-chain is passed to a function. */
179#define STATIC_CHAIN_REGNUM 0 179#define STATIC_CHAIN_REGNUM 0
180 180
181/* Register in which address to store a structure value 181/* Register in which address to store a structure value
182 is passed to a function. */ 182 is passed to a function. */
183#define VAX_STRUCT_VALUE_REGNUM 1 183#define VAX_STRUCT_VALUE_REGNUM 1
184  184
185/* Define the classes of registers for register constraints in the 185/* Define the classes of registers for register constraints in the
186 machine description. Also define ranges of constants. 186 machine description. Also define ranges of constants.
187 187
188 One of the classes must always be named ALL_REGS and include all hard regs. 188 One of the classes must always be named ALL_REGS and include all hard regs.
189 If there is more than one class, another class must be named NO_REGS 189 If there is more than one class, another class must be named NO_REGS
190 and contain no registers. 190 and contain no registers.

cvs diff -r1.10 -r1.11 src/external/gpl3/gcc/dist/gcc/config/vax/vax.md (expand / switch to unified diff)

--- src/external/gpl3/gcc/dist/gcc/config/vax/vax.md 2016/03/23 12:52:43 1.10
+++ src/external/gpl3/gcc/dist/gcc/config/vax/vax.md 2016/03/23 15:51:37 1.11
@@ -8,31 +8,26 @@ @@ -8,31 +8,26 @@
8;; the Free Software Foundation; either version 3, or (at your option) 8;; the Free Software Foundation; either version 3, or (at your option)
9;; any later version. 9;; any later version.
10 10
11;; GCC is distributed in the hope that it will be useful, 11;; GCC is distributed in the hope that it will be useful,
12;; but WITHOUT ANY WARRANTY; without even the implied warranty of 12;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;; GNU General Public License for more details. 14;; GNU General Public License for more details.
15 15
16;; You should have received a copy of the GNU General Public License 16;; You should have received a copy of the GNU General Public License
17;; along with GCC; see the file COPYING3. If not see 17;; along with GCC; see the file COPYING3. If not see
18;; <http://www.gnu.org/licenses/>. 18;; <http://www.gnu.org/licenses/>.
19 19
20 20
21;; Note that operand 1 is total size of args, in bytes, 
22;; and what the call insn wants is the number of words. 
23;; It is used in the call instruction as a byte, but in the addl2 as 
24;; a word. Since the only time we actually use it in the call instruction 
25;; is when it is a constant, SImode (for addl2) is the proper mode. 
26;;- Instruction patterns. When multiple patterns apply, 21;;- Instruction patterns. When multiple patterns apply,
27;;- the first one in the file is chosen. 22;;- the first one in the file is chosen.
28;;- 23;;-
29;;- See file "rtl.def" for documentation on define_insn, match_*, et al. 24;;- See file "rtl.def" for documentation on define_insn, match_*, et al.
30;;- 25;;-
31;;- cpp macro #define NOTICE_UPDATE_CC in file tm.h handles condition code 26;;- cpp macro #define NOTICE_UPDATE_CC in file tm.h handles condition code
32;;- updates for most instructions. 27;;- updates for most instructions.
33 28
34;; UNSPEC_VOLATILE usage: 29;; UNSPEC_VOLATILE usage:
35 30
36(define_c_enum "unspecv" [ 31(define_c_enum "unspecv" [
37 VUNSPEC_BLOCKAGE ; 'blockage' insn to prevent scheduling across an 32 VUNSPEC_BLOCKAGE ; 'blockage' insn to prevent scheduling across an
38 ; insn in the code. 33 ; insn in the code.
@@ -1304,85 +1299,118 @@ @@ -1304,85 +1299,118 @@
1304(define_insn "" 1299(define_insn ""
1305 [(set (pc) 1300 [(set (pc)
1306 (if_then_else 1301 (if_then_else
1307 (ne (match_operand:SI 0 "nonimmediate_operand" "+g") 1302 (ne (match_operand:SI 0 "nonimmediate_operand" "+g")
1308 (const_int 0)) 1303 (const_int 0))
1309 (label_ref (match_operand 1 "" "")) 1304 (label_ref (match_operand 1 "" ""))
1310 (pc))) 1305 (pc)))
1311 (set (match_dup 0) 1306 (set (match_dup 0)
1312 (plus:SI (match_dup 0) 1307 (plus:SI (match_dup 0)
1313 (const_int -1)))] 1308 (const_int -1)))]
1314 "" 1309 ""
1315 "decl %0\;jgequ %l1") 1310 "decl %0\;jgequ %l1")
1316  1311
1317;; Note that operand 1 is total size of args, in bytes, 
1318;; and what the call insn wants is the number of words. 
1319;; It is used in the call instruction as a byte, but in the addl2 as 
1320;; a word. Since the only time we actually use it in the call instruction 
1321;; is when it is a constant, SImode (for addl2) is the proper mode. 
1322(define_expand "call_pop" 1312(define_expand "call_pop"
1323 [(parallel [(call (match_operand:QI 0 "memory_operand" "") 1313 [(parallel [(call (match_operand:QI 0 "memory_operand" "")
1324 (match_operand:SI 1 "const_int_operand" "")) 1314 (match_operand:SI 1 "const_int_operand" ""))
1325 (set (reg:SI VAX_SP_REGNUM) 1315 (set (reg:SI VAX_SP_REGNUM)
1326 (plus:SI (reg:SI VAX_SP_REGNUM) 1316 (plus:SI (reg:SI VAX_SP_REGNUM)
1327 (match_operand:SI 3 "immediate_operand" "")))])] 1317 (match_operand:SI 3 "immediate_operand" "")))])]
1328 "" 1318 ""
1329{ 1319{
1330 gcc_assert (INTVAL (operands[1]) <= 255 * 4); 1320 gcc_assert (INTVAL (operands[3]) <= 255 * 4 && INTVAL (operands[3]) % 4 == 0);
1331 operands[1] = GEN_INT ((INTVAL (operands[1]) + 3) / 4); 1321
 1322 /* Operand 1 is the number of bytes to be popped by DW_CFA_GNU_args_size
 1323 during EH unwinding. We must include the argument count pushed by
 1324 the calls instruction. */
 1325 operands[1] = GEN_INT (INTVAL (operands[3]) + 4);
1332}) 1326})
1333 1327
1334(define_insn "*call_pop" 1328(define_insn "*call_pop"
1335 [(call (match_operand:QI 0 "memory_operand" "m") 1329 [(call (match_operand:QI 0 "memory_operand" "m")
1336 (match_operand:SI 1 "const_int_operand" "n")) 1330 (match_operand:SI 1 "const_int_operand" "n"))
1337 (set (reg:SI VAX_SP_REGNUM) (plus:SI (reg:SI VAX_SP_REGNUM) 1331 (set (reg:SI VAX_SP_REGNUM) (plus:SI (reg:SI VAX_SP_REGNUM)
1338 (match_operand:SI 2 "immediate_operand" "i")))] 1332 (match_operand:SI 2 "immediate_operand" "i")))]
1339 "" 1333 ""
1340 "calls %1,%0") 1334{
 1335 operands[1] = GEN_INT ((INTVAL (operands[1]) - 4) / 4);
 1336 return "calls %1,%0";
 1337})
1341 1338
1342(define_expand "call_value_pop" 1339(define_expand "call_value_pop"
1343 [(parallel [(set (match_operand 0 "" "") 1340 [(parallel [(set (match_operand 0 "" "")
1344 (call (match_operand:QI 1 "memory_operand" "") 1341 (call (match_operand:QI 1 "memory_operand" "")
1345 (match_operand:SI 2 "const_int_operand" ""))) 1342 (match_operand:SI 2 "const_int_operand" "")))
1346 (set (reg:SI VAX_SP_REGNUM) 1343 (set (reg:SI VAX_SP_REGNUM)
1347 (plus:SI (reg:SI VAX_SP_REGNUM) 1344 (plus:SI (reg:SI VAX_SP_REGNUM)
1348 (match_operand:SI 4 "immediate_operand" "")))])] 1345 (match_operand:SI 4 "immediate_operand" "")))])]
1349 "" 1346 ""
1350{ 1347{
1351 gcc_assert (INTVAL (operands[2]) <= 255 * 4); 1348 gcc_assert (INTVAL (operands[4]) <= 255 * 4 && INTVAL (operands[4]) % 4 == 0);
1352 operands[2] = GEN_INT ((INTVAL (operands[2]) + 3) / 4); 1349
 1350 /* Operand 2 is the number of bytes to be popped by DW_CFA_GNU_args_size
 1351 during EH unwinding. We must include the argument count pushed by
 1352 the calls instruction. */
 1353 operands[2] = GEN_INT (INTVAL (operands[4]) + 4);
1353}) 1354})
1354 1355
1355(define_insn "*call_value_pop" 1356(define_insn "*call_value_pop"
1356 [(set (match_operand 0 "" "") 1357 [(set (match_operand 0 "" "")
1357 (call (match_operand:QI 1 "memory_operand" "m") 1358 (call (match_operand:QI 1 "memory_operand" "m")
1358 (match_operand:SI 2 "const_int_operand" "n"))) 1359 (match_operand:SI 2 "const_int_operand" "n")))
1359 (set (reg:SI VAX_SP_REGNUM) (plus:SI (reg:SI VAX_SP_REGNUM) 1360 (set (reg:SI VAX_SP_REGNUM) (plus:SI (reg:SI VAX_SP_REGNUM)
1360 (match_operand:SI 3 "immediate_operand" "i")))] 1361 (match_operand:SI 3 "immediate_operand" "i")))]
1361 "" 1362 ""
1362 "calls %2,%1") 1363 "*
 1364{
 1365 operands[2] = GEN_INT ((INTVAL (operands[2]) - 4) / 4);
 1366 return \"calls %2,%1\";
 1367}")
1363 1368
1364;; Define another set of these for the case of functions with no operands. 1369(define_expand "call"
1365;; These will allow the optimizers to do a slightly better job. 1370 [(call (match_operand:QI 0 "memory_operand" "")
1366(define_insn "call" 1371 (match_operand:SI 1 "const_int_operand" ""))]
1367 [(call (match_operand:QI 0 "memory_operand" "m") 1372 ""
1368 (const_int 0))] 1373 "
 1374{
 1375 /* Operand 1 is the number of bytes to be popped by DW_CFA_GNU_args_size
 1376 during EH unwinding. We must include the argument count pushed by
 1377 the calls instruction. */
 1378 operands[1] = GEN_INT (INTVAL (operands[1]) + 4);
 1379}")
 1380
 1381(define_insn "*call"
 1382 [(call (match_operand:QI 0 "memory_operand" "m")
 1383 (match_operand:SI 1 "const_int_operand" ""))]
1369 "" 1384 ""
1370 "calls $0,%0") 1385 "calls $0,%0")
1371 1386
1372(define_insn "call_value" 1387(define_expand "call_value"
 1388 [(set (match_operand 0 "" "")
 1389 (call (match_operand:QI 1 "memory_operand" "")
 1390 (match_operand:SI 2 "const_int_operand" "")))]
 1391 ""
 1392 "
 1393{
 1394 /* Operand 2 is the number of bytes to be popped by DW_CFA_GNU_args_size
 1395 during EH unwinding. We must include the argument count pushed by
 1396 the calls instruction. */
 1397 operands[2] = GEN_INT (INTVAL (operands[2]) + 4);
 1398}")
 1399
 1400(define_insn "*call_value"
1373 [(set (match_operand 0 "" "") 1401 [(set (match_operand 0 "" "")
1374 (call (match_operand:QI 1 "memory_operand" "m") 1402 (call (match_operand:QI 1 "memory_operand" "m")
1375 (const_int 0)))] 1403 (match_operand:SI 2 "const_int_operand" "")))]
1376 "" 1404 ""
1377 "calls $0,%1") 1405 "calls $0,%1")
1378 1406
1379;; Call subroutine returning any type. 1407;; Call subroutine returning any type.
1380 1408
1381(define_expand "untyped_call" 1409(define_expand "untyped_call"
1382 [(parallel [(call (match_operand 0 "" "") 1410 [(parallel [(call (match_operand 0 "" "")
1383 (const_int 0)) 1411 (const_int 0))
1384 (match_operand 1 "" "") 1412 (match_operand 1 "" "")
1385 (match_operand 2 "" "")])] 1413 (match_operand 2 "" "")])]
1386 "" 1414 ""
1387 " 1415 "
1388{ 1416{