This is the mail archive of the gcc-patches@gcc.gnu.org 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]

[PATCH, rtl-optimization]: Fix PR rtl-optimization/32293: internal compiler error: in do_SUBST, at combine.c


Hello!

The problem, exposed by attached testcase is in
simplify_if_then_else(). This function checks single-bit checks by
assigning "nzb = nonzero_bits (from, GET_MODE (from))". However,
nonzero_bits() returns unsigned HWI and this produces wrong CONST_INT
rtx (for 0x80000000 nzb) for SImode expressions in case of 64bit HWI.

The solution is to call trunc_int_for_mode() to truncate "nzb" to
correct mode (SImode in attached testcase).

Patch was bootstrapped on i686-pc-linux-gnu and regression tested for
all default languages. Although the patch is almost obvious... is it
OK for mainline?

2007-06-12 Uros Bizjak <ubizjak@gmail.com>

	PR rtl-optimization/32293
	* combine.c (simplify_if_then_else): Truncate return from
	nonzero_bits() to correct mode.

testsuite/ChangeLog:
	
2007-06-12  Uros Bizjak  <ubizjak@gmail.com>

	PR rtl-optimization/32293
	* gcc.dg/pr32293.c: New test.

Uros.

Attachment: pr32293.diff.txt
Description: Text document


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