Commit a2d53b28 by Richard Henderson Committed by Jeff Law

stor-layout.c (layout_type): Do upper - lower in the native type, so as to…

stor-layout.c (layout_type): Do upper - lower in the native type, so as to properly handle negative indices.

        * stor-layout.c (layout_type): Do upper - lower in the native type,
        so as to properly handle negative indices.

From-SVN: r17846
parent 381127e8
Wed Feb 11 01:44:13 1998 Richard Henderson <rth@cygnus.com>
* stor-layout.c (layout_type): Do upper - lower in the native type,
so as to properly handle negative indices.
Wed Feb 11 01:35:55 1998 Robert Lipe <robertl@dgii.com> Wed Feb 11 01:35:55 1998 Robert Lipe <robertl@dgii.com>
* except.c (start_dynamic_cleanup): Remove unused variable 'dhc'. * except.c (start_dynamic_cleanup): Remove unused variable 'dhc'.
......
...@@ -786,8 +786,11 @@ layout_type (type) ...@@ -786,8 +786,11 @@ layout_type (type)
lb, 0)) lb, 0))
ub = TREE_OPERAND (ub, 0); ub = TREE_OPERAND (ub, 0);
/* The initial subtraction should happen in the original type so
that (possible) negative values are handled appropriately. */
length = size_binop (PLUS_EXPR, size_one_node, length = size_binop (PLUS_EXPR, size_one_node,
size_binop (MINUS_EXPR, ub, lb)); fold (build (MINUS_EXPR, TREE_TYPE (lb),
ub, lb)));
/* If neither bound is a constant and sizetype is signed, make /* If neither bound is a constant and sizetype is signed, make
sure the size is never negative. We should really do this sure the size is never negative. We should really do this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment