Mercurial > hg > CbC > CbC_gcc
comparison gcc/tree.c @ 19:58ad6c70ea60
update gcc from 4.4.0 to 4.4.1.
author | kent@firefly.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Thu, 24 Sep 2009 13:21:57 +0900 |
parents | a06113de4d67 |
children | 9de9dad105d4 77e2b8dfacca |
comparison
equal
deleted
inserted
replaced
18:33936f7f2835 | 19:58ad6c70ea60 |
---|---|
1604 | 1604 |
1605 return (high != 0 ? HOST_BITS_PER_WIDE_INT + floor_log2 (high) | 1605 return (high != 0 ? HOST_BITS_PER_WIDE_INT + floor_log2 (high) |
1606 : floor_log2 (low)); | 1606 : floor_log2 (low)); |
1607 } | 1607 } |
1608 | 1608 |
1609 /* Return 1 if EXPR is the real constant zero. */ | 1609 /* Return 1 if EXPR is the real constant zero. Trailing zeroes matter for |
1610 decimal float constants, so don't return 1 for them. */ | |
1610 | 1611 |
1611 int | 1612 int |
1612 real_zerop (const_tree expr) | 1613 real_zerop (const_tree expr) |
1613 { | 1614 { |
1614 STRIP_NOPS (expr); | 1615 STRIP_NOPS (expr); |
1615 | 1616 |
1616 return ((TREE_CODE (expr) == REAL_CST | 1617 return ((TREE_CODE (expr) == REAL_CST |
1617 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst0)) | 1618 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst0) |
1619 && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))))) | |
1618 || (TREE_CODE (expr) == COMPLEX_CST | 1620 || (TREE_CODE (expr) == COMPLEX_CST |
1619 && real_zerop (TREE_REALPART (expr)) | 1621 && real_zerop (TREE_REALPART (expr)) |
1620 && real_zerop (TREE_IMAGPART (expr)))); | 1622 && real_zerop (TREE_IMAGPART (expr)))); |
1621 } | 1623 } |
1622 | 1624 |
1623 /* Return 1 if EXPR is the real constant one in real or complex form. */ | 1625 /* Return 1 if EXPR is the real constant one in real or complex form. |
1626 Trailing zeroes matter for decimal float constants, so don't return | |
1627 1 for them. */ | |
1624 | 1628 |
1625 int | 1629 int |
1626 real_onep (const_tree expr) | 1630 real_onep (const_tree expr) |
1627 { | 1631 { |
1628 STRIP_NOPS (expr); | 1632 STRIP_NOPS (expr); |
1629 | 1633 |
1630 return ((TREE_CODE (expr) == REAL_CST | 1634 return ((TREE_CODE (expr) == REAL_CST |
1631 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst1)) | 1635 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst1) |
1636 && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))))) | |
1632 || (TREE_CODE (expr) == COMPLEX_CST | 1637 || (TREE_CODE (expr) == COMPLEX_CST |
1633 && real_onep (TREE_REALPART (expr)) | 1638 && real_onep (TREE_REALPART (expr)) |
1634 && real_zerop (TREE_IMAGPART (expr)))); | 1639 && real_zerop (TREE_IMAGPART (expr)))); |
1635 } | 1640 } |
1636 | 1641 |
1637 /* Return 1 if EXPR is the real constant two. */ | 1642 /* Return 1 if EXPR is the real constant two. Trailing zeroes matter |
1643 for decimal float constants, so don't return 1 for them. */ | |
1638 | 1644 |
1639 int | 1645 int |
1640 real_twop (const_tree expr) | 1646 real_twop (const_tree expr) |
1641 { | 1647 { |
1642 STRIP_NOPS (expr); | 1648 STRIP_NOPS (expr); |
1643 | 1649 |
1644 return ((TREE_CODE (expr) == REAL_CST | 1650 return ((TREE_CODE (expr) == REAL_CST |
1645 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst2)) | 1651 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconst2) |
1652 && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))))) | |
1646 || (TREE_CODE (expr) == COMPLEX_CST | 1653 || (TREE_CODE (expr) == COMPLEX_CST |
1647 && real_twop (TREE_REALPART (expr)) | 1654 && real_twop (TREE_REALPART (expr)) |
1648 && real_zerop (TREE_IMAGPART (expr)))); | 1655 && real_zerop (TREE_IMAGPART (expr)))); |
1649 } | 1656 } |
1650 | 1657 |
1651 /* Return 1 if EXPR is the real constant minus one. */ | 1658 /* Return 1 if EXPR is the real constant minus one. Trailing zeroes |
1659 matter for decimal float constants, so don't return 1 for them. */ | |
1652 | 1660 |
1653 int | 1661 int |
1654 real_minus_onep (const_tree expr) | 1662 real_minus_onep (const_tree expr) |
1655 { | 1663 { |
1656 STRIP_NOPS (expr); | 1664 STRIP_NOPS (expr); |
1657 | 1665 |
1658 return ((TREE_CODE (expr) == REAL_CST | 1666 return ((TREE_CODE (expr) == REAL_CST |
1659 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconstm1)) | 1667 && REAL_VALUES_EQUAL (TREE_REAL_CST (expr), dconstm1) |
1668 && !(DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (expr))))) | |
1660 || (TREE_CODE (expr) == COMPLEX_CST | 1669 || (TREE_CODE (expr) == COMPLEX_CST |
1661 && real_minus_onep (TREE_REALPART (expr)) | 1670 && real_minus_onep (TREE_REALPART (expr)) |
1662 && real_zerop (TREE_IMAGPART (expr)))); | 1671 && real_zerop (TREE_IMAGPART (expr)))); |
1663 } | 1672 } |
1664 | 1673 |
5949 if (new_reversed) | 5958 if (new_reversed) |
5950 TREE_CHAIN (new_args) = void_list_node; | 5959 TREE_CHAIN (new_args) = void_list_node; |
5951 else | 5960 else |
5952 new_reversed = void_list_node; | 5961 new_reversed = void_list_node; |
5953 } | 5962 } |
5954 gcc_assert (new_reversed); | |
5955 | 5963 |
5956 /* Use copy_node to preserve as much as possible from original type | 5964 /* Use copy_node to preserve as much as possible from original type |
5957 (debug info, attribute lists etc.) | 5965 (debug info, attribute lists etc.) |
5958 Exception is METHOD_TYPEs must have THIS argument. | 5966 Exception is METHOD_TYPEs must have THIS argument. |
5959 When we are asked to remove it, we need to build new FUNCTION_TYPE | 5967 When we are asked to remove it, we need to build new FUNCTION_TYPE |
9076 function, return the location of the original call expression. */ | 9084 function, return the location of the original call expression. */ |
9077 | 9085 |
9078 location_t | 9086 location_t |
9079 tree_nonartificial_location (tree exp) | 9087 tree_nonartificial_location (tree exp) |
9080 { | 9088 { |
9081 tree block = TREE_BLOCK (exp); | 9089 location_t *loc = block_nonartificial_location (TREE_BLOCK (exp)); |
9082 | 9090 |
9083 while (block | 9091 if (loc) |
9084 && TREE_CODE (block) == BLOCK | 9092 return *loc; |
9085 && BLOCK_ABSTRACT_ORIGIN (block)) | 9093 else |
9086 { | 9094 return EXPR_LOCATION (exp); |
9087 tree ao = BLOCK_ABSTRACT_ORIGIN (block); | |
9088 | |
9089 do | |
9090 { | |
9091 if (TREE_CODE (ao) == FUNCTION_DECL | |
9092 && DECL_DECLARED_INLINE_P (ao) | |
9093 && lookup_attribute ("artificial", DECL_ATTRIBUTES (ao))) | |
9094 return BLOCK_SOURCE_LOCATION (block); | |
9095 else if (TREE_CODE (ao) == BLOCK | |
9096 && BLOCK_SUPERCONTEXT (ao) != ao) | |
9097 ao = BLOCK_SUPERCONTEXT (ao); | |
9098 else | |
9099 break; | |
9100 } | |
9101 while (ao); | |
9102 | |
9103 block = BLOCK_SUPERCONTEXT (block); | |
9104 } | |
9105 | |
9106 return EXPR_LOCATION (exp); | |
9107 } | 9095 } |
9108 | 9096 |
9109 | 9097 |
9110 /* These are the hash table functions for the hash table of OPTIMIZATION_NODEq | 9098 /* These are the hash table functions for the hash table of OPTIMIZATION_NODEq |
9111 nodes. */ | 9099 nodes. */ |