c++/1842: when using regparm-attribute on function pointer, it affects previous function pointer too
rat@scssoft.com
rat@scssoft.com
Fri Feb 2 13:16:00 GMT 2001
>Number: 1842
>Category: c++
>Synopsis: when using regparm-attribute on function pointer, it affects previous function pointer too
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Fri Feb 02 13:16:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Zbynek Vyskovsky
>Release: gcc version 2.95.3 20010125 (prerelease)
>Organization:
>Environment:
Debian Linux - sid. i386 compatible, no special environment for gcc, other information probably irrelevant
>Description:
When declaring two pointers to function, and the second one with attribute regparm(3), it affects the first pointer too (when generating the code). See assembler-output for details.
>How-To-Repeat:
Run gcc -S regparm_bug.cc and see how f1 is called. Its arguments are passed via registers, although it wasn't declared with regparm attribute.
>Fix:
There is possibility to add regparm-attribute on the end of declaration, but it makes portability (on other compilers) much more tough.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/x-c++src; name="regparm_bug.cc.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="regparm_bug.cc.gz"
H4sIAN4bezoCA1WNsQrDMAxEd32FIIuUqU7HfIxxiRw0xDWqUgql/147Q2luO453b1gkaxFMtj5Q
i6MCyMvFCj7vuiCNOTD1lefzEGNyN73tLjESmaw12UZXZsYxTz8Ihj9FxQDQNVvSQv2I4Q3YksMB
1EYcdTpVE9+b+TLDB77p5uYkswAAAA==
More information about the Gcc-bugs
mailing list