summaryrefslogtreecommitdiff
path: root/gcc/convert.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-28 15:42:24 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-28 15:42:24 +0000
commitfc3df35715336a36e894a10f4f4992234ff26a2b (patch)
tree171abb9dcfe266e6906e8910ab7d2a2a3a72cce0 /gcc/convert.c
parent9dbc39271ded1571c28b2cb7ae486dc3afea50f5 (diff)
downloadgcc-fc3df35715336a36e894a10f4f4992234ff26a2b.tar.gz
* configure.in (--enable-checking): Add fold category.
(ENABLE_FOLD_CHECKING): Define if requested. * configure: Rebuilt. * config.in: Rebuilt. * doc/install.texi: Document it. * fold-const.c: Include md5.h. [ENABLE_FOLD_CHECKING] (fold): Define to fold_1. [ENABLE_FOLD_CHECKING] (fold, fold_checksum_tree, fold_check_failed, print_fold_checksum): New functions. * fold-const.c (fold): Never modify argument passed to fold, instead change a copy and return it. * convert.c (convert_to_integer): Likewise. testsuite/ * gcc.c-torture/compile/20030725-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69886 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/convert.c')
-rw-r--r--gcc/convert.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/convert.c b/gcc/convert.c
index fc001b6e74e..5bab1c19d35 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -320,6 +320,7 @@ convert_to_integer (tree type, tree expr)
if (TREE_CODE_CLASS (ex_form) == '<')
{
+ expr = copy_node (expr);
TREE_TYPE (expr) = type;
return expr;
}
@@ -328,6 +329,7 @@ convert_to_integer (tree type, tree expr)
|| ex_form == TRUTH_OR_EXPR || ex_form == TRUTH_ORIF_EXPR
|| ex_form == TRUTH_XOR_EXPR)
{
+ expr = copy_node (expr);
TREE_OPERAND (expr, 0) = convert (type, TREE_OPERAND (expr, 0));
TREE_OPERAND (expr, 1) = convert (type, TREE_OPERAND (expr, 1));
TREE_TYPE (expr) = type;
@@ -336,6 +338,7 @@ convert_to_integer (tree type, tree expr)
else if (ex_form == TRUTH_NOT_EXPR)
{
+ expr = copy_node (expr);
TREE_OPERAND (expr, 0) = convert (type, TREE_OPERAND (expr, 0));
TREE_TYPE (expr) = type;
return expr;