re PR middle-end/53698 (ICE: in plus_constant, at explow.c:88 with -O -mx32 -maddress-mode=long -fno-tree-dominator-opts)

gcc/
	PR middle-end/53698
	* expr.c (expand_expr_addr_expr_1): Convert to tmode before
	performing an addition.

gcc/testsuite/
	PR middle-end/53698
	* gcc.target/i386/pr53698.c: New test.

From-SVN: r188725
This commit is contained in:
Richard Sandiford 2012-06-18 09:32:51 +00:00 committed by Richard Sandiford
parent 89029ba5da
commit b7104c55e7
4 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2012-06-18 Richard Sandiford <rdsandiford@googlemail.com>
PR middle-end/53698
* expr.c (expand_expr_addr_expr_1): Convert to tmode before
performing an addition.
2012-06-17 Steven Bosscher <steven@gcc.gnu.org>
* output.h (split_double): Move prototype to rtl.h.

View File

@ -7630,6 +7630,7 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode,
of such an object. */
gcc_assert ((bitpos % BITS_PER_UNIT) == 0);
result = convert_memory_address_addr_space (tmode, result, as);
result = plus_constant (tmode, result, bitpos / BITS_PER_UNIT);
if (modifier < EXPAND_SUM)
result = force_operand (result, target);

View File

@ -1,3 +1,8 @@
2012-06-18 Richard Sandiford <rdsandiford@googlemail.com>
PR middle-end/53698
* gcc.target/i386/pr53698.c: New test.
2012-06-17 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/pr33329.c (f): Increase tabs array to 1024.

View File

@ -0,0 +1,16 @@
/* { dg-do compile { target { ! { ia32 } } } } */
/* { dg-options "-O -mx32 -maddress-mode=long -fno-tree-dominator-opts" } */
extern char foo[];
void
test2 (void)
{
int s;
for (s = 0;; ++s)
{
if (foo[s] != s)
__builtin_abort ();
foo[s] = s;
}
}