public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27426]  New: optimization results in wrong argument passing
@ 2006-05-04 16:00 puvar at rambler-co dot ru
  2006-05-04 16:03 ` [Bug c++/27426] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: puvar at rambler-co dot ru @ 2006-05-04 16:00 UTC (permalink / raw)
  To: gcc-bugs

Expected output on little-endian machines:
DEF05678 

Real output with optimization -O2 (where ???? -- is trash):
DEF0????

Compilation command: g++ -O2 t.c

Program text:

#include <stdio.h>

typedef unsigned char uint08_t;
typedef unsigned short int uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long uint64_t;

int main()
{
   uint64_t val = uint64_t(0x123456789ABCDEF0);
   uint08_t h[6];
   *(uint16_t*)h = (val >> 32) & 0xffff;
   *(uint32_t*)(h + 2) = val & 0xffffffff;
   uint32_t res = *((uint32_t *)h);
   printf ("%08X\n", res);
   return 0;
}


-- 
           Summary: optimization results in wrong argument passing
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: puvar at rambler-co dot ru


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


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

* [Bug c++/27426] optimization results in wrong argument passing
  2006-05-04 16:00 [Bug c++/27426] New: optimization results in wrong argument passing puvar at rambler-co dot ru
@ 2006-05-04 16:03 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-04 16:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-05-04 16:02 -------


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


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2006-05-04 16:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-04 16:00 [Bug c++/27426] New: optimization results in wrong argument passing puvar at rambler-co dot ru
2006-05-04 16:03 ` [Bug c++/27426] " pinskia at gcc dot gnu dot 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).