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]

C++ PATCH: ASMs and function-at-a-time



This patch fixes a bug in the function-at-a-time implementation of
inline assembly statements.  We should do decay_conversion on the
input operands to an asm at semantic-analysis time -- not
RTL-generation time.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2000-06-30  Mark Mitchell  <mark@codesourcery.com>

	* semantics.c (genrtl_asm_stmt): Don't decay input operands here.
	(finish_asm_stmt): Do it here, instead.

Index: semantics.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/semantics.c,v
retrieving revision 1.154
diff -c -p -r1.154 semantics.c
*** semantics.c	2000/06/29 14:03:10	1.154
--- semantics.c	2000/06/30 19:02:58
*************** genrtl_asm_stmt (cv_qualifier, string, o
*** 1341,1358 ****
    emit_line_note (input_filename, lineno);
    if (output_operands != NULL_TREE || input_operands != NULL_TREE
        || clobbers != NULL_TREE)
!     {
!       tree t;
!       
!       for (t = input_operands; t; t = TREE_CHAIN (t))
! 	TREE_VALUE (t) = decay_conversion (TREE_VALUE (t));
!       
!       c_expand_asm_operands (string, output_operands,
! 			     input_operands, 
! 			     clobbers,
! 			     cv_qualifier != NULL_TREE,
! 			     input_filename, lineno);
!     }
    else
      expand_asm (string);
    
--- 1341,1351 ----
    emit_line_note (input_filename, lineno);
    if (output_operands != NULL_TREE || input_operands != NULL_TREE
        || clobbers != NULL_TREE)
!     c_expand_asm_operands (string, output_operands,
! 			   input_operands, 
! 			   clobbers,
! 			   cv_qualifier != NULL_TREE,
! 			   input_filename, lineno);
    else
      expand_asm (string);
    
*************** finish_asm_stmt (cv_qualifier, string, o
*** 1373,1378 ****
--- 1366,1373 ----
       tree clobbers;
  {
    tree r;
+   tree t;
+ 
    if (TREE_CHAIN (string))
      string = combine_strings (string);
  
*************** finish_asm_stmt (cv_qualifier, string, o
*** 1383,1388 ****
--- 1378,1387 ----
  		  IDENTIFIER_POINTER (cv_qualifier));
        cv_qualifier = NULL_TREE;
      }
+ 
+   if (!processing_template_decl)
+     for (t = input_operands; t; t = TREE_CHAIN (t))
+       TREE_VALUE (t) = decay_conversion (TREE_VALUE (t));
  
    r = build_min_nt (ASM_STMT, cv_qualifier, string,
  		    output_operands, input_operands,

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