summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-05 00:03:35 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-05 00:03:35 +0000
commit8b3ab5d04e5fbbbf786ef7c03998cb0340066202 (patch)
treea62296d6ede0940d39347d1943a66967c97c7ff4 /gcc/fold-const.c
parent174fcc6167dc041dd6b46377d398bf482a7f6626 (diff)
downloadgcc-8b3ab5d04e5fbbbf786ef7c03998cb0340066202.tar.gz
* fold-const.c (fold): When folding a CONJ_EXPR of a COMPLEX_CST,
use TREE_REALPART and TREE_IMAGPART instead of TREE_OPERAND. testsuite: * gcc.c-torture/compile/20001222-1.x: Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38696 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index b02fdaa33e2..9516d0d4bee 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1,6 +1,6 @@
/* Fold a constant sub-tree into a single node for C-compiler
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -5278,8 +5278,8 @@ fold (expr)
TREE_OPERAND (arg0, 0),
negate_expr (TREE_OPERAND (arg0, 1)));
else if (TREE_CODE (arg0) == COMPLEX_CST)
- return build_complex (type, TREE_OPERAND (arg0, 0),
- negate_expr (TREE_OPERAND (arg0, 1)));
+ return build_complex (type, TREE_REALPART (arg0),
+ negate_expr (TREE_IMAGPART (arg0)));
else if (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR)
return fold (build (TREE_CODE (arg0), type,
fold (build1 (CONJ_EXPR, type,