public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/68098] New: Function multiversioning causes segfaults when used for member functions
@ 2015-10-26 10:35 egor.kochetov at intel dot com
  2021-08-12  4:37 ` [Bug c++/68098] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: egor.kochetov at intel dot com @ 2015-10-26 10:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68098

            Bug ID: 68098
           Summary: Function multiversioning causes segfaults when used
                    for member functions
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: egor.kochetov at intel dot com
  Target Milestone: ---

Here is the source that triggers runtime segmentation fault when compiled by
`g++` versions 4.9 through 6.0 trunk.

#include <cstdio>

class Foo {
public:

    /* Default version of foo.  */
    __attribute__ ((target("default")))
    int foo () { return 0; }

    /* SSSE3 version of foo.  */
    __attribute__ ((target("ssse3")))
    int foo () { return 0; }
};

int main () {
    Foo f;
    typedef int (Foo::* funcptr)();
    funcptr fp = &Foo::foo;

    j = (f.*fp)(); //< segfault here
    // f.foo(); //< works as expected

    printf ("all good\n");
    return 0;
}

The problem occurs only if the version function is accessed by a
member-function ponter, direct function call works as expected.

Compilation and target platforms are Linux 64 bit, -O0 throug -Ofast, -m32 or
-m64.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/68098] Function multiversioning causes segfaults when used for member functions
  2015-10-26 10:35 [Bug c++/68098] New: Function multiversioning causes segfaults when used for member functions egor.kochetov at intel dot com
@ 2021-08-12  4:37 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-12  4:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68098

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 57546.

*** This bug has been marked as a duplicate of bug 57546 ***

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-12  4:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-26 10:35 [Bug c++/68098] New: Function multiversioning causes segfaults when used for member functions egor.kochetov at intel dot com
2021-08-12  4:37 ` [Bug c++/68098] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).