This is the mail archive of the
mailing list for the GCC project.
Re: RFA: Fix debug address mode for TARGET_MEM_REF
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Joern Rennecke <joern dot rennecke at embecosm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jim Wilson <wilson at tuliptree dot org>
- Date: Wed, 8 Oct 2014 13:02:50 +0200
- Subject: Re: RFA: Fix debug address mode for TARGET_MEM_REF
- Authentication-results: sourceware.org; auth=none
- References: <CAMqJFCrYf=kirLvD0G-UjaFm7Pkeh7OxYDZ0X+jVgkDNysCXQg at mail dot gmail dot com>
On Wed, Oct 8, 2014 at 10:16 AM, Joern Rennecke
> Trying to build avr2 strftime of avr-libc ICEs as we are trying to
> convert a PSImode address to HImode. There is no reason to
> do this conversion in the first place - it is a case of failing to recognize
> the proper address space.
> The attached patch fixes this.
> Bootstrapped on i686-pc-linux-gnu.
> OK to apply?
The address-space of TARGET_MEM_REFs is in
TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (exp, 0)))))
see TARGET_MEM_REF expansion or the MEM_REF handling.
It's unconditionally there, all the if()s in the existing code are bogus.
--- cfgexpand.c (revision 215917)
+++ cfgexpand.c (working copy)
@@ -3286,7 +3286,7 @@ expand_gimple_stmt_1 (gimple stmt)
@@ -3983,11 +3983,7 @@ expand_debug_expr (tree exp)
- if (POINTER_TYPE_P (TREE_TYPE (exp)))
- as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
- 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),
if (op0 == NULL_RTX)