comparison gcc/stmt.c @ 132:d34655255c78

update gcc-8.2
author mir3636
date Thu, 25 Oct 2018 10:21:07 +0900
parents 84e7813d76e9
children 1830386684a0
comparison
equal deleted inserted replaced
130:e108057fa461 132:d34655255c78
1 /* Expands front end tree to back end RTL for GCC 1 /* Expands front end tree to back end RTL for GCC
2 Copyright (C) 1987-2017 Free Software Foundation, Inc. 2 Copyright (C) 1987-2018 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify it under 6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free 7 the terms of the GNU General Public License as published by the Free
79 /* Highest index value for this label. */ 79 /* Highest index value for this label. */
80 tree m_high; 80 tree m_high;
81 /* Label to jump to when node matches. */ 81 /* Label to jump to when node matches. */
82 tree m_code_label; 82 tree m_code_label;
83 }; 83 };
84
85 extern basic_block label_to_block_fn (struct function *, tree);
86 84
87 static bool check_unique_operand_names (tree, tree, tree); 85 static bool check_unique_operand_names (tree, tree, tree);
88 static char *resolve_operand_name_1 (char *, tree, tree, tree); 86 static char *resolve_operand_name_1 (char *, tree, tree, tree);
89 87
90 /* Return the rtx-label that corresponds to a LABEL_DECL, 88 /* Return the rtx-label that corresponds to a LABEL_DECL,
245 *constraint_p = ggc_alloc_string (buf, c_len); 243 *constraint_p = ggc_alloc_string (buf, c_len);
246 constraint = *constraint_p; 244 constraint = *constraint_p;
247 } 245 }
248 246
249 /* Loop through the constraint string. */ 247 /* Loop through the constraint string. */
250 for (p = constraint + 1; *p; p += CONSTRAINT_LEN (*p, p)) 248 for (p = constraint + 1; *p; )
251 switch (*p) 249 {
252 { 250 switch (*p)
253 case '+': 251 {
254 case '=': 252 case '+':
255 error ("operand constraint contains incorrectly positioned " 253 case '=':
256 "%<+%> or %<=%>"); 254 error ("operand constraint contains incorrectly positioned "
257 return false; 255 "%<+%> or %<=%>");
258 256 return false;
259 case '%': 257
260 if (operand_num + 1 == ninputs + noutputs) 258 case '%':
261 { 259 if (operand_num + 1 == ninputs + noutputs)
262 error ("%<%%%> constraint used with last operand"); 260 {
263 return false; 261 error ("%<%%%> constraint used with last operand");
264 } 262 return false;
265 break; 263 }
266
267 case '?': case '!': case '*': case '&': case '#':
268 case '$': case '^':
269 case 'E': case 'F': case 'G': case 'H':
270 case 's': case 'i': case 'n':
271 case 'I': case 'J': case 'K': case 'L': case 'M':
272 case 'N': case 'O': case 'P': case ',':
273 break;
274
275 case '0': case '1': case '2': case '3': case '4':
276 case '5': case '6': case '7': case '8': case '9':
277 case '[':
278 error ("matching constraint not valid in output operand");
279 return false;
280
281 case '<': case '>':
282 /* ??? Before flow, auto inc/dec insns are not supposed to exist,
283 excepting those that expand_call created. So match memory
284 and hope. */
285 *allows_mem = true;
286 break;
287
288 case 'g': case 'X':
289 *allows_reg = true;
290 *allows_mem = true;
291 break;
292
293 default:
294 if (!ISALPHA (*p))
295 break; 264 break;
296 enum constraint_num cn = lookup_constraint (p); 265
297 if (reg_class_for_constraint (cn) != NO_REGS 266 case '?': case '!': case '*': case '&': case '#':
298 || insn_extra_address_constraint (cn)) 267 case '$': case '^':
268 case 'E': case 'F': case 'G': case 'H':
269 case 's': case 'i': case 'n':
270 case 'I': case 'J': case 'K': case 'L': case 'M':
271 case 'N': case 'O': case 'P': case ',':
272 break;
273
274 case '0': case '1': case '2': case '3': case '4':
275 case '5': case '6': case '7': case '8': case '9':
276 case '[':
277 error ("matching constraint not valid in output operand");
278 return false;
279
280 case '<': case '>':
281 /* ??? Before flow, auto inc/dec insns are not supposed to exist,
282 excepting those that expand_call created. So match memory
283 and hope. */
284 *allows_mem = true;
285 break;
286
287 case 'g': case 'X':
299 *allows_reg = true; 288 *allows_reg = true;
300 else if (insn_extra_memory_constraint (cn))
301 *allows_mem = true; 289 *allows_mem = true;
302 else 290 break;
303 insn_extra_constraint_allows_reg_mem (cn, allows_reg, allows_mem); 291
304 break; 292 default:
305 } 293 if (!ISALPHA (*p))
294 break;
295 enum constraint_num cn = lookup_constraint (p);
296 if (reg_class_for_constraint (cn) != NO_REGS
297 || insn_extra_address_constraint (cn))
298 *allows_reg = true;
299 else if (insn_extra_memory_constraint (cn))
300 *allows_mem = true;
301 else
302 insn_extra_constraint_allows_reg_mem (cn, allows_reg, allows_mem);
303 break;
304 }
305
306 for (size_t len = CONSTRAINT_LEN (*p, p); len; len--, p++)
307 if (*p == '\0')
308 break;
309 }
306 310
307 return true; 311 return true;
308 } 312 }
309 313
310 /* Similar, but for input constraints. */ 314 /* Similar, but for input constraints. */
845 gcc_assert (ok); 849 gcc_assert (ok);
846 } 850 }
847 /* Output the table. */ 851 /* Output the table. */
848 emit_label (table_label); 852 emit_label (table_label);
849 853
850 if (CASE_VECTOR_PC_RELATIVE || flag_pic) 854 if (CASE_VECTOR_PC_RELATIVE
855 || (flag_pic && targetm.asm_out.generate_pic_addr_diff_vec ()))
851 emit_jump_table_data (gen_rtx_ADDR_DIFF_VEC (CASE_VECTOR_MODE, 856 emit_jump_table_data (gen_rtx_ADDR_DIFF_VEC (CASE_VECTOR_MODE,
852 gen_rtx_LABEL_REF (Pmode, 857 gen_rtx_LABEL_REF (Pmode,
853 table_label), 858 table_label),
854 gen_rtvec_v (ncases, labelvec), 859 gen_rtvec_v (ncases, labelvec),
855 const0_rtx, const0_rtx)); 860 const0_rtx, const0_rtx));
898 do_pending_stack_adjust (); 903 do_pending_stack_adjust ();
899 904
900 /* Find the default case target label. */ 905 /* Find the default case target label. */
901 tree default_lab = CASE_LABEL (gimple_switch_default_label (stmt)); 906 tree default_lab = CASE_LABEL (gimple_switch_default_label (stmt));
902 default_label = jump_target_rtx (default_lab); 907 default_label = jump_target_rtx (default_lab);
903 basic_block default_bb = label_to_block_fn (cfun, default_lab); 908 basic_block default_bb = label_to_block (cfun, default_lab);
904 edge default_edge = find_edge (bb, default_bb); 909 edge default_edge = find_edge (bb, default_bb);
905 910
906 /* Get upper and lower bounds of case values. */ 911 /* Get upper and lower bounds of case values. */
907 elt = gimple_switch_label (stmt, 1); 912 elt = gimple_switch_label (stmt, 1);
908 minval = fold_convert (index_type, CASE_LOW (elt)); 913 minval = fold_convert (index_type, CASE_LOW (elt));