2.95: Dec 29 (and final) patch kit

Bernd Schmidt bernds@redhat.com
Fri Dec 29 06:52:00 GMT 2000


This patch kit should fix all major problems that are left.

A minor problem that I discovered is that one of the reload fixes that
were backported to the branch is too conservative and disables a few
optimizations.  The effect is probably not big enough to worry about,
but maybe I can fix it quickly enough.


Bernd

	* combine.c (cant_combine_insn_p): Only restrict hard register
	combinations for SMALL_REGISTER_CLASSES machines.

The introduction of cant_combine_insn_p exposed a bug in the alias
analysis. Since it's not vital to prevent hard register combinations
unless SMALL_REGISTER_CLASSES is nonzero, it's better to try to be
close to the previous release in the rtl we generate: there's less
risk we expose other bugs.

	* config/sparc/sparc.c (pic_address_needs_scratch): LABEL_REFs are
	not valid pic operands.

This is a problem exposed by the sjlj eh patches.  The compiler would
crash while building libgcc.  The problem was that local-alloc generated
a REG_EQUIV note containing a LABEL_REF; this was substituted into an
insn, this was then reloaded and we ended up calling gen_reg_rtx.
I'm not totally sure this is the best way to fix it, but all test
results (including a testsuite run with -fpic) look good, and I've
verified that other ports do something similar.
This patch may be needed for the mainline as well.

	2000-12-26  Kazu Hirata  <kazu@hxi.com>
	* config/h8300/h8300.c (get_shift_alg): Fix a typo in the
	assembly code for 12-bit ASHIFTRT in HImode.

	2000-07-17  Kazu Hirata  <kazu@hxi.com>
	* h8300.md: Fix the format of mac.
	(movsi_h8300hs): Output a tab after stmac instead of a space.

	2000-10-07  Will Cohen  <wcohen@redhat.com>, Kazu Hirata  <kazu@hxi.com>
	* config/h8300/h8300.md: Remove the memory alternative and correct
	the insn lengths in the templates for sign extention and zero
	extention.

Three h8300 patches suggested by Kazu Hirata; included since they can't
hurt users of other ports and will presumably make the h8300 port work
better.

	2000-12-23  Philip Blundell  <philb@gnu.org>
	* config/arm/linux-elf.h (CPP_PREDEFINES): Don't define `arm' or
	`arm_elf'; do define `__arm__'.

Suggested by Philip Blundell.

	2000-08-22  Richard Henderson  <rth@cygnus.com>
	* alias.c (init_alias_analysis): Do not register
	struct_value_incoming_rtx or static_chain_rtx as pointing
	to stack memory.

This ought to fix the aliasing bug on ppc which was exposed by the combiner
change mentioned above.

	Tue Dec  5 20:09:14 2000  Jeffrey A Law  (law@cygnus.com)
	* builtins.c (expand_builtin_setjmp_setup): Set
	current_function_has_nonlocal_label.

	2000-12-03  Richard Henderson  <rth@redhat.com>
	* builtins.c (expand_builtin_setjmp_setup): New.
	(expand_builtin_setjmp_receiver): New.
	(expand_builtin_setjmp): Split out _setup and _receiver functions.
	Move argument parsing in from ...
	(expand_builtin): ... here.
	* except.c (receive_exception_label): Branch around receiver
	unless new-style exceptions.  Call expand_builtin_setjmp_receiver.
	(start_dynamic_handler): Call expand_builtin_setjmp_setup.
	* expr.h: Update builtin setjmp decls.

Make sjlj exceptions work reliably.  Tested on i686-linux by me and
sparc-openbsd by Marc Espie and others.
The problem was that we'd have both a nonlocal goto receiver, and an
exception handler.  The former jumped to the latter.  Unfortunately,
the flow graph only contained edges from calls to the exception handler,
not to the nonlocal goto receiver (since the nonlocal_handler_label list
got clobbered before flow was reached).
With this patch, the two are adjacent and there's only one label for both
handler and nonlocal goto receiver, and this label is correctly used by
flow as the target of potentially throwing calls.

Index: alias.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/alias.c,v
retrieving revision 1.52.4.1
diff -u -p -r1.52.4.1 alias.c
--- alias.c	1999/05/30 23:51:08	1.52.4.1
+++ alias.c	2000/12/29 14:05:36
@@ -1455,15 +1455,6 @@ init_alias_analysis ()
       new_reg_base_value[HARD_FRAME_POINTER_REGNUM]
 	= gen_rtx_ADDRESS (Pmode, hard_frame_pointer_rtx);
 #endif
