Nathan Froyd wrote:
> On 9/21/2011 5:49 AM, Georg-Johann Lay wrote:
>> As proposed in PR45099, avr-gcc will now just print a warning instead
>> of an
>> error when a fixed register is needed to pass a parameter to a function.
> 
> Where's the proposal in the PR?  I see a problem report that was
> addressed four months ago by adding an error, the addition of an error
> message, an explanation of why we're issuing an error message, and then
> this commit, which changes the error back into a warning (!).

The initial state up to 4.6 was that there was no diagnosis at allwhen
a fixed register overlapped a parameter.
My patch in #c1 (trunk r173791) used error as diagnosis.

> I guess the original report proposed a warning, 

Yes, the OP proposes a warning in #c0 of the PR.

> but an error seems like a *much* better idea.
> Better to tell the user early that things are
> going to break, IMHO.

Initially, I was of the same opinion.  Now I think a warning
is more appropriately because the compiler should not try to be
smarter than it actually is/can be.

One example: the user uses a function to initialize his application
before setting up the global registers.  There are other scenarios
imaginable.

So I think a warning is better than an error because the user can
inspect the code and take the decision if he is fine with it or not
and is not patronized by the compiler.

For example, if the user gets a hint that fixed reg collides with
a function call, he can save/restore the global register around
the call.

It's not possible to tell what the user strives to do
with the fixed register; the important thing is that there is
some message that there *might* be a problem.

We cannot conclude more.

Johann

> -Nathan

Reply via email to