Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Has any one faced optmization problem using gnu arm gcc

2005-01-20 by Rick Collins

--- In lpc2000@yahoogroups.com, "Karl Olsen" <kro@p...> wrote:
> 
> --- In lpc2000@yahoogroups.com, vijayasarathy T <tvsarathy@g...> 
> wrote:
> > Hi,
> > 
> >      Iam using GNU arm gcc compiler for LPC2104 , when i use 
> >    
> >      while( !( SCB_PLLSTAT & PLL_LOCK ) );) 
> > 
> >       this statement, the assembly codes are not generated for other
> > instruction      below this statement. do any one have a suggestion.
> 
> Probably (SCB_PLLSTAT & PLL_LOCK) is always false, so the while loop 
> is infinite.  Code after an infinite loop would never be executed, so 
> GCC optimizes it away.

That would be my bet.  I expect that SCB_PLLSTAT and PLL_LOCK are
constants, intended to select a bit from a status word.  Just ANDing
them together produces a zero which is never true.  The OP needs to
read the status word and use these constants to select the bits for
the while condition.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.