From: Tom Tromey Date: Tue, 11 Jun 2002 22:36:53 +0000 (+0000) Subject: For PR java/6520: X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0797e4720f4fa94605f883a60027956600f92908;p=gcc.git For PR java/6520: * fold-const.c (fold_convert): Don't modify existing tree's type. From-SVN: r54529 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bfa8e954ee8..8288483e5c4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-06-11 Tom Tromey + + For PR java/6520: + * fold-const.c (fold_convert): Don't modify existing tree's type. + 2002-06-11 Geoffrey Keating * config/rs6000/ppc-asm.h: Remove some Windows NT leftovers. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index db415649f0f..1c29ad57fbf 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; }