diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2018-04-16 08:31:23 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2018-04-16 08:31:23 +0000 |
commit | c814ac9e69218ffd68b042c77829ea590ba6049a (patch) | |
tree | 51e8eb81cf09dafe21406e801f968cad85230089 /gcc/convert.c | |
parent | ef0e80d23cae8d87167ffeab56f5930da1ddf05d (diff) | |
download | gcc-c814ac9e69218ffd68b042c77829ea590ba6049a.zip gcc-c814ac9e69218ffd68b042c77829ea590ba6049a.tar.gz gcc-c814ac9e69218ffd68b042c77829ea590ba6049a.tar.bz2 |
re PR c++/85112 (ICE with invalid constexpr)
2018-04-16 Paolo Carlini <paolo.carlini@oracle.com>
Jason Merrill <jason@redhat.com>
PR c++/85112
* convert.c (convert_to_integer_1): Use direct recursion for
enumeral types and types with a precision less than the number
of bits in their mode.
/testsuite
2018-04-16 Paolo Carlini <paolo.carlini@oracle.com>
Jason Merrill <jason@redhat.com>
PR c++/85112
* g++.dg/cpp0x/pr85112.C: New.
Co-Authored-By: Jason Merrill <jason@redhat.com>
From-SVN: r259397
Diffstat (limited to 'gcc/convert.c')
-rw-r--r-- | gcc/convert.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/convert.c b/gcc/convert.c index 8c8931f..68705f3 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -741,8 +741,10 @@ convert_to_integer_1 (tree type, tree expr, bool dofold) else if (TREE_CODE (type) == ENUMERAL_TYPE || maybe_ne (outprec, GET_MODE_PRECISION (TYPE_MODE (type)))) { - expr = convert (lang_hooks.types.type_for_mode - (TYPE_MODE (type), TYPE_UNSIGNED (type)), expr); + expr + = convert_to_integer_1 (lang_hooks.types.type_for_mode + (TYPE_MODE (type), TYPE_UNSIGNED (type)), + expr, dofold); return maybe_fold_build1_loc (dofold, loc, NOP_EXPR, type, expr); } |