Calling through a member function pointer that points to a member function that
has been declared with __attribute((regparm(3))) silently generates incorrect
code. This is true even if the member function pointer has been declared with
the regparm(3) attribute:
int ((__attribute((regparm(3))) FOO::*mfptr )(int));
STL has "functor" classes built upon member functions, which is where this
first popped up for me.
GCC4.2.1 on Linux-x86
--
Summary: member-function pointers + regarm(3) == incorrect code
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bruce_pedersen at altera dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34468