This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/30364] [4.1 Regression] Wrong variable ranges due to constant folding
- 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: 24 Aug 2007 16:40:40 -0000
- Subject: [Bug middle-end/30364] [4.1 Regression] Wrong variable ranges due to constant folding
- References: <bug-30364-7904@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #18 from rguenth at gcc dot gnu dot org 2007-08-24 16:40 -------
Maybe - I was just conservative here to not possibly introduce new overflow
with the re-association as elsewhere we may rely on the undefinedness of
overflow.
Another way to fix this particular regression is to disable the decomposing
of &a->v[x - 2147483646] to pointer arithmetic in the C frontend here:
/* 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);
}
like I tried a couple of times.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30364