This is the mail archive of the gcc-bugs@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++ bug in asm() statements


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)
	);
}



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