From: Mark Mitchell Date: Mon, 31 Mar 2003 21:42:47 +0000 (+0000) Subject: re PR c++/10278 (ICE in parser) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6b6652197a4e4ee17855e36f38a479896264eed2;p=gcc.git re PR c++/10278 (ICE in parser) PR c++/10278 * c-common.c (finish_label_address_expr): Handle the error_mark_node. PR c++/10278 * g++.dg/parse/crash2.C: New test. From-SVN: r65116 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3dcc8be7cb9..948815a0b32 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-03-31 Mark Mitchell + + PR c++/10278 + * c-common.c (finish_label_address_expr): Handle the + error_mark_node. + 2003-03-31 Richard Henderson * real.c (real_identical): Reorg so as to not compare diff --git a/gcc/c-common.c b/gcc/c-common.c index ee4549c61e8..65322df1c8d 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -4212,8 +4212,8 @@ c_add_case_label (cases, cond, low_value, high_value) return case_label; } -/* Finish an expression taking the address of LABEL. Returns an - expression for the address. */ +/* Finish an expression taking the address of LABEL (an + IDENTIFIER_NODE). Returns an expression for the address. */ tree finish_label_address_expr (label) @@ -4229,6 +4229,9 @@ finish_label_address_expr (label) pedwarn ("ISO C forbids taking the address of a label"); } + if (label == error_mark_node) + return error_mark_node; + label = lookup_label (label); if (label == NULL_TREE) result = null_pointer_node; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f0b4bfd447d..ec6a4188df3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-03-31 Mark Mitchell + + PR c++/10278 + * g++.dg/parse/crash2.C: New test. + 2003-03-31 Richard Sandiford * gcc.c-torture/compile/20030331-1.c: New test, moved from... diff --git a/gcc/testsuite/g++.dg/parse/crash2.C b/gcc/testsuite/g++.dg/parse/crash2.C new file mode 100644 index 00000000000..ccf89ccc86e --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/crash2.C @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +int main(void) +{ + char x, y; + if ('A' == x) && ('B' == y)) { } /* { dg-error "" } */ + if (x == 'A') && (y == 'B')) { } /* { dg-error "" } */ +}