This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/30636] [4.3 Regression] incorrect array bounds warning on multi-dimensional arrays



------- Comment #5 from rguenth at gcc dot gnu dot org  2007-01-31 13:38 -------
Only C++ warns for the testcase, we get C to warn as well if we remove

      /* For &x[y], return x+y */
      if (TREE_CODE (arg) == ARRAY_REF)
        {
          tree op0 = TREE_OPERAND (arg, 0);
          if (!c_mark_addressable (op0))
            return error_mark_node;
          return build_binary_op (PLUS_EXPR,
                                  (TREE_CODE (TREE_TYPE (op0)) == ARRAY_TYPE
                                   ? array_to_pointer_conversion (op0)
                                   : op0),
                                  TREE_OPERAND (arg, 1), 1);
        }

from c-typeck.c


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]