public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/28196]  New: miscompiled initialization of a constant pointer reference with offset (ppc64 target)
@ 2006-06-28 20:44 inbox at b-q-c dot com
  2006-06-28 20:47 ` [Bug c/28196] " inbox at b-q-c dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: inbox at b-q-c dot com @ 2006-06-28 20:44 UTC (permalink / raw)
  To: gcc-bugs

The following code is miscompiled when using -m64 (=ppc64) target:

const static double a = 1.0;
const static double *b = (double*)&a - 1;

&b[1] should be &a, but it's not - there is an additional offset of 0x10000


-- 
           Summary: miscompiled initialization of a constant pointer
                    reference with offset (ppc64 target)
           Product: gcc
           Version: 4.0.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: inbox at b-q-c dot com
 GCC build triplet: powerpc-apple-darwin8.6
  GCC host triplet: powerpc-apple-darwin8.6
GCC target triplet: powerpc-apple-darwin8.6 (ppc64)


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


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

* [Bug c/28196] miscompiled initialization of a constant pointer reference with offset (ppc64 target)
  2006-06-28 20:44 [Bug c/28196] New: miscompiled initialization of a constant pointer reference with offset (ppc64 target) inbox at b-q-c dot com
@ 2006-06-28 20:47 ` inbox at b-q-c dot com
  2006-06-28 20:50 ` inbox at b-q-c dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: inbox at b-q-c dot com @ 2006-06-28 20:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from inbox at b-q-c dot com  2006-06-28 20:44 -------
Created an attachment (id=11774)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11774&action=view)
test case - returns 0 on success or 1 when miscompiled

gcc -m64 -o gcc64bug gcc64bug.c

Inspection of the a and b will show:
a = 1fe8
b = 100001fe0


-- 


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


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

* [Bug c/28196] miscompiled initialization of a constant pointer reference with offset (ppc64 target)
  2006-06-28 20:44 [Bug c/28196] New: miscompiled initialization of a constant pointer reference with offset (ppc64 target) inbox at b-q-c dot com
  2006-06-28 20:47 ` [Bug c/28196] " inbox at b-q-c dot com
@ 2006-06-28 20:50 ` inbox at b-q-c dot com
  2006-06-28 20:51 ` inbox at b-q-c dot com
  2006-06-28 21:15 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: inbox at b-q-c dot com @ 2006-06-28 20:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from inbox at b-q-c dot com  2006-06-28 20:47 -------
The original description should state that there is an additional offset of
0x100000000 (it said 0x10000 instead).
Also this bug is reproducible with earlier version of gcc such as 4.0.1 as
supplied by Apple.


-- 


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


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

* [Bug c/28196] miscompiled initialization of a constant pointer reference with offset (ppc64 target)
  2006-06-28 20:44 [Bug c/28196] New: miscompiled initialization of a constant pointer reference with offset (ppc64 target) inbox at b-q-c dot com
  2006-06-28 20:47 ` [Bug c/28196] " inbox at b-q-c dot com
  2006-06-28 20:50 ` inbox at b-q-c dot com
@ 2006-06-28 20:51 ` inbox at b-q-c dot com
  2006-06-28 21:15 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: inbox at b-q-c dot com @ 2006-06-28 20:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from inbox at b-q-c dot com  2006-06-28 20:50 -------
Created an attachment (id=11775)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11775&action=view)
output of gcc -v


-- 


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


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

* [Bug c/28196] miscompiled initialization of a constant pointer reference with offset (ppc64 target)
  2006-06-28 20:44 [Bug c/28196] New: miscompiled initialization of a constant pointer reference with offset (ppc64 target) inbox at b-q-c dot com
                   ` (2 preceding siblings ...)
  2006-06-28 20:51 ` inbox at b-q-c dot com
@ 2006-06-28 21:15 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-28 21:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-06-28 21:05 -------
        .quad   _a-8


Not a GCC bug, a bug in the cctools assembler/linker, report this to Apple.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2006-06-28 21:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-28 20:44 [Bug c/28196] New: miscompiled initialization of a constant pointer reference with offset (ppc64 target) inbox at b-q-c dot com
2006-06-28 20:47 ` [Bug c/28196] " inbox at b-q-c dot com
2006-06-28 20:50 ` inbox at b-q-c dot com
2006-06-28 20:51 ` inbox at b-q-c dot com
2006-06-28 21:15 ` 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).