Commit a148c4b2 by Senthil Kumar Selvaraj Committed by Jeff Law

re PR debug/52472 (ICE: in convert_debug_memory_address, at cfgexpand.c:2491)

	PR target/52472
	* cfgexpand.c (expand_debug_expr): Use address space of nested
	TREE_TYPE for ADDR_EXPR and MEM_REF.

	PR target/52472
	* gcc.target/avr/pr52472.c: New test.

From-SVN: r211288
parent 64e13bcd
2014-06-05 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
PR target/52472
* cfgexpand.c (expand_debug_expr): Use address space of nested
TREE_TYPE for ADDR_EXPR and MEM_REF.
2014-06-05 Jeff Law <law@redhat.com>
PR tree-optimization/61289
......
......@@ -3941,10 +3941,7 @@ expand_debug_expr (tree exp)
op0 = plus_constant (inner_mode, op0, INTVAL (op1));
}
if (POINTER_TYPE_P (TREE_TYPE (exp)))
as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
else
as = ADDR_SPACE_GENERIC;
as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0))));
op0 = convert_debug_memory_address (targetm.addr_space.address_mode (as),
op0, as);
......@@ -4467,7 +4464,7 @@ expand_debug_expr (tree exp)
return NULL;
}
as = TYPE_ADDR_SPACE (TREE_TYPE (exp));
as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
op0 = convert_debug_memory_address (mode, XEXP (op0, 0), as);
return op0;
......
2014-06-05 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
PR target/52472
* gcc.target/avr/pr52472.c: New test.
2014-06-05 Jeff Law <law@redhat.com>
PR tree-optimization/61289
......
/* { dg-do compile } */
/* { dg-options "-Os -g -Wno-pointer-to-int-cast" } */
/* This testcase exposes PR52472. expand_debug_expr mistakenly
considers the address space of data to be generic, and
asserts that PSImode pointers aren't valid in the generic
address space. */
extern const __memx unsigned data[][10];
unsigned long ice (void)
{
unsigned long addr32;
return addr32 = ((unsigned long) data);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment