This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: invalid assert in convert_debug_memory_address
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 12 Jan 2012 09:04:47 +0100
- Subject: Re: invalid assert in convert_debug_memory_address
- References: <201201112113.q0BLDwNp026422@greed.delorie.com>
On Wed, Jan 11, 2012 at 10:13 PM, DJ Delorie <dj@redhat.com> wrote:
>
> The assert is not valid for address spaces that support more than one
> pointer size, such as the generic space of TPF, mips64, or m32c.
Looks good to me.
Richard.
> 2012-01-11 ?DJ Delorie ?<dj@redhat.com>
>
> ? ? ? ?* cfgexpand.c (convert_debug_memory_address): Allow any valid
> ? ? ? ?pointer type, not just the default pointer type.
>
> Index: cfgexpand.c
> ===================================================================
> --- cfgexpand.c ? ? ?(revision 183092)
> +++ cfgexpand.c (working copy)
> @@ -2490,16 +2490,14 @@ convert_debug_memory_address (enum machi
> ?#ifndef POINTERS_EXTEND_UNSIGNED
> ? gcc_assert (mode == Pmode
> ? ? ? ? ? ? ?|| mode == targetm.addr_space.address_mode (as));
> ? gcc_assert (xmode == mode || xmode == VOIDmode);
> ?#else
> ? rtx temp;
> - ?enum machine_mode address_mode = targetm.addr_space.address_mode (as);
> - ?enum machine_mode pointer_mode = targetm.addr_space.pointer_mode (as);
>
> - ?gcc_assert (mode == address_mode || mode == pointer_mode);
> + ?gcc_assert (targetm.addr_space.valid_pointer_mode (mode, as));
>
> ? if (GET_MODE (x) == mode || GET_MODE (x) == VOIDmode)
> ? ? return x;
>
> ? if (GET_MODE_PRECISION (mode) < GET_MODE_PRECISION (xmode))
> ? ? x = simplify_gen_subreg (mode, x, xmode,