comparison gcc/gimple-low.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 /* GIMPLE lowering pass. Converts High GIMPLE into Low GIMPLE. 1 /* GIMPLE lowering pass. Converts High GIMPLE into Low GIMPLE.
2 2
3 Copyright (C) 2003-2017 Free Software Foundation, Inc. 3 Copyright (C) 2003-2018 Free Software Foundation, Inc.
4 4
5 This file is part of GCC. 5 This file is part of GCC.
6 6
7 GCC is free software; you can redistribute it and/or modify it under 7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free 8 the terms of the GNU General Public License as published by the Free
108 i = gsi_start (lowered_body); 108 i = gsi_start (lowered_body);
109 lower_gimple_bind (&i, &data); 109 lower_gimple_bind (&i, &data);
110 110
111 i = gsi_last (lowered_body); 111 i = gsi_last (lowered_body);
112 112
113 /* If we had begin stmt markers from e.g. PCH, but this compilation
114 doesn't want them, lower_stmt will have cleaned them up; we can
115 now clear the flag that indicates we had them. */
116 if (!MAY_HAVE_DEBUG_MARKER_STMTS && cfun->debug_nonbind_markers)
117 {
118 /* This counter needs not be exact, but before lowering it will
119 most certainly be. */
120 gcc_assert (cfun->debug_marker_count == 0);
121 cfun->debug_nonbind_markers = false;
122 }
123
113 /* If the function falls off the end, we need a null return statement. 124 /* If the function falls off the end, we need a null return statement.
114 If we've already got one in the return_statements vector, we don't 125 If we've already got one in the return_statements vector, we don't
115 need to do anything special. Otherwise build one by hand. */ 126 need to do anything special. Otherwise build one by hand. */
116 bool may_fallthru = gimple_seq_may_fallthru (lowered_body); 127 bool may_fallthru = gimple_seq_may_fallthru (lowered_body);
117 if (may_fallthru 128 if (may_fallthru
293 geh_else *eh_else_stmt = as_a <geh_else *> (stmt); 304 geh_else *eh_else_stmt = as_a <geh_else *> (stmt);
294 lower_sequence (gimple_eh_else_n_body_ptr (eh_else_stmt), data); 305 lower_sequence (gimple_eh_else_n_body_ptr (eh_else_stmt), data);
295 lower_sequence (gimple_eh_else_e_body_ptr (eh_else_stmt), data); 306 lower_sequence (gimple_eh_else_e_body_ptr (eh_else_stmt), data);
296 } 307 }
297 break; 308 break;
309
310 case GIMPLE_DEBUG:
311 gcc_checking_assert (cfun->debug_nonbind_markers);
312 /* We can't possibly have debug bind stmts before lowering, we
313 first emit them when entering SSA. */
314 gcc_checking_assert (gimple_debug_nonbind_marker_p (stmt));
315 /* Propagate fallthruness. */
316 /* If the function (e.g. from PCH) had debug stmts, but they're
317 disabled for this compilation, remove them. */
318 if (!MAY_HAVE_DEBUG_MARKER_STMTS)
319 gsi_remove (gsi, true);
320 else
321 gsi_next (gsi);
322 return;
298 323
299 case GIMPLE_NOP: 324 case GIMPLE_NOP:
300 case GIMPLE_ASM: 325 case GIMPLE_ASM:
301 case GIMPLE_ASSIGN: 326 case GIMPLE_ASSIGN:
302 case GIMPLE_PREDICT: 327 case GIMPLE_PREDICT:
328 if (EXPR_P (arg)) 353 if (EXPR_P (arg))
329 TREE_SET_BLOCK (arg, data->block); 354 TREE_SET_BLOCK (arg, data->block);
330 } 355 }
331 356
332 if (decl 357 if (decl
333 && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL) 358 && fndecl_built_in_p (decl, BUILT_IN_NORMAL))
334 { 359 {
335 if (DECL_FUNCTION_CODE (decl) == BUILT_IN_SETJMP) 360 if (DECL_FUNCTION_CODE (decl) == BUILT_IN_SETJMP)
336 { 361 {
337 lower_builtin_setjmp (gsi); 362 lower_builtin_setjmp (gsi);
338 data->cannot_fallthru = false; 363 data->cannot_fallthru = false;
501 lower_sequence (gimple_eh_filter_failure_ptr (gsi_stmt (i)), data); 526 lower_sequence (gimple_eh_filter_failure_ptr (gsi_stmt (i)), data);
502 if (!data->cannot_fallthru) 527 if (!data->cannot_fallthru)
503 cannot_fallthru = false; 528 cannot_fallthru = false;
504 break; 529 break;
505 530
531 case GIMPLE_DEBUG:
532 gcc_checking_assert (gimple_debug_begin_stmt_p (stmt));
533 break;
534
506 default: 535 default:
507 /* This case represents statements to be executed when an 536 /* This case represents statements to be executed when an
508 exception occurs. Those statements are implicitly followed 537 exception occurs. Those statements are implicitly followed
509 by a GIMPLE_RESX to resume execution after the exception. So 538 by a GIMPLE_RESX to resume execution after the exception. So
510 in this case the try/catch never falls through. */ 539 in this case the try/catch never falls through. */
643 /* Same as gimple_stmt_may_fallthru, but for the gimple sequence SEQ. */ 672 /* Same as gimple_stmt_may_fallthru, but for the gimple sequence SEQ. */
644 673
645 bool 674 bool
646 gimple_seq_may_fallthru (gimple_seq seq) 675 gimple_seq_may_fallthru (gimple_seq seq)
647 { 676 {
648 return gimple_stmt_may_fallthru (gimple_seq_last_stmt (seq)); 677 return gimple_stmt_may_fallthru (gimple_seq_last_nondebug_stmt (seq));
649 } 678 }
650 679
651 680
652 /* Lower a GIMPLE_RETURN GSI. DATA is passed through the recursion. */ 681 /* Lower a GIMPLE_RETURN GSI. DATA is passed through the recursion. */
653 682