This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix target/13789


A latent bug that shows up with tree-ssa for some reason.

We try to use emit_move_insn on 

	(plus:SI (mem:SI (reg:SI virtual-incoming-args))
		 (const_int 8))

This is illegal; emit_move_insn should only be used with
general_operands arguments.

Fixed thus.


r~



        * expr.c (store_expr): Use force_operand before emit_move_insn.

Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.467.2.74
diff -c -p -d -r1.467.2.74 expr.c
*** expr.c	30 Jan 2004 13:13:54 -0000	1.467.2.74
--- expr.c	3 Feb 2004 04:29:51 -0000
*************** store_expr (tree exp, rtx target, int wa
*** 4331,4337 ****
  			 (want_value & 2
  			  ? BLOCK_OP_CALL_PARM : BLOCK_OP_NORMAL));
        else
! 	emit_move_insn (target, temp);
      }
  
    /* If we don't want a value, return NULL_RTX.  */
--- 4331,4341 ----
  			 (want_value & 2
  			  ? BLOCK_OP_CALL_PARM : BLOCK_OP_NORMAL));
        else
! 	{
! 	  temp = force_operand (temp, target);
! 	  if (temp != target)
! 	    emit_move_insn (target, temp);
! 	}
      }
  
    /* If we don't want a value, return NULL_RTX.  */
Index: testsuite/gcc.c-torture/compile/20040202-1.c
===================================================================
RCS file: testsuite/gcc.c-torture/compile/20040202-1.c
diff -N testsuite/gcc.c-torture/compile/20040202-1.c
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.c-torture/compile/20040202-1.c	3 Feb 2004 04:33:21 -0000
***************
*** 0 ****
--- 1,8 ----
+ /* PR target/13789 */
+ /* Failed on SPARC due to a bug in store_expr.  */
+ 
+ void *foo (void *c)
+ {
+   void *a = __builtin_extract_return_addr (c);
+   return a;
+ }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]