This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/30636] [4.3 Regression] incorrect array bounds warning on multi-dimensional arrays
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Jan 2007 13:38:02 -0000
- Subject: [Bug middle-end/30636] [4.3 Regression] incorrect array bounds warning on multi-dimensional arrays
- References: <bug-30636-602@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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