This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C++ bug in asm() statements
- To: bug-gcc at gnu dot org
- Subject: C++ bug in asm() statements
- From: Dave McWherter <davemcw at home dot com>
- Date: Tue, 09 May 2000 08:57:16 -0400
The GCC version - 2.95.2
The system type - Windows NT 4.0
All options you passed to the compiler - none
Preprocessed output of the source file that caused the compiler error, even
if the source code can be downloaded from elsewhere - see below
Calling a member function from an asm() statement causes a compiler crash.
build_component_ref() seems to build the COMPONENT_REF incorrectly - the
second operand is incorrect (I think). So later when the asm ops are
expanded, the calculation of 'size_tree' in get_inner_reference() produces
a garbage tree node and a subsequent crash when 'size_tree' is referenced.
The problem does not occur in versions 2.91.66 and lower.
Dave McWherter
dave@franklin.com
# 1 "testasm.cpp"
class myClass
{
public:
int myMember(void);
void call_it(void);
};
void
myClass::call_it(void)
{
asm (
"\t call %0 \n"
:
: "m" (myMember)
);
}