This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/49798] .quad instead of .long is used for address for x32
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 Jul 2011 14:02:59 +0000
- Subject: [Bug target/49798] .quad instead of .long is used for address for x32
- Auto-submitted: auto-generated
- References: <bug-49798-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49798
--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> 2011-07-21 14:02:54 UTC ---
(In reply to comment #5)
> (In reply to comment #4)
>
> > > Linker should put correct address (so, zero extended 32bit address) here.
> >
> > Did you mean assembler? In many cases, .quad is still simply wrong (PR 47446).
>
> No, the linker. But looking at mentioned PR, linker is not able to generate
> BFD_RELOC_64.
That is correct. We shouldn't have BFD_RELOC_64 in 32bit.
> > GCC shouldn't generate .quad in this case. A patch is posted at
> >
> > http://gcc.gnu.org/ml/gcc-patches/2011-07/msg01711.html
>
> IMO, this patch is wrong. Generated code should look like the one for i686, so
> it looks to me that check for Pmode != ptr_mode is missing somewhere in the
> middle end.
That is not necessarily true if Pmode is used here.
In this regard, x32 is the same as x86-64. Basically
a 64bit value is generated from an address. If address
is 32bit, we just need to zero-extend it.