-      if (struct_value_incoming_rtx
-	  && GET_CODE (struct_value_incoming_rtx) == REG)
-	new_reg_base_value[REGNO (struct_value_incoming_rtx)]
-	  = gen_rtx_ADDRESS (Pmode, struct_value_incoming_rtx);
-
-      if (static_chain_rtx
-	  && GET_CODE (static_chain_rtx) == REG)
-	new_reg_base_value[REGNO (static_chain_rtx)]
-	  = gen_rtx_ADDRESS (Pmode, static_chain_rtx);

       /* Walk the insns adding values to the new_reg_base_value array.  */
       for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
Index: combine.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/combine.c,v
retrieving revision 1.62.4.3
diff -u -p -r1.62.4.3 combine.c
--- combine.c	2000/12/22 14:03:13	1.62.4.3
+++ combine.c	2000/12/29 14:05:41
@@ -1330,6 +1330,11 @@ cant_combine_insn_p (insn)
   if (GET_RTX_CLASS (GET_CODE (insn)) != 'i')
     return 1;

+  /* For the 2.95.3 release, restrict this code to only handle the machines
+     where it's strictly needed.  */
+  if (! SMALL_REGISTER_CLASSES)
+    return 0;
+
   /* Never combine loads and stores involving hard regs.  The register
      allocator can usually handle such reg-reg moves by tying.  If we allow
      the combiner to make substitutions of hard regs, we risk aborting in
Index: except.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/except.c,v
retrieving revision 1.82.4.1
diff -u -p -r1.82.4.1 except.c
--- except.c	1999/07/01 23:49:41	1.82.4.1
+++ except.c	2000/12/29 14:05:41
@@ -723,21 +723,41 @@ static void
 receive_exception_label (handler_label)
      rtx handler_label;
 {
+  rtx around_label = NULL_RTX;
+
+  if (! flag_new_exceptions || exceptions_via_longjmp)
+    {
+      around_label = gen_label_rtx ();
+      emit_jump (around_label);
+      emit_barrier ();
+    }
+
   emit_label (handler_label);

-#ifdef HAVE_exception_receiver
   if (! exceptions_via_longjmp)
-    if (HAVE_exception_receiver)
-      emit_insn (gen_exception_receiver ());
+    {
+#ifdef HAVE_exception_receiver
+      if (HAVE_exception_receiver)
+       emit_insn (gen_exception_receiver ());
+      else
 #endif
-
 #ifdef HAVE_nonlocal_goto_receiver
-  if (! exceptions_via_longjmp)
-    if (HAVE_nonlocal_goto_receiver)
-      emit_insn (gen_nonlocal_goto_receiver ());
+      if (HAVE_nonlocal_goto_receiver)
+       emit_insn (gen_nonlocal_goto_receiver ());
+      else
 #endif
-}
+       { /* Nothing */ }
+    }
+  else
+    {
+#ifndef DONT_USE_BUILTIN_SETJMP
+      expand_builtin_setjmp_receiver (handler_label);
+#endif
+    }

