diff mbox

invalid assert in convert_debug_memory_address

Message ID 201201112113.q0BLDwNp026422@greed.delorie.com
State New
Headers show

Commit Message

DJ Delorie Jan. 11, 2012, 9:13 p.m. UTC
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.

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.

Comments

Richard Biener Jan. 12, 2012, 8:04 a.m. UTC | #1
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,
DJ Delorie Jan. 12, 2012, 9:37 p.m. UTC | #2
Thanks, committed.
diff mbox

Patch

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,