------- Comment #6 from rguenth at gcc dot gnu dot org  2008-01-03 16:23 -------
I will test the following

bool
is_gimple_min_invariant (const_tree t)
{
  switch (TREE_CODE (t))
    {
    case ADDR_EXPR:
      /* We do not allow arbitrary invariant expressions as gimple
         such as &a[1 - &b], but only allow constant array indices
         inside the otherwise TREE_INVARIANT expression.  */
      if (!TREE_INVARIANT (t))
        return false;
      t = TREE_OPERAND (t, 0);
      while (handled_component_p (t))
        {
          if ((TREE_CODE (t) == ARRAY_REF
               || TREE_CODE (t) == ARRAY_RANGE_REF)
              && TREE_CODE (TREE_OPERAND (t, 1)) != INTEGER_CST)
            return false;
          t = TREE_OPERAND (t, 0);
        }
      return true;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34029

Reply via email to