This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH: ASMs and function-at-a-time
- To: gcc-patches at gcc dot gnu dot org
- Subject: C++ PATCH: ASMs and function-at-a-time
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Fri, 30 Jun 2000 12:14:46 -0700
- Organization: CodeSourcery, LLC
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,