aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-06-11 22:36:53 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-06-11 22:36:53 +0000
commit0797e4720f4fa94605f883a60027956600f92908 (patch)
tree0d829e307efe5f946ec619567dc41cdde4a40996 /gcc
parentf288d4aa2c9dad621c6e5aed392b2a9fd0bda958 (diff)
downloadgcc-0797e4720f4fa94605f883a60027956600f92908.zip
gcc-0797e4720f4fa94605f883a60027956600f92908.tar.gz
gcc-0797e4720f4fa94605f883a60027956600f92908.tar.bz2
For PR java/6520:
* fold-const.c (fold_convert): Don't modify existing tree's type. From-SVN: r54529
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/fold-const.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bfa8e95..8288483 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-06-11 Tom Tromey <tromey@redhat.com>
+
+ For PR java/6520:
+ * fold-const.c (fold_convert): Don't modify existing tree's type.
+
2002-06-11 Geoffrey Keating <geoffk@redhat.com>
* config/rs6000/ppc-asm.h: Remove some Windows NT leftovers.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index db41564..1c29ad5 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1596,8 +1596,10 @@ fold_convert (t, arg1)
{
if (REAL_VALUE_ISNAN (TREE_REAL_CST (arg1)))
{
- t = arg1;
- TREE_TYPE (arg1) = type;
+ /* We make a copy of ARG1 so that we don't modify an
+ existing constant tree. */
+ t = copy_node (arg1);
+ TREE_TYPE (t) = type;
return t;
}