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]

PR inline-asm/8803


The asm statement gets past ellimination of virtual registers and dies
later in addressof.  I am getting quite nervous about keeping the
inconsistent asm statement in the chain.  What about zapping all that
does not validate just after instantiate_virtual_regs?  Or can we have
"valid" "invalid" asm staement that magically gets trought?

void
f (unsigned char *u)
{
  char U1U2U3U4[8];
asm ("pxor %[U], %[U]\n\t" "punpacklbw %[u], %[U]\n\t": [U] "=y" (*U1U2U3U4):[u] "m"
       (*u));
}

Honza

Tue Apr  8 20:10:06 CEST 2003  Jan Hubicka  <jh at suse dot cz>
	PR inline-asm/8803
	* function.c (fixup_var_refs_1, purge_addressof_1): Error and
	delete inconsistent asm statements.
	(purge_addressof): Do not continue processing deleted asm statment.
Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.412
diff -c -3 -p -r1.412 function.c
*** function.c	24 Mar 2003 17:53:27 -0000	1.412
--- function.c	8 Apr 2003 18:09:45 -0000
*************** fixup_var_refs_1 (var, promoted_mode, lo
*** 1905,1910 ****
--- 1905,1914 ----
    rtx tem, tem1;
    struct fixup_replacement *replacement;
  
+   /* We may have detected and deleted invalid asm statements.  */
+   if (INSN_DELETED_P (insn))
+     return;
+ 
    switch (code)
      {
      case ADDRESSOF:
*************** fixup_var_refs_1 (var, promoted_mode, lo
*** 1922,1928 ****
  		 Note that we can't use validate_change to verify this, since
  		 we're not caring for replacing all dups simultaneously.  */
  	      if (! validate_replace_rtx (*loc, y, insn))
! 		abort ();
  
  	      /* Careful!  First try to recognize a direct move of the
  		 value, mimicking how things are done in gen_reload wrt
--- 1926,1935 ----
  		 Note that we can't use validate_change to verify this, since
  		 we're not caring for replacing all dups simultaneously.  */
  	      if (! validate_replace_rtx (*loc, y, insn))
! 		{
! 	          instantiate_virtual_regs_lossage (insn);
! 		  return;
! 		}
  
  	      /* Careful!  First try to recognize a direct move of the
  		 value, mimicking how things are done in gen_reload wrt
*************** purge_addressof_1 (loc, insn, force, sto
*** 3020,3025 ****
--- 3027,3035 ----
    x = *loc;
    if (x == 0)
      return true;
+   /* We may have detected and deleted invalid asm statements.  */
+   if (insn && INSN_DELETED_P (insn))
+     return true;
  
    code = GET_CODE (x);
  
*************** purge_addressof_1 (loc, insn, force, sto
*** 3037,3043 ****
        rtx sub, insns;
  
        if (GET_CODE (XEXP (x, 0)) != MEM)
! 	put_addressof_into_stack (x, ht);
  
        /* We must create a copy of the rtx because it was created by
  	 overwriting a REG rtx which is always shared.  */
--- 3047,3057 ----
        rtx sub, insns;
  
        if (GET_CODE (XEXP (x, 0)) != MEM)
! 	{
! 	  put_addressof_into_stack (x, ht);
! 	  if (insn && INSN_DELETED_P (insn))
! 	    return true;
! 	}
  
        /* We must create a copy of the rtx because it was created by
  	 overwriting a REG rtx which is always shared.  */
*************** purge_addressof_1 (loc, insn, force, sto
*** 3050,3056 ****
        sub = force_operand (sub, NULL_RTX);
        if (! validate_change (insn, loc, sub, 0)
  	  && ! validate_replace_rtx (x, sub, insn))
! 	abort ();
  
        insns = get_insns ();
        end_sequence ();
--- 3064,3073 ----
        sub = force_operand (sub, NULL_RTX);
        if (! validate_change (insn, loc, sub, 0)
  	  && ! validate_replace_rtx (x, sub, insn))
! 	{
! 	  instantiate_virtual_regs_lossage (insn);
! 	  return true;
! 	}
  
        insns = get_insns ();
        end_sequence ();
*************** purge_addressof (insns)
*** 3406,3411 ****
--- 3423,3431 ----
  	  /* If we could not replace the ADDRESSOFs in the insn,
  	     something is wrong.  */
  	  abort ();
+ 	/* We may have detected and deleted invalid asm statements.  */
+ 	if (INSN_DELETED_P (insn))
+ 	  continue;
  
  	if (! purge_addressof_1 (&REG_NOTES (insn), NULL_RTX, 0, 0, ht))
  	  {


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