re PR c++/7015 (certain __asm__ constructs rejected)

cp:
2002-09-16  Nathan Sidwell  <nathan@codesourcery.com>

	PR c++/7015
	* semantic.c (finish_asm_stmt): Fix operand/output_operands
	thinko.
	* typeck.c (c_expand_asm_operands): Protect from error_mark_node.
testsuite
	* g++.dg/ext/asm3.C: New test.

From-SVN: r57192
This commit is contained in:
Nathan Sidwell 2002-09-16 14:34:02 +00:00 committed by Nathan Sidwell
parent a41c6c533d
commit 28c56d2569
5 changed files with 29 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
PR c++/7015
* semantic.c (finish_asm_stmt): Fix operand/output_operands
thinko.
* typeck.c (c_expand_asm_operands): Protect from error_mark_node.
2002-09-15 Nathan Sidwell <nathan@codesourcery.com>
PR c++/7919

View file

@ -929,7 +929,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
tree operand;
constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t)));
operand = TREE_VALUE (output_operands);
operand = TREE_VALUE (t);
if (!parse_output_constraint (&constraint,
i, ninputs, noutputs,

View file

@ -6045,9 +6045,10 @@ c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
else
{
tree type = TREE_TYPE (o[i]);
if (CP_TYPE_CONST_P (type)
|| (IS_AGGR_TYPE_CODE (TREE_CODE (type))
&& C_TYPE_FIELDS_READONLY (type)))
if (type != error_mark_node
&& (CP_TYPE_CONST_P (type)
|| (IS_AGGR_TYPE_CODE (TREE_CODE (type))
&& C_TYPE_FIELDS_READONLY (type))))
readonly_error (o[i], "modification by `asm'", 1);
}
}

View file

@ -1,3 +1,7 @@
2002-09-16 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/ext/asm3.C: New test.
2002-09-16 Richard Earnshaw <rearnsha@arm.com>
* objc.dg/bitfield-2.m (dg-options): Add -fsigned-char.

View file

@ -0,0 +1,13 @@
// { dg-do compile }
// Copyright (C) 2002 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 16 Sep 2002 <nathan@codesourcery.com>
// PR 7015. ICE with asms
int two(int in)
{
register int out;
__asm__ ("" : "r" (out) : "r" (in)); // { dg-error "output operand" "" }
return out;
}