__builtin_dwarf_reg_size broken

Andreas Schwab schwab@issan.informatik.uni-dortmund.de
Mon Oct 12 02:49:00 GMT 1998


This patch fixes __builtin_dwarf_reg_size to compute the correct value for
the m68k and all other targets where the special case of fp regs
surrounded by general regs does not apply.


1998-10-11  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* dwarf2out.c (expand_builtin_dwarf_reg_size): Look at all ranges
	when generating the decision tree for the general case.

	* config/m68k/m68k.h (HARD_REGNO_MODE_OK): Don't accept modes
	wider that 12 bytes in fpu regs or wider than 8 byte in fpa regs.

--- egcs-2.92/gcc/config/m68k/m68k.h.~1~	Sat Sep 26 16:36:08 1998
+++ egcs-2.92/gcc/config/m68k/m68k.h	Sun Oct 11 21:49:27 1998
@@ -470,12 +470,13 @@
    if 68881 use is disabled.  */
 
 #define HARD_REGNO_MODE_OK(REGNO, MODE) \
-  (((REGNO) < 16					\
-   && !((REGNO) < 8 && (REGNO) + GET_MODE_SIZE ((MODE)) / 4 > 8))	\
-   || ((REGNO) < 24				        \
-       && TARGET_68881                                  \
-       && (GET_MODE_CLASS (MODE) == MODE_FLOAT		\
-	   || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)))
+  (((REGNO) < 16							\
+    && !((REGNO) < 8 && (REGNO) + GET_MODE_SIZE ((MODE)) / 4 > 8))	\
+   || ((REGNO) < 24							\
+       && TARGET_68881							\
+       && (GET_MODE_CLASS (MODE) == MODE_FLOAT				\
+	   || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)		\
+       && GET_MODE_UNIT_SIZE (MODE) <= 12))
 
 #else /* defined SUPPORT_SUN_FPA */
 
@@ -494,9 +495,11 @@
        && (REGNO) < 8 && (REGNO) + GET_MODE_SIZE ((MODE)) / 4 > 8	\
        && (REGNO) % (GET_MODE_UNIT_SIZE ((MODE)) / 4) != 0))		\
  || ((REGNO) < 24							\
-     ? TARGET_68881 && (GET_MODE_CLASS (MODE) == MODE_FLOAT		\
-			|| GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)	\
-     : ((REGNO) < 56 ? TARGET_FPA : 0)))
+     ? (TARGET_68881							\
+	&& (GET_MODE_CLASS (MODE) == MODE_FLOAT				\
+	    || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)		\
+	&& GET_MODE_UNIT_SIZE (MODE) <= 12)				\
+     : ((REGNO) < 56 ? TARGET_FPA && GET_MODE_UNIT_SIZE (MODE) <= 8 : 0)))
 
 #endif /* defined SUPPORT_SUN_FPA */
 
--- egcs-2.92/gcc/dwarf2out.c.~1~	Wed Oct  7 23:52:13 1998
+++ egcs-2.92/gcc/dwarf2out.c	Sun Oct 11 21:59:33 1998
@@ -663,7 +663,7 @@
 	  t = fold (build (COND_EXPR, integer_type_node, t2,
 			   build_int_2 (ranges[n_ranges].size, 0), t));
 	}
-      while (--n_ranges > 0);
+      while (--n_ranges >= 0);
     }
   return expand_expr (t, target, Pmode, 0);
 }

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org



More information about the Gcc-patches mailing list