This is the mail archive of the 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: Fix for recent execute/20010123-1.c regression on ppc-eabi

> Date: Fri, 28 Dec 01 07:47:52 EST
> From: (Richard Kenner)
> Cc:
>     but I can see no reason why an ADDR_EXPR would necessarily be of a
>     location that is stored only once,
> In general that's right, but this case is when it's being applied to a
> REG.  In that case, you compute the value of the REG once, so it is in
> this case.

???  I don't see why a REG would necessarily be stored only once.  In
fact, most REGs get stored many times.

>     and in fact execute/20010123-1.c
>     gives a case where it isn't: in
>       struct s *t = & (struct s) { 3, "hey there" };
> Hmm.  Two points:
> (1) Is that even valid?  Isn't the thing that we're taking the address of
> allowed to be in readonly memory since it's a constan?

Yes, this is valid.  GCC is required to create a writable temporary
which has life for the basic block.

> (2) Why aren't we taking the address of the constant instead of
> putting this into a register?

The constant might be in read-only memory.

- Geoffrey Keating <> <>

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