+  if (around_label)
+    emit_label (around_label);
+}

 struct func_eh_entry
 {
@@ -1320,7 +1340,7 @@ static void
 start_dynamic_handler ()
 {
   rtx dhc, dcc;
-  rtx x, arg, buf;
+  rtx arg, buf;
   int size;

 #ifndef DONT_USE_BUILTIN_SETJMP
@@ -1362,18 +1382,17 @@ start_dynamic_handler ()
   buf = plus_constant (XEXP (arg, 0), GET_MODE_SIZE (Pmode)*2);

 #ifdef DONT_USE_BUILTIN_SETJMP
-  x = emit_library_call_value (setjmp_libfunc, NULL_RTX, 1, SImode, 1,
-			       buf, Pmode);
-  /* If we come back here for a catch, transfer control to the handler.  */
-  jumpif_rtx (x, ehstack.top->entry->exception_handler_label);
-#else
   {
-    /* A label to continue execution for the no exception case.  */
-    rtx noex = gen_label_rtx();
-    x = expand_builtin_setjmp (buf, NULL_RTX, noex,
-			       ehstack.top->entry->exception_handler_label);
-    emit_label (noex);
+    rtx x;
+    x = emit_library_call_value (setjmp_libfunc, NULL_RTX, LCT_CONST,
+                                TYPE_MODE (integer_type_node), 1,
+                                buf, Pmode);
+    /* If we come back here for a catch, transfer control to the handler.  */
+    jumpif_rtx (x, ehstack.top->entry->exception_handler_label);
   }
+#else
+  expand_builtin_setjmp_setup (buf,
+                              ehstack.top->entry->exception_handler_label);
 #endif

   /* We are committed to this, so update the handler chain.  */
Index: expr.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/expr.c,v
retrieving revision 1.144.4.5
diff -u -p -r1.144.4.5 expr.c
--- expr.c	2000/12/22 14:13:43	1.144.4.5
+++ expr.c	2000/12/29 14:05:44
@@ -191,6 +191,7 @@ static rtx expand_builtin	PROTO((tree, r
 static int apply_args_size	PROTO((void));
 static int apply_result_size	PROTO((void));
 static rtx result_vector	PROTO((int, rtx));
+static rtx expand_builtin_setjmp PROTO((tree, rtx));
 static rtx expand_builtin_apply_args PROTO((void));
 static rtx expand_builtin_apply	PROTO((rtx, rtx, rtx));
 static void expand_builtin_return PROTO((rtx));
@@ -8543,44 +8544,29 @@ expand_builtin_return_addr (fndecl_code,
   return tem;
 }

-/* __builtin_setjmp is passed a pointer to an array of five words (not
-   all will be used on all machines).  It operates similarly to the C
-   library function of the same name, but is more efficient.  Much of
-   the code below (and for longjmp) is copied from the handling of
-   non-local gotos.
-
-   NOTE: This is intended for use by GNAT and the exception handling
-   scheme in the compiler and will only work in the method used by
-   them.  */
+/* Construct the leading half of a __builtin_setjmp call.  Control will
+   return to RECEIVER_LABEL.  This is used directly by sjlj exception
+   handling code.  */

-rtx
-expand_builtin_setjmp (buf_addr, target, first_label, next_label)
+void
+expand_builtin_setjmp_setup (buf_addr, receiver_label)
      rtx buf_addr;
-     rtx target;
-     rtx first_label, next_label;
+     rtx receiver_label;
 {
-  rtx lab1 = gen_label_rtx ();
   enum machine_mode sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL);
-  enum machine_mode value_mode;
   rtx stack_save;

-  value_mode = TYPE_MODE (integer_type_node);
-
 #ifdef POINTERS_EXTEND_UNSIGNED
   buf_addr = convert_memory_address (Pmode, buf_addr);
 #endif

   buf_addr = force_reg (Pmode, buf_addr);

-  if (target == 0 || GET_CODE (target) != REG
-      || REGNO (target) < FIRST_PSEUDO_REGISTER)
-    target = gen_reg_rtx (value_mode);
-
   emit_queue ();

-  /* We store the frame pointer and the address of lab1 in the buffer
-     and use the rest of it for the stack save area, which is
-     machine-dependent.  */
+  /* We store the frame pointer and the address of receiver_label in
+     the buffer and use the rest of it for the stack save area, which
+     is machine-dependent.  */

 #ifndef BUILTIN_SETJMP_FRAME_VALUE
 #define BUILTIN_SETJMP_FRAME_VALUE virtual_stack_vars_rtx
@@ -8592,7 +8578,7 @@ expand_builtin_setjmp (buf_addr, target,
 		  (gen_rtx_MEM (Pmode,
 				plus_constant (buf_addr,
 					       GET_MODE_SIZE (Pmode)))),
-		  force_reg (Pmode, gen_rtx_LABEL_REF (Pmode, lab1)));
+		  force_reg (Pmode, gen_rtx_LABEL_REF (Pmode, receiver_label)));

   stack_save = gen_rtx_MEM (sa_mode,
 			    plus_constant (buf_addr,
@@ -8604,21 +8590,23 @@ expand_builtin_setjmp (buf_addr, target,
   if (HAVE_builtin_setjmp_setup)
     emit_insn (gen_builtin_setjmp_setup (buf_addr));
 #endif
-
-  /* Set TARGET to zero and branch to the first-time-through label.  */
-  emit_move_insn (target, const0_rtx);
-  emit_jump_insn (gen_jump (first_label));
-  emit_barrier ();
-  emit_label (lab1);

-  /* Tell flow about the strange goings on.  Putting `lab1' on
-     `nonlocal_goto_handler_labels' to indicates that function
-     calls may traverse the arc back to this label.  */
+  /* Tell optimize_save_area_alloca that extra work is going to
+     need to go on during alloca.  */
+  current_function_calls_setjmp = 1;

+  /* Set this so all the registers get saved in our frame; we need to be
+     able to copy the saved values for any registers from frames we unwind. */
   current_function_has_nonlocal_label = 1;
-  nonlocal_goto_handler_labels =
-    gen_rtx_EXPR_LIST (VOIDmode, lab1, nonlocal_goto_handler_labels);
+}

+/* Construct the trailing part of a __builtin_setjmp call.
+   This is used directly by sjlj exception handling code.  */
+
+void
+expand_builtin_setjmp_receiver (receiver_label)
+      rtx receiver_label ATTRIBUTE_UNUSED;
+{
   /* Clobber the FP when we get here, so we have to make sure it's
      marked as used by this function.  */
   emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
@@ -8665,7 +8653,7 @@ expand_builtin_setjmp (buf_addr, target,

 #ifdef HAVE_builtin_setjmp_receiver
   if (HAVE_builtin_setjmp_receiver)
-    emit_insn (gen_builtin_setjmp_receiver (lab1));
+    emit_insn (gen_builtin_setjmp_receiver (receiver_label));
   else
 #endif
 #ifdef HAVE_nonlocal_goto_receiver
@@ -8676,12 +8664,61 @@ expand_builtin_setjmp (buf_addr, target,
       {
 	; /* Nothing */
       }
+}

-  /* Set TARGET, and branch to the next-time-through label.  */
-  emit_move_insn (target, const1_rtx);
-  emit_jump_insn (gen_jump (next_label));
+
+/* __builtin_setjmp is passed a pointer to an array of five words (not
+   all will be used on all machines).  It operates similarly to the C
+   library function of the same name, but is more efficient.  Much of
+   the code below (and for longjmp) is copied from the handling of
+   non-local gotos.
+
+   NOTE: This is intended for use by GNAT and the exception handling
+   scheme in the compiler and will only work in the method used by
+   them.  */
+
+static rtx
+expand_builtin_setjmp (arglist, target)
+     tree arglist;
+     rtx target;
+{
+  rtx buf_addr, next_lab, cont_lab;
+
+  if (arglist == 0
+      || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE)
+    return NULL_RTX;
+
+  if (target == 0 || GET_CODE (target) != REG
+      || REGNO (target) < FIRST_PSEUDO_REGISTER)
+    target = gen_reg_rtx (TYPE_MODE (integer_type_node));
+
+  buf_addr = expand_expr (TREE_VALUE (arglist), NULL_RTX, VOIDmode, 0);
+
+  next_lab = gen_label_rtx ();
+  cont_lab = gen_label_rtx ();
+
+  expand_builtin_setjmp_setup (buf_addr, next_lab);
+
+  /* Set TARGET to zero and branch to the continue label.  */
+  emit_move_insn (target, const0_rtx);
+  emit_jump_insn (gen_jump (cont_lab));
   emit_barrier ();
+  emit_label (next_lab);

+  expand_builtin_setjmp_receiver (next_lab);
+
+  /* Set TARGET to one.  */
+  emit_move_insn (target, const1_rtx);
+  emit_label (cont_lab);
+
+  /* Tell flow about the strange goings on.  Putting `next_lab' on
+     `nonlocal_goto_handler_labels' to indicates that function
+     calls may traverse the arc back to this label.  */
+
+  current_function_has_nonlocal_label = 1;
+  nonlocal_goto_handler_labels
+    = gen_rtx_EXPR_LIST (VOIDmode, next_lab, nonlocal_goto_handler_labels);
+
   return target;
 }

@@ -9702,18 +9739,10 @@ expand_builtin (exp, target, subtarget,
 #endif

     case BUILT_IN_SETJMP:
-      if (arglist == 0
-	  || TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) != POINTER_TYPE)
-	break;
-      else
-	{
-	  rtx buf_addr = expand_expr (TREE_VALUE (arglist), subtarget,
-				      VOIDmode, 0);
-	  rtx lab = gen_label_rtx ();
-	  rtx ret = expand_builtin_setjmp (buf_addr, target, lab, lab);
-	  emit_label (lab);
-	  return ret;
-	}
+      target = expand_builtin_setjmp (arglist, target);
+      if (target)
+	return target;
+      break;

       /* __builtin_longjmp is passed a pointer to an array of five words.
 	 It's similar to the C library longjmp function but works with
Index: expr.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/expr.h,v
retrieving revision 1.34.4.2
diff -u -p -r1.34.4.2 expr.h
--- expr.h	1999/05/22 01:25:48	1.34.4.2
+++ expr.h	2000/12/29 14:05:45
@@ -831,7 +831,8 @@ extern rtx store_expr PROTO((tree, rtx,
    Useful after calling expand_expr with 1 as sum_ok.  */
 extern rtx force_operand PROTO((rtx, rtx));

-extern rtx expand_builtin_setjmp PROTO((rtx, rtx, rtx, rtx));
+extern void expand_builtin_setjmp_setup PARAMS ((rtx, rtx));
+extern void expand_builtin_setjmp_receiver PARAMS ((rtx));

 #ifdef TREE_CODE
 /* Generate code for computing expression EXP.
Index: config/arm/linux-elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/arm/linux-elf.h,v
retrieving revision 1.7.4.4
diff -u -p -r1.7.4.4 linux-elf.h
--- config/arm/linux-elf.h	2000/12/22 14:31:35	1.7.4.4
+++ config/arm/linux-elf.h	2000/12/29 14:05:57
@@ -103,8 +103,8 @@ Boston, MA 02111-1307, USA.  */

 #undef  CPP_PREDEFINES
 #define CPP_PREDEFINES \
-"-Dunix -Darm -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(arm) \
--Amachine(arm) -D__ELF__ -Darm_elf"
+"-Dunix -D__arm__ -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(arm) \
+-Amachine(arm) -D__ELF__"

 #ifndef SUBTARGET_DEFAULT_APCS26
 #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
Index: config/h8300/h8300.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/h8300/h8300.c,v
retrieving revision 1.16.4.1
diff -u -p -r1.16.4.1 h8300.c
--- config/h8300/h8300.c	2000/12/18 14:43:08	1.16.4.1
+++ config/h8300/h8300.c	2000/12/29 14:05:57
@@ -2313,9 +2313,9 @@ get_shift_alg (cpu, shift_type, mode, co
 	      if (TARGET_H8300)
 		*assembler_p = "mov.b\t%t0,%s0\n\tbld\t#7,%s0\n\tsubx\t%t0,%t0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0";
 	      else if (TARGET_H8300H)
-		*assembler_p = "mov.b\t%t0,%s0\n\textw.w\t%T0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0";
+		*assembler_p = "mov.b\t%t0,%s0\n\texts.w\t%T0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0\n\tshar.b\t%s0";
 	      else if (TARGET_H8300S)
-		*assembler_p = "mov.b\t%t0,%s0\n\textw.w\t%T0\n\tshar.b\t#2,%s0\n\tshar.b\t#2,%s0";
+		*assembler_p = "mov.b\t%t0,%s0\n\texts.w\t%T0\n\tshar.b\t#2,%s0\n\tshar.b\t#2,%s0";
 	      *cc_valid_p = 0;
 	      return SHIFT_SPECIAL;
 	    }
Index: config/h8300/h8300.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/h8300/h8300.md,v
retrieving revision 1.5.4.1
diff -u -p -r1.5.4.1 h8300.md
--- config/h8300/h8300.md	1999/12/24 18:05:28	1.5.4.1
+++ config/h8300/h8300.md	2000/12/29 14:05:57
@@ -414,7 +414,7 @@
   if (which_alternative == 7)
     return \"clrmac\;ldmac %1,macl\";
   if (which_alternative == 8)
-    return \"stmac macl,%0\";
+    return \"stmac	macl,%0\";
   if (GET_CODE (operands[1]) == CONST_INT)
     {
       int val = INTVAL (operands[1]);
@@ -861,7 +861,7 @@
 	  (sign_extend:SI
 	    (mem:HI (post_inc:SI (match_operand:SI 2 "register_operand" "r"))))))]
   "TARGET_H8300S"
-  "clrmac\;mac	%2,%1"
+  "clrmac\;mac	@%2+,@%1+"
   [(set_attr "length" "6")
    (set_attr "cc" "none_0hit")])

@@ -874,7 +874,7 @@
 	    (post_inc:SI (match_operand:SI 2 "register_operand" "r")))))
 	      (match_operand:SI 3 "register_operand" "0")))]
   "TARGET_H8300S"
