This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Serious code generation/optimisation bug (I think)


On Thu, 29 Jan 2009 08:53:10 +0000
Andrew Haley <aph@redhat.com> wrote:

> Erik Trulsson wrote:
> > On Wed, Jan 28, 2009 at 04:39:39PM +0000, Andrew Haley wrote:
> 
> >> "6.3.2.3 Pointers
> >>
> >> If a null pointer constant is converted to a pointer type, the
> >> resulting pointer, called a null pointer, is guaranteed to compare
> >> unequal to a pointer to any object or function."
> >>
> >> This implies that a linker cannot place an object at address zero.
> > 
> > Wrong.  There is nothing which requires a null pointer to be
> > all-bits-zero (even though that is by far the most common
> > representation of null pointers.)
> 
> We're talking about gcc on ARM.  gcc on ARM uses 0 for the null
> pointer constant, therefore a linker cannot place an object at
> address zero. All the rest is irrelevant.
> 
> Andrew.

Um, the linker *must* place the vector table at address zero, because
the ARM, at least the ARM7TDMI fetches all exception vectors from
there. Dictated by the HW, not the compiler.

Zoltan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]