[SPARC] Fix a couple of PRs

Message ID 44202342.ZRcWqpgPH2@polaris
State New
Headers show
Series
  • [SPARC] Fix a couple of PRs
Related show

Commit Message

Eric Botcazou Jan. 8, 2019, 7:10 p.m.
Although they are already fixed, the first one because it didn't fail for me 
and the second one thanks to Jakub's patch.

Tested on SPARC/Solaris 11, applied on the mainline.


2019-01-08  Eric Botcazou  <ebotcazou@adacore.com>

	PR bootstrap/88721
	* config/sparc/sparc.c (function_arg_slotno): Set *PPREGNO & *PPADDING
	to -1 on entry.

	PR debug/88723
	* config/sparc/sparc.c (sparc_delegitimize_address): Deal with naked
	UNSPECs and UNSPEC_MOVE_GOTDATA specifically.

-- 
Eric Botcazou

Patch

Index: config/sparc/sparc.c
===================================================================
--- config/sparc/sparc.c	(revision 267574)
+++ config/sparc/sparc.c	(working copy)
@@ -4949,12 +4949,19 @@  sparc_delegitimize_address (rtx x)
 {
   x = delegitimize_mem_from_attrs (x);
 
-  if (GET_CODE (x) == LO_SUM && GET_CODE (XEXP (x, 1)) == UNSPEC)
-    switch (XINT (XEXP (x, 1), 1))
+  if (GET_CODE (x) == LO_SUM)
+    x = XEXP (x, 1);
+
+  if (GET_CODE (x) == UNSPEC)
+    switch (XINT (x, 1))
       {
       case UNSPEC_MOVE_PIC:
       case UNSPEC_TLSLE:
-	x = XVECEXP (XEXP (x, 1), 0, 0);
+	x = XVECEXP (x, 0, 0);
+	gcc_assert (GET_CODE (x) == SYMBOL_REF);
+	break;
+      case UNSPEC_MOVE_GOTDATA:
+	x = XVECEXP (x, 0, 2);
 	gcc_assert (GET_CODE (x) == SYMBOL_REF);
 	break;
       default:
@@ -6873,6 +6880,10 @@  function_arg_slotno (const struct sparc_
   int slotno = cum->words, regno;
   enum mode_class mclass = GET_MODE_CLASS (mode);
 
+  /* Silence warnings in the callers.  */
+  *pregno = -1;
+  *ppadding = -1;
+
   if (type && TREE_ADDRESSABLE (type))
     return -1;