This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
egcs-19980531/gcc.c-torture/execute/950511-1.c failure found!
- To: Horst von Brand <vonbrand at sleipnir dot valparaiso dot cl>
- Subject: egcs-19980531/gcc.c-torture/execute/950511-1.c failure found!
- From: "Michael L. Galbraith" <mikeg at weiden dot de>
- Date: Sat, 6 Jun 1998 07:53:45 +0200 (MET DST)
- cc: egcs-bugs at cygnus dot com
Hi Horst,
Thanks for confirming the problem.. it did help.
Using my most effective gcc troubleshooting technique.. patch -R and
compile a LOT <g>, I was able to locate the source of the problem. It
happened in egcs-19980525 in the following segment.
Cheers,
-Mike
diff -Nrc3p egcs-19980517/gcc/expr.c egcs-19980525/gcc/expr.c
*** egcs-19980517/gcc/expr.c Fri May 15 10:32:40 1998
--- egcs-19980525/gcc/expr.c Fri May 22 16:03:25 1998
*************** static void preexpand_calls PROTO((tree)
*** 188,194 ****
static void do_jump_by_parts_greater PROTO((tree, int, rtx, rtx));
void do_jump_by_parts_greater_rtx PROTO((enum machine_mode, int, rtx, rtx, rtx, rtx));
static void do_jump_by_parts_equality PROTO((tree, rtx, rtx));
- void do_jump_by_parts_equality_rtx PROTO((rtx, rtx, rtx));
static void do_jump_for_compare PROTO((rtx, rtx, rtx));
static rtx compare PROTO((tree, enum rtx_code, enum rtx_code));
static rtx do_store_flag PROTO((tree, rtx, enum machine_mode, int));
--- 188,193 ----
*************** expand_assignment (to, from, want_value,
*** 2908,2913 ****
--- 2907,2922 ----
if (GET_CODE (to_rtx) != MEM)
abort ();
+
+ if (GET_MODE (offset_rtx) != ptr_mode)
+ {
+ #ifdef POINTERS_EXTEND_UNSIGNED
+ offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 1);
+ #else
+ offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
+ #endif
+ }
+
to_rtx = change_address (to_rtx, VOIDmode,
gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0),
force_reg (ptr_mode, offset_rtx)));
*************** store_expr (exp, target, want_value)
*** 3308,3314 ****
{
target = protect_from_queue (target, 1);
if (GET_MODE (temp) != GET_MODE (target)
! && GET_MODE (temp) != VOIDmode)
{
int unsignedp = TREE_UNSIGNED (TREE_TYPE (exp));
if (dont_return_target)
--- 3317,3323 ----
{
target = protect_from_queue (target, 1);
if (GET_MODE (temp) != GET_MODE (target)
! && GET_MODE (target) != VOIDmode)
{
int unsignedp = TREE_UNSIGNED (TREE_TYPE (exp));
if (dont_return_target)
*************** store_constructor (exp, target, cleared)
*** 3674,3679 ****
--- 3683,3697 ----
if (GET_CODE (to_rtx) != MEM)
abort ();
+ if (GET_MODE (offset_rtx) != ptr_mode)
+ {
+ #ifdef POINTERS_EXTEND_UNSIGNED
+ offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 1);
+ #else
+ offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
+ #endif
+ }
+
to_rtx
= change_address (to_rtx, VOIDmode,
gen_rtx_PLUS (ptr_mode, XEXP (to_rtx, 0),
*************** get_inner_reference (exp, pbitsize, pbit
*** 4374,4379 ****
--- 4392,4398 ----
tree low_bound
= domain ? TYPE_MIN_VALUE (domain) : integer_zero_node;
tree index_type = TREE_TYPE (index);
+ tree xindex;
if (TYPE_PRECISION (index_type) != TYPE_PRECISION (sizetype))
{
*************** get_inner_reference (exp, pbitsize, pbit
*** 4391,4411 ****
index_type = TREE_TYPE (index);
}
! index = fold (build (MULT_EXPR, sbitsizetype, index,
! convert (sbitsizetype,
! TYPE_SIZE (TREE_TYPE (exp)))));
!
! if (TREE_CODE (index) == INTEGER_CST
! && TREE_INT_CST_HIGH (index) == 0)
! *pbitpos += TREE_INT_CST_LOW (index);
else
{
! if (contains_placeholder_p (index))
! index = build (WITH_RECORD_EXPR, sizetype, index, exp);
! offset = size_binop (PLUS_EXPR, offset,
! size_binop (FLOOR_DIV_EXPR, index,
! size_int (BITS_PER_UNIT)));
}
}
else if (TREE_CODE (exp) != NON_LVALUE_EXPR
--- 4410,4436 ----
index_type = TREE_TYPE (index);
}
! xindex = fold (build (MULT_EXPR, sbitsizetype, index,
! convert (sbitsizetype,
! TYPE_SIZE (TREE_TYPE (exp)))));
!
! if (TREE_CODE (xindex) == INTEGER_CST
! && TREE_INT_CST_HIGH (xindex) == 0)
! *pbitpos += TREE_INT_CST_LOW (xindex);
else
{
! /* Either the bit offset calculated above is not constant, or
! it overflowed. In either case, redo the multiplication
! against the size in units. This is especially important
! in the non-constant case to avoid a division at runtime. */
! xindex = fold (build (MULT_EXPR, ssizetype, index,
! convert (ssizetype,
! TYPE_SIZE_UNIT (TREE_TYPE (exp)))));
!
! if (contains_placeholder_p (xindex))
! xindex = build (WITH_RECORD_EXPR, sizetype, xindex, exp);
! offset = size_binop (PLUS_EXPR, offset, xindex);
}
}
else if (TREE_CODE (exp) != NON_LVALUE_EXPR
*************** expand_expr (exp, target, tmode, modifie
*** 5746,5756 ****
abort ();
if (GET_MODE (offset_rtx) != ptr_mode)
#ifdef POINTERS_EXTEND_UNSIGNED
! offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 1);
#else
! offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
#endif
op0 = change_address (op0, VOIDmode,
gen_rtx_PLUS (ptr_mode, XEXP (op0, 0),
--- 5771,5783 ----
abort ();
if (GET_MODE (offset_rtx) != ptr_mode)
+ {
#ifdef POINTERS_EXTEND_UNSIGNED
! offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 1);
#else
! offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
#endif
+ }
op0 = change_address (op0, VOIDmode,
gen_rtx_PLUS (ptr_mode, XEXP (op0, 0),