This is the mail archive of the 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]

[Committed] PR19800: Don't call gen_lowpart in simplify-rtx.c

On Mon, 7 Feb 2005, Alan Modra wrote:
> It's past the point of failure.  Thanks for the quick fix!

I've committed the following patch to mainline CVS to resolve PR19800,
which is a bootstrap failure on powerpc64-linux and a uberbaum build
failure on mmix-knuth-mmixware caused by my patch for PR19331 earlier

The issue is that gen_lowpart had an unforseen failure mode if its
argument is not a register or memory, and it can't be simplified by
gen_lowpart_common, in which case the function would abort causing
the above ICE.  The solution is to avoid calling gen_lowpart and
instead, use gen_lowpart_common and gen_lowpart_SUBREG as is done
elsewhere in simplify-rtx.c.

This patch has been tested on i686-pc-linux-gnu with a full "make
bootstrap", all default languages, and regression tested with a top-level
"make -k check" with no new failures.  I've also confirmed that this
change allows an uberbaum build of a tool chain to mmix-knuth-mmixware
from i686-pc-linux-gnu to complete (it'd fail building newlib previously)
and similarly that a bootstrap on powerpc64-unknown-linux-gnu survives
a full top-level "make bootstrap" (it'd previously ICE in stage2).

Committed to mainline CVS.  My apologies for any inconvenience.

2005-02-06  Roger Sayle  <>

	PR rtl-optimization/19800
	* simplify_rtx.c (simplify_relational_operaration_1): Explicitly
	call gen_lowpart_common and gen_lowpart_SUBREG instead of calling

Index: simplify-rtx.c
RCS file: /cvs/gcc/gcc/gcc/simplify-rtx.c,v
retrieving revision 1.225
diff -c -3 -p -r1.225 simplify-rtx.c
*** simplify-rtx.c	6 Feb 2005 23:33:25 -0000	1.225
--- simplify-rtx.c	7 Feb 2005 01:55:27 -0000
*************** simplify_relational_operation_1 (enum rt
*** 2888,2896 ****
        && cmp_mode != VOIDmode
        && nonzero_bits (op0, cmp_mode) == 1
        && STORE_FLAG_VALUE == 1)
!     return GET_MODE_SIZE (mode) > GET_MODE_SIZE (cmp_mode)
! 	   ? simplify_gen_unary (ZERO_EXTEND, mode, op0, cmp_mode)
! 	   : gen_lowpart (mode, op0);

    return NULL_RTX;
--- 2888,2904 ----
        && cmp_mode != VOIDmode
        && nonzero_bits (op0, cmp_mode) == 1
        && STORE_FLAG_VALUE == 1)
!     {
!       rtx tmp;
!       if (GET_MODE_SIZE (mode) > GET_MODE_SIZE (cmp_mode))
! 	return simplify_gen_unary (ZERO_EXTEND, mode, op0, cmp_mode);
!       tmp = gen_lowpart_common (mode, op0);
!       if (tmp)
! 	return tmp;
!       if (GET_MODE (op0) != mode)
! 	return gen_lowpart_SUBREG (mode, op0);
!       return op0;
!     }

    return NULL_RTX;


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