[U-Boot] [PATCH] powerpc: fix register usage in some inline assembly code

Kumar Gala kumar.gala at freescale.com
Wed Dec 15 15:01:22 CET 2010


On Dec 15, 2010, at 6:32 AM, Tabi Timur-B04825 wrote:

> Wolfgang Denk wrote:
>> In message<1292368731-3819-1-git-send-email-timur at freescale.com>  you wrote:
>>>> In some usages of inline assembly, hard-coded registers were specified when a
>>>> scratch register should have been used instead.
> 
>> Is this just a cosmetic improvement, or are you fixing any real bug?
>> If so, what exactly is the problem?
> 
> Well, I'm not a expert on inline assembly, so I could be missing something, but IMHO it is fixing a real bug, although the current code does technically work.
> 
> The problem is that the code was modifying registers and gcc was unaware of that.  So there is a possibility that gcc could have put something important in those registers.  It appears that the authors of that code knew which registers were unused, and just made sure to use those.

I doubt we disagree that the change is a good one, just trying to understand if it was because of an actual issue you where seeing or just because of some code review that you made it.

ie, is this needed in v2010.12 or goes into 'next'

- k


More information about the U-Boot mailing list