diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-11-22 17:40:46 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-11-22 17:40:46 -0500 |
commit | e33745253e33bdb3cfdaa0608bf8d1f9f6422abf (patch) | |
tree | aa402aeb6bedddef8501f369de7df93f2725a03a /gcc | |
parent | dce39da65769c10426ca404119e346371963a190 (diff) | |
download | gcc-e33745253e33bdb3cfdaa0608bf8d1f9f6422abf.zip gcc-e33745253e33bdb3cfdaa0608bf8d1f9f6422abf.tar.gz gcc-e33745253e33bdb3cfdaa0608bf8d1f9f6422abf.tar.bz2 |
(fold_convert): Don't fold conversion if it would produce constant
larger than we can support.
From-SVN: r8551
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fold-const.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index d286f27..9b1a7b4 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -1404,6 +1404,11 @@ fold_convert (t, arg1) { if (TREE_CODE (arg1) == INTEGER_CST) { + /* If we would build a constant wider than GCC supports, + leave the conversion unfolded. */ + if (TYPE_PRECISION (type) > 2 * HOST_BITS_PER_WIDE_INT) + return t; + /* Given an integer constant, make new constant with new type, appropriately sign-extended or truncated. */ t = build_int_2 (TREE_INT_CST_LOW (arg1), |