tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p ): Check both [reg+mult*reg] and [mult*reg] to determine if multiplier is allowed.

* tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p ): Check both
	[reg+mult*reg] and [mult*reg] to determine if multiplier is allowed.

From-SVN: r204031
This commit is contained in:
Igor Shevlyakov 2013-10-24 18:55:12 +00:00 committed by Jeff Law
parent 247dbcf4ab
commit f258df2d19
2 changed files with 12 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2013-10-24 Igor Shevlyakov <igor.shevlyakov@gmail.com>
* tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p ): Check both
[reg+mult*reg] and [mult*reg] to determine if multiplier is allowed.
2013-10-24 Cong Hou <congh@google.com>
* convert.c (convert_to_real): Guard those unsafe math function

View File

@ -3120,16 +3120,19 @@ multiplier_allowed_in_address_p (HOST_WIDE_INT ratio, enum machine_mode mode,
{
enum machine_mode address_mode = targetm.addr_space.address_mode (as);
rtx reg1 = gen_raw_REG (address_mode, LAST_VIRTUAL_REGISTER + 1);
rtx addr;
rtx reg2 = gen_raw_REG (address_mode, LAST_VIRTUAL_REGISTER + 2);
rtx addr, scaled;
HOST_WIDE_INT i;
valid_mult = sbitmap_alloc (2 * MAX_RATIO + 1);
bitmap_clear (valid_mult);
addr = gen_rtx_fmt_ee (MULT, address_mode, reg1, NULL_RTX);
scaled = gen_rtx_fmt_ee (MULT, address_mode, reg1, NULL_RTX);
addr = gen_rtx_fmt_ee (PLUS, address_mode, scaled, reg2);
for (i = -MAX_RATIO; i <= MAX_RATIO; i++)
{
XEXP (addr, 1) = gen_int_mode (i, address_mode);
if (memory_address_addr_space_p (mode, addr, as))
XEXP (scaled, 1) = gen_int_mode (i, address_mode);
if (memory_address_addr_space_p (mode, addr, as)
|| memory_address_addr_space_p (mode, scaled, as))
bitmap_set_bit (valid_mult, i + MAX_RATIO);
}