public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "andrey.vihrov at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug inline-asm/66279] New: Input/output asm operand is not loaded inside a constructor with a virtual base class Date: Mon, 25 May 2015 16:57:00 -0000 [thread overview] Message-ID: <bug-66279-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66279 Bug ID: 66279 Summary: Input/output asm operand is not loaded inside a constructor with a virtual base class Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: inline-asm Assignee: unassigned at gcc dot gnu.org Reporter: andrey.vihrov at gmail dot com Target Milestone: --- Created attachment 35620 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35620&action=edit Testcase When inline assembly is used inside a constructor of a class with a virtual base class, and the inline assembly block has an input/output operand, GCC fails to load the value of the operand into a corresponding register. The attached code, compiled with GCC 5.1, produces a.out: test.cpp:16: B::B(): Assertion `x == 42' failed. This happens with both -O2 and -O0. Remove 'virtual' or place the code in a regular function, and the assertion will succeed. Marking the ctor as inline also makes the assertion succeed. gcc -v: Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/5.1.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /build/gcc-multilib/src/gcc-5-20150519/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --with-default-libstdcxx-abi=c++98 Thread model: posix gcc version 5.1.0 (GCC)
next reply other threads:[~2015-05-25 16:57 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-05-25 16:57 andrey.vihrov at gmail dot com [this message] 2015-05-25 17:00 ` [Bug inline-asm/66279] " andrey.vihrov at gmail dot com 2024-03-12 7:45 ` [Bug c++/66279] [11/12/13/14 Regression] " pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-66279-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).