aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>1999-03-24 22:48:37 +0000
committerJeff Law <law@gcc.gnu.org>1999-03-24 15:48:37 -0700
commitcc33944a7a4ad12e11ce9e278f028be948189575 (patch)
tree66590433696f241a41a1a8d234c661101ea3f66b /gcc/fold-const.c
parent79d868e8879f926db2cdbd314e39d85bd2b5f844 (diff)
downloadgcc-cc33944a7a4ad12e11ce9e278f028be948189575.zip
gcc-cc33944a7a4ad12e11ce9e278f028be948189575.tar.gz
gcc-cc33944a7a4ad12e11ce9e278f028be948189575.tar.bz2
fold-const.c (make_range): If orig_type is unset, set it as soon as we know the type.
* fold-const.c (make_range): If orig_type is unset, set it as soon as we know the type. Remove now unnecessary set of orig_type for conversions. Co-Authored-By: Jeffrey A Law <law@cygnus.com> From-SVN: r25959
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 4faac0c..1e7bd19 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -3140,6 +3140,11 @@ make_range (exp, pin_p, plow, phigh)
arg1 = TREE_OPERAND (exp, 1);
}
+ /* Set ORIG_TYPE as soon as TYPE is non-null so that we do not
+ lose a cast by accident. */
+ if (type != NULL_TREE && orig_type == NULL_TREE)
+ orig_type = type;
+
switch (code)
{
case TRUTH_NOT_EXPR:
@@ -3258,8 +3263,6 @@ make_range (exp, pin_p, plow, phigh)
continue;
case NOP_EXPR: case NON_LVALUE_EXPR: case CONVERT_EXPR:
- if (orig_type == NULL_TREE)
- orig_type = type;
if (TYPE_PRECISION (type) > TYPE_PRECISION (orig_type))
break;