diff options
author | Richard Biener <rguenther@suse.de> | 2019-10-28 12:25:09 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-10-28 12:25:09 +0000 |
commit | cb73e4e734e2a3fb8034137806a7c676b5d5f366 (patch) | |
tree | 498c8f04bd2301c8292f4ae411de0918f622fd63 /gcc/c | |
parent | bd7a559a0f5893c9881bdcc45bdc6a3586980dea (diff) | |
download | gcc-cb73e4e734e2a3fb8034137806a7c676b5d5f366.zip gcc-cb73e4e734e2a3fb8034137806a7c676b5d5f366.tar.gz gcc-cb73e4e734e2a3fb8034137806a7c676b5d5f366.tar.bz2 |
re PR c/92249 (ICE in c_parser_gimple_compound_statement w/ GIMPLE testcases)
2019-10-28 Richard Biener <rguenther@suse.de>
PR c/92249
* gimple-parser.c (c_parser_parse_gimple_body): Make
current_bb the entry block initially to easier recover
from errors.
(c_parser_gimple_compound_statement): Adjust.
From-SVN: r277512
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/c/gimple-parser.c | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index e8518f2..4b051188 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,11 @@ +2019-10-28 Richard Biener <rguenther@suse.de> + + PR c/92249 + * gimple-parser.c (c_parser_parse_gimple_body): Make + current_bb the entry block initially to easier recover + from errors. + (c_parser_gimple_compound_statement): Adjust. + 2019-10-24 Jakub Jelinek <jakub@redhat.com> * c-parser.c (c_finish_omp_declare_variant): Use diff --git a/gcc/c/gimple-parser.c b/gcc/c/gimple-parser.c index 3f57599..d8588d4 100644 --- a/gcc/c/gimple-parser.c +++ b/gcc/c/gimple-parser.c @@ -235,6 +235,7 @@ c_parser_parse_gimple_body (c_parser *cparser, char *gimple_pass, /* We have at least cdil_gimple_cfg. */ gimple_register_cfg_hooks (); init_empty_tree_cfg (); + parser.current_bb = ENTRY_BLOCK_PTR_FOR_FN (cfun); /* Initialize the bare loop structure - we are going to only mark headers and leave the rest to fixup. */ set_loops_for_fn (cfun, ggc_cleared_alloc<struct loops> ()); @@ -594,7 +595,7 @@ c_parser_gimple_compound_statement (gimple_parser &parser, gimple_seq *seq) if (last_basic_block_for_fn (cfun) <= index) last_basic_block_for_fn (cfun) = index + 1; n_basic_blocks_for_fn (cfun)++; - if (!parser.current_bb) + if (parser.current_bb->index == ENTRY_BLOCK) parser.push_edge (ENTRY_BLOCK, bb->index, EDGE_FALLTHRU, profile_probability::always ()); |