comparison gcc/tree.c @ 20:9de9dad105d4

update gcc from 4.4.0 to 4.4.1.
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Thu, 24 Sep 2009 14:29:28 +0900
parents caeb520cebed 58ad6c70ea60
children 326d9e06c2e3
comparison
equal deleted inserted replaced
17:1572d6553fb6 20:9de9dad105d4
1608 1608
1609 return (high != 0 ? HOST_BITS_PER_WIDE_INT + floor_log2 (high) 1609 return (high != 0 ? HOST_BITS_PER_WIDE_INT + floor_log2 (high)
1610 : floor_log2 (low)); 1610 : floor_log2 (low));
1611 } 1611 }
1612 1612
1613 /* Return 1 if EXPR is the real constant zero. */ 1613 /* Return 1 if EXPR is the real constant zero. Trailing zeroes matter for
1614 decimal float constants, so don't return 1 for them. */
1614 1615
1615 int 1616 int
1616 real_zerop (const_tree expr) 1617 real_zerop (const_tree expr)
1617 { 1618 {
1618 STRIP_NOPS (expr); 1619 STRIP_NOPS (expr);
1619 1620
1620 return ((TREE_CODE (expr) == REAL_CST 1621 return ((TREE_CODE (expr) == REAL_CST
1621 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst0)) 1622 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst0)
1623 && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr)))))
1622 || (TREE_CODE (expr) == COMPLEX_CST 1624 || (TREE_CODE (expr) == COMPLEX_CST
1623 && real_zerop (TREE_REALPART (expr)) 1625 && real_zerop (TREE_REALPART (expr))
1624 && real_zerop (TREE_IMAGPART (expr)))); 1626 && real_zerop (TREE_IMAGPART (expr))));
1625 } 1627 }
1626 1628
1627 /* Return 1 if EXPR is the real constant one in real or complex form. */ 1629 /* Return 1 if EXPR is the real constant one in real or complex form.
1630 Trailing zeroes matter for decimal float constants, so don't return
1631 1 for them. */
1628 1632
1629 int 1633 int
1630 real_onep (const_tree expr) 1634 real_onep (const_tree expr)
1631 { 1635 {
1632 STRIP_NOPS (expr); 1636 STRIP_NOPS (expr);
1633 1637
1634 return ((TREE_CODE (expr) == REAL_CST 1638 return ((TREE_CODE (expr) == REAL_CST
1635 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst1)) 1639 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst1)
1640 && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr)))))
1636 || (TREE_CODE (expr) == COMPLEX_CST 1641 || (TREE_CODE (expr) == COMPLEX_CST
1637 && real_onep (TREE_REALPART (expr)) 1642 && real_onep (TREE_REALPART (expr))
1638 && real_zerop (TREE_IMAGPART (expr)))); 1643 && real_zerop (TREE_IMAGPART (expr))));
1639 } 1644 }
1640 1645
1641 /* Return 1 if EXPR is the real constant two. */ 1646 /* Return 1 if EXPR is the real constant two. Trailing zeroes matter
1647 for decimal float constants, so don't return 1 for them. */
1642 1648
1643 int 1649 int
1644 real_twop (const_tree expr) 1650 real_twop (const_tree expr)
1645 { 1651 {
1646 STRIP_NOPS (expr); 1652 STRIP_NOPS (expr);
1647 1653
1648 return ((TREE_CODE (expr) == REAL_CST 1654 return ((TREE_CODE (expr) == REAL_CST
1649 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst2)) 1655 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst2)
1656 && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr)))))
1650 || (TREE_CODE (expr) == COMPLEX_CST 1657 || (TREE_CODE (expr) == COMPLEX_CST
1651 && real_twop (TREE_REALPART (expr)) 1658 && real_twop (TREE_REALPART (expr))
1652 && real_zerop (TREE_IMAGPART (expr)))); 1659 && real_zerop (TREE_IMAGPART (expr))));
1653 } 1660 }
1654 1661
1655 /* Return 1 if EXPR is the real constant minus one. */ 1662 /* Return 1 if EXPR is the real constant minus one. Trailing zeroes
1663 matter for decimal float constants, so don't return 1 for them. */
1656 1664
1657 int 1665 int
1658 real_minus_onep (const_tree expr) 1666 real_minus_onep (const_tree expr)
1659 { 1667 {
1660 STRIP_NOPS (expr); 1668 STRIP_NOPS (expr);
1661 1669
1662 return ((TREE_CODE (expr) == REAL_CST 1670 return ((TREE_CODE (expr) == REAL_CST
1663 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconstm1)) 1671 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconstm1)
1672 && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr)))))
1664 || (TREE_CODE (expr) == COMPLEX_CST 1673 || (TREE_CODE (expr) == COMPLEX_CST
1665 && real_minus_onep (TREE_REALPART (expr)) 1674 && real_minus_onep (TREE_REALPART (expr))
1666 && real_zerop (TREE_IMAGPART (expr)))); 1675 && real_zerop (TREE_IMAGPART (expr))));
1667 } 1676 }
1668 1677
5975 if (new_reversed) 5984 if (new_reversed)
5976 TREE_CHAIN (new_args) = void_list_node; 5985 TREE_CHAIN (new_args) = void_list_node;
5977 else 5986 else
5978 new_reversed = void_list_node; 5987 new_reversed = void_list_node;
5979 } 5988 }
5980 gcc_assert (new_reversed);
5981 5989
5982 /* Use copy_node to preserve as much as possible from original type 5990 /* Use copy_node to preserve as much as possible from original type
5983 (debug info, attribute lists etc.) 5991 (debug info, attribute lists etc.)
5984 Exception is METHOD_TYPEs must have THIS argument. 5992 Exception is METHOD_TYPEs must have THIS argument.
5985 When we are asked to remove it, we need to build new FUNCTION_TYPE 5993 When we are asked to remove it, we need to build new FUNCTION_TYPE
9102 function, return the location of the original call expression. */ 9110 function, return the location of the original call expression. */
9103 9111
9104 location_t 9112 location_t
9105 tree_nonartificial_location (tree exp) 9113 tree_nonartificial_location (tree exp)
9106 { 9114 {
9107 tree block = TREE_BLOCK (exp); 9115 location_t *loc = block_nonartificial_location (TREE_BLOCK (exp));
9108 9116
9109 while (block 9117 if (loc)
9110 && TREE_CODE (block) == BLOCK 9118 return *loc;
9111 && BLOCK_ABSTRACT_ORIGIN (block)) 9119 else
9112 { 9120 return EXPR_LOCATION (exp);
9113 tree ao = BLOCK_ABSTRACT_ORIGIN (block);
9114
9115 do
9116 {
9117 if (TREE_CODE (ao) == FUNCTION_DECL
9118 && DECL_DECLARED_INLINE_P (ao)
9119 && lookup_attribute ("artificial", DECL_ATTRIBUTES (ao)))
9120 return BLOCK_SOURCE_LOCATION (block);
9121 else if (TREE_CODE (ao) == BLOCK
9122 && BLOCK_SUPERCONTEXT (ao) != ao)
9123 ao = BLOCK_SUPERCONTEXT (ao);
9124 else
9125 break;
9126 }
9127 while (ao);
9128
9129 block = BLOCK_SUPERCONTEXT (block);
9130 }
9131
9132 return EXPR_LOCATION (exp);
9133 } 9121 }
9134 9122
9135 9123
9136 /* These are the hash table functions for the hash table of OPTIMIZATION_NODEq 9124 /* These are the hash table functions for the hash table of OPTIMIZATION_NODEq
9137 nodes. */ 9125 nodes. */