diff options
Diffstat (limited to 'gcc/gensupport.cc')
-rw-r--r-- | gcc/gensupport.cc | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/gcc/gensupport.cc b/gcc/gensupport.cc index f7164b3..dd920d6 100644 --- a/gcc/gensupport.cc +++ b/gcc/gensupport.cc @@ -894,20 +894,9 @@ convert_syntax (rtx x, file_location loc) if (!expect_char (&templ, '[')) fatal_at (loc, "expecing `[' to begin section list"); - parse_section_layout (loc, &templ, "cons:", tconvec, true); - - /* Check for any duplicate cons entries and sort based on i. */ - for (auto e : tconvec) - { - unsigned idx = e.idx; - if (idx >= convec.size ()) - convec.resize (idx + 1); + skip_spaces (&templ); - if (convec[idx].idx >= 0) - fatal_at (loc, "duplicate cons number found: %d", idx); - convec[idx] = e; - } - tconvec.clear (); + parse_section_layout (loc, &templ, "cons:", tconvec, true); if (*templ != ']') { @@ -951,13 +940,13 @@ convert_syntax (rtx x, file_location loc) new_templ += '\n'; new_templ.append (buffer); /* Parse the constraint list, then the attribute list. */ - if (convec.size () > 0) - parse_section (&templ, convec.size (), alt_no, convec, loc, + if (tconvec.size () > 0) + parse_section (&templ, tconvec.size (), alt_no, tconvec, loc, "constraint"); if (attrvec.size () > 0) { - if (convec.size () > 0 && !expect_char (&templ, ';')) + if (tconvec.size () > 0 && !expect_char (&templ, ';')) fatal_at (loc, "expected `;' to separate constraints " "and attributes in alternative %d", alt_no); @@ -1027,6 +1016,19 @@ convert_syntax (rtx x, file_location loc) ++alt_no; } + /* Check for any duplicate cons entries and sort based on i. */ + for (auto e : tconvec) + { + unsigned idx = e.idx; + if (idx >= convec.size ()) + convec.resize (idx + 1); + + if (convec[idx].idx >= 0) + fatal_at (loc, "duplicate cons number found: %d", idx); + convec[idx] = e; + } + tconvec.clear (); + /* Write the constraints and attributes into their proper places. */ if (convec.size () > 0) add_constraints (x, loc, convec); |