[rl78] Implement TARGET_VALID_POINTER_MODE

Submitted by DJ Delorie on June 7, 2013, 12:42 a.m.

Details

Message ID 201306070042.r570gLq1026929@greed.delorie.com
State New
Headers show

Commit Message

DJ Delorie June 7, 2013, 12:42 a.m.
This fixes a bug where cfgexpand would ICE when using far pointers,
because the SImode pointers weren't "valid" with the default macro.
Committed.

	* config/rl78/rl78.c (rl78_valid_pointer_mode): New, implements
	TARGET_VALID_POINTER_MODE.

Patch hide | download patch | download mbox

Index: gcc/config/rl78/rl78.c
===================================================================
--- gcc/config/rl78/rl78.c	(revision 199776)
+++ gcc/config/rl78/rl78.c	(working copy)
@@ -644,12 +644,21 @@  rl78_addr_space_pointer_mode (addr_space
       return SImode;
     default:
       gcc_unreachable ();
     }
 }
 
+/* Returns TRUE for valid addresses.  */
+#undef TARGET_VALID_POINTER_MODE
+#define TARGET_VALID_POINTER_MODE rl78_valid_pointer_mode
+static bool
+rl78_valid_pointer_mode (enum machine_mode m)
+{
+  return (m == HImode || m == SImode);
+}
+
 /* Return the appropriate mode for a named address address.  */
 #undef TARGET_ADDR_SPACE_ADDRESS_MODE
 #define TARGET_ADDR_SPACE_ADDRESS_MODE rl78_addr_space_address_mode
 static enum machine_mode
 rl78_addr_space_address_mode (addr_space_t addrspace)
 {