public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61976] New: aix64: Data corruption in struct passed by value
@ 2014-07-31 12:27 lbl2007 at gmx dot net
  2014-07-31 13:13 ` [Bug target/61976] " redi at gcc dot gnu.org
  2015-02-10 19:26 ` dje at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: lbl2007 at gmx dot net @ 2014-07-31 12:27 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61976
           Summary: aix64: Data corruption in struct passed by value
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lbl2007 at gmx dot net

Test program:
   #include <stdio.h>

   struct Demo { float a; };

   void foo( const Demo byval, const Demo &byref )
   {
      printf( "byval: %f\n", (double) byval.a );
      printf( "byref: %f\n", (double) byref.a );
   }

   int main()
   {
      Demo a = { 1.23 };
      foo( a, a );
      return 0;
   }

When I compile and run this under AIX, the first argument is corrupted:

    g++ -maix64 -o demo demo.c
    ./demo
    byval: -0.000000
    byref: 1.230000

The problem does not occur with -maix32

GCC version:
Target: powerpc-ibm-aix6.1.0.0
Configured with: /common/mringe/gcc47_alt/gcc-4.7.2/configure
--prefix=/common/mringe/gcc47_alt/local --with-as=/usr/bin/as
--with-ld=/usr/bin/ld --enable-languages=c,c++ --enable-threads --disable-nls
--disable-shared --with-gmp=/common/mringe/gcc47_alt/local
--with-mpfr=/common/mringe/gcc47_alt/local
--with-mpc=/common/mringe/gcc47_alt/local
Thread model: aix
gcc version 4.7.2 (GCC)


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

* [Bug target/61976] aix64: Data corruption in struct passed by value
  2014-07-31 12:27 [Bug c++/61976] New: aix64: Data corruption in struct passed by value lbl2007 at gmx dot net
@ 2014-07-31 13:13 ` redi at gcc dot gnu.org
  2015-02-10 19:26 ` dje at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2014-07-31 13:13 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |powerpc-ibm-aix*
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-07-31
          Component|c++                         |target
     Ever confirmed|0                           |1
      Known to fail|                            |4.8.1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
GCC 4.7 is no longer supported, but I can conform the bug with GCC 4.8.1 on
powerpc-ibm-aix7.1.0.0


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

* [Bug target/61976] aix64: Data corruption in struct passed by value
  2014-07-31 12:27 [Bug c++/61976] New: aix64: Data corruption in struct passed by value lbl2007 at gmx dot net
  2014-07-31 13:13 ` [Bug target/61976] " redi at gcc dot gnu.org
@ 2015-02-10 19:26 ` dje at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: dje at gcc dot gnu.org @ 2015-02-10 19:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from David Edelsohn <dje at gcc dot gnu.org> ---
This is caused by the GCC aggregate (struct) padding implementation for AIX.


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

end of thread, other threads:[~2015-02-10 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-31 12:27 [Bug c++/61976] New: aix64: Data corruption in struct passed by value lbl2007 at gmx dot net
2014-07-31 13:13 ` [Bug target/61976] " redi at gcc dot gnu.org
2015-02-10 19:26 ` dje 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).