-  "mac	%2,%1"
+  "mac	@%2+,@%1+"
   [(set_attr "length" "4")
    (set_attr "cc" "none_0hit")])

@@ -1674,7 +1674,7 @@

 (define_expand "zero_extendhisi2"
   [(set (match_operand:SI 0 "register_operand" "")
-	(zero_extend:SI (match_operand:HI 1 "general_operand" "")))]
+	(zero_extend:SI (match_operand:HI 1 "register_operand" "")))]
   ""
   "
 {
@@ -1709,18 +1709,16 @@
    (set_attr "cc" "clobber,clobber,clobber")])

 (define_insn ""
-  [(set (match_operand:SI 0 "register_operand" "=r,r")
-	(zero_extend:SI (match_operand:HI 1 "general_operand_src" "0,g>")))]
+  [(set (match_operand:SI 0 "register_operand" "=r")
+	(zero_extend:SI (match_operand:HI 1 "register_operand" "0")))]
   "TARGET_H8300H || TARGET_H8300S"
-  "@
-  extu.l	%S0
-  mov.w	%T1,%T0\;extu.l	%S0"
-  [(set_attr "length" "2,4")
-   (set_attr "cc" "set_znv,set_znv")])
+  "extu.l	%S0"
+  [(set_attr "length" "2")
+   (set_attr "cc" "set_znv")])

 (define_expand "extendqihi2"
   [(set (match_operand:HI 0 "register_operand" "")
-	(sign_extend:HI (match_operand:QI 1 "general_operand" "")))]
+	(sign_extend:HI (match_operand:QI 1 "register_operand" "")))]
   ""
   "")

