public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61082] New: [x86-64 Itanium ABI] g++ uses wrong return location for class with head padding
@ 2014-05-06 19:04 greened at obbligato dot org
  2014-05-07  2:08 ` [Bug c++/61082] " greened at obbligato dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: greened at obbligato dot org @ 2014-05-06 19:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61082

            Bug ID: 61082
           Summary: [x86-64 Itanium ABI] g++ uses wrong return location
                    for class with head padding
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: greened at obbligato dot org

Created attachment 32745
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32745&action=edit
Testcase

gcc appears to use the wrong sequence for returning an object with head
padding.

For the attached testcase, gcc -O2 generates the following code for function
foo:

    .globl    _Z3fooR1Y
    .type    _Z3fooR1Y, @function
_Z3fooR1Y:
.LFB1019:
    .cfi_startproc
    movq    8(%rdi), %rax
    ret
    .cfi_endproc

The class Y should be classified INTEGER under the x86-64 ABI.  It has eight
bytes of head padding because it inherits from an empty base class and has a
member that also inherits from the same empty base class.  By my reading of the
ABI, foo should return the Y object in (RAX, RDX), with RDX containing the
meaningful bits (the long value).

The Intel compiler generates the code I would expect for this testcase.


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

end of thread, other threads:[~2014-05-08  7:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-06 19:04 [Bug c++/61082] New: [x86-64 Itanium ABI] g++ uses wrong return location for class with head padding greened at obbligato dot org
2014-05-07  2:08 ` [Bug c++/61082] " greened at obbligato dot org
2014-05-07  2:27 ` pinskia at gcc dot gnu.org
2014-05-07 10:27 ` redi at gcc dot gnu.org
2014-05-07 14:51 ` greened at obbligato dot org
2014-05-07 14:58 ` greened at obbligato dot org
2014-05-07 15:46 ` hjl.tools at gmail dot com
2014-05-07 16:05 ` greened at obbligato dot org
2014-05-07 17:07 ` hjl.tools at gmail dot com
2014-05-07 17:14 ` greened at obbligato dot org
2014-05-07 17:29 ` hjl.tools at gmail dot com
2014-05-07 17:47 ` greened at obbligato dot org
2014-05-07 18:02 ` greened at obbligato dot org
2014-05-07 20:08 ` greened at obbligato dot org
2014-05-08  7:54 ` rguenth 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).