OSDN Git Service

* hwint.c: New. Extracted from toplev.c.
[pf3gnuchains/gcc-fork.git] / gcc / tree-dfa.c
index 10fd41e..05a682b 100644 (file)
@@ -23,7 +23,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "system.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "toplev.h"
 #include "hashtab.h"
 #include "pointer-set.h"
 #include "tree.h"
@@ -880,18 +879,19 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
 
        case TARGET_MEM_REF:
          /* Hand back the decl for MEM[&decl, off].  */
-         if (TMR_SYMBOL (exp))
+         if (TREE_CODE (TMR_BASE (exp)) == ADDR_EXPR)
            {
-             /* Via the variable index we can reach the whole object.  */
-             if (TMR_INDEX (exp))
+             /* Via the variable index or index2 we can reach the
+                whole object.  */
+             if (TMR_INDEX (exp) || TMR_INDEX2 (exp))
                {
-                 exp = TMR_SYMBOL (exp);
+                 exp = TREE_OPERAND (TMR_BASE (exp), 0);
                  bit_offset = 0;
                  maxsize = -1;
                  goto done;
                }
              if (integer_zerop (TMR_OFFSET (exp)))
-               exp = TMR_SYMBOL (exp);
+               exp = TREE_OPERAND (TMR_BASE (exp), 0);
              else
                {
                  double_int off = mem_ref_offset (exp);
@@ -903,7 +903,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
                  if (double_int_fits_in_shwi_p (off))
                    {
                      bit_offset = double_int_to_shwi (off);
-                     exp = TMR_SYMBOL (exp);
+                     exp = TREE_OPERAND (TMR_BASE (exp), 0);
                    }
                }
            }
@@ -1043,9 +1043,9 @@ get_addr_base_and_unit_offset (tree exp, HOST_WIDE_INT *poffset)
 
        case TARGET_MEM_REF:
          /* Hand back the decl for MEM[&decl, off].  */
-         if (TMR_SYMBOL (exp))
+         if (TREE_CODE (TMR_BASE (exp)) == ADDR_EXPR)
            {
-             if (TMR_SYMBOL (exp))
+             if (TMR_INDEX (exp) || TMR_INDEX2 (exp))
                return NULL_TREE;
              if (!integer_zerop (TMR_OFFSET (exp)))
                {
@@ -1053,7 +1053,7 @@ get_addr_base_and_unit_offset (tree exp, HOST_WIDE_INT *poffset)
                  gcc_assert (off.high == -1 || off.high == 0);
                  byte_offset += double_int_to_shwi (off);
                }
-             exp = TMR_SYMBOL (exp);
+             exp = TREE_OPERAND (TMR_BASE (exp), 0);
            }
          goto done;