From: Marek Polacek Date: Wed, 20 Jun 2018 15:46:02 +0000 (+0000) Subject: re PR c++/86240 (ice: unexpected expression absu_expr) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e28fadbc0639d60fdf8e3f32fad7020b58bb5d69;p=gcc.git re PR c++/86240 (ice: unexpected expression absu_expr) PR c++/86240 * constexpr.c (cxx_eval_constant_expression): Handle ABSU_EXPR. (fold_simple_1): Likewise. * error.c (dump_expr): Likewise. * g++.dg/pr86240.C: New test. From-SVN: r261809 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 822a18acc2e..72cd388f578 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2018-06-20 Marek Polacek + + PR c++/86240 + * constexpr.c (cxx_eval_constant_expression): Handle ABSU_EXPR. + (fold_simple_1): Likewise. + * error.c (dump_expr): Likewise. + 2018-06-20 Nathan Sidwell PR c++/85634 diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 216eecd4b06..44f3093ab47 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -4412,6 +4412,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t, case FLOAT_EXPR: case NEGATE_EXPR: case ABS_EXPR: + case ABSU_EXPR: case BIT_NOT_EXPR: case TRUTH_NOT_EXPR: case FIXED_CONVERT_EXPR: @@ -5056,6 +5057,7 @@ fold_simple_1 (tree t) return fold_sizeof_expr (t); case ABS_EXPR: + case ABSU_EXPR: case CONJ_EXPR: case REALPART_EXPR: case IMAGPART_EXPR: diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 6a261132afb..b0d8e322e65 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2764,6 +2764,7 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags) case VEC_DELETE_EXPR: case MODOP_EXPR: case ABS_EXPR: + case ABSU_EXPR: case CONJ_EXPR: case VECTOR_CST: case FIXED_CST: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ce89b3348f6..36305cb29fa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-06-20 Marek Polacek + + PR c++/86240 + * g++.dg/pr86240.C: New test. + 2018-06-20 Jakub Jelinek PR debug/86194 diff --git a/gcc/testsuite/g++.dg/pr86240.C b/gcc/testsuite/g++.dg/pr86240.C new file mode 100644 index 00000000000..16ae89cccd1 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr86240.C @@ -0,0 +1,12 @@ +// { dg-do compile } + +extern "C" int abs (int); +struct a { + short b; +} e; +short c; +bool +foo () +{ + return abs(c) >= e.b; +}