@@ -1735,14 +1733,12 @@
    (set_attr "cc" "clobber,clobber")])

 (define_insn ""
-  [(set (match_operand:HI 0 "register_operand" "=r,r")
-	(sign_extend:HI (match_operand:QI 1 "general_operand_src" "0,g>")))]
+  [(set (match_operand:HI 0 "register_operand" "=r")
+	(sign_extend:HI (match_operand:QI 1 "register_operand" "0")))]
   "TARGET_H8300H || TARGET_H8300S"
-  "@
-  exts.w	%T0
-  mov.b	%R1,%s0\;exts.w	%T0"
-  [(set_attr "length" "2,4")
-   (set_attr "cc" "set_znv,set_znv")])
+  "exts.w	%T0"
+  [(set_attr "length" "2")
+   (set_attr "cc" "set_znv")])

 ;; The compiler can synthesize a 300H variant of this which is
 ;; just as efficient as one that we'd create
@@ -1758,7 +1754,7 @@

 (define_expand "extendhisi2"
   [(set (match_operand:SI 0 "register_operand" "")
-	(sign_extend:SI (match_operand:HI 1 "general_operand" "")))]
+	(sign_extend:SI (match_operand:HI 1 "register_operand" "")))]
   ""
   "
 {
@@ -1791,14 +1787,12 @@
    (set_attr "cc" "clobber,clobber")])

 (define_insn ""
-  [(set (match_operand:SI 0 "register_operand" "=r,r")
-	(sign_extend:SI (match_operand:HI 1 "general_operand_src" "0,g>")))]
+  [(set (match_operand:SI 0 "register_operand" "=r")
+	(sign_extend:SI (match_operand:HI 1 "register_operand" "0")))]
   "TARGET_H8300H || TARGET_H8300S"
-  "@
-  exts.l	%S0
-  mov.w	%T1,%T0\;exts.l	%S0"
-  [(set_attr "length" "2,4")
-   (set_attr "cc" "set_znv,set_znv")])
+  "exts.l	%S0"
+  [(set_attr "length" "2")
+   (set_attr "cc" "set_znv")])

 ;; ----------------------------------------------------------------------
 ;; SHIFTS
Index: config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sparc/sparc.c,v
retrieving revision 1.69.4.3
diff -u -p -r1.69.4.3 sparc.c
--- config/sparc/sparc.c	1999/08/18 08:20:11	1.69.4.3
+++ config/sparc/sparc.c	2000/12/29 14:06:00
@@ -2429,6 +2429,9 @@ int
 pic_address_needs_scratch (x)
      rtx x;
 {
+  if (GET_CODE (x) == LABEL_REF)
+    return 1;
+
   /* An address which is a symbolic plus a non SMALL_INT needs a temp reg.  */
   if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS
       && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF



More information about the Gcc-patches mailing list