From b1a6f8db645316b579bf6d42fdfadaea03e44a03 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 15 Jan 2003 13:43:35 +0100 Subject: re PR rtl-optimization/9258 (ICE in compensate_edge, at reg-stack.c:2589) PR f/9258 * global.c (struct allocno): Add no_stack_reg. (global_conflicts): Set no_stack_reg. (find_reg): Use it. * convert.c (convert_to_real): Fold - and abs only when profitable. * fold-const.c (fold): Fold truncates in - and abs. * gcc.c-torture/compile/20030115-1.c: New test. * gcc.dg/i386-fpcvt-1.c: New test. * gcc.dg/i386-fpcvt-2.c: New test. From-SVN: r61329 --- gcc/convert.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/convert.c') diff --git a/gcc/convert.c b/gcc/convert.c index 26fb676..009675f 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -229,9 +229,11 @@ convert_to_real (type, expr) /* convert (float)-x into -(float)x. This is always safe. */ case ABS_EXPR: case NEGATE_EXPR: - return build1 (TREE_CODE (expr), type, - fold (convert_to_real (type, - TREE_OPERAND (expr, 0)))); + if (TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (expr))) + return build1 (TREE_CODE (expr), type, + fold (convert_to_real (type, + TREE_OPERAND (expr, 0)))); + break; /* convert (outertype)((innertype0)a+(innertype1)b) into ((newtype)a+(newtype)b) where newtype is the widest mode from all of these. */ -- cgit v1.1