Yahoo Groups archive

Lpc2000

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

Thread

Global arrays

Global arrays

2006-05-26 by vineet jain

Hello group,
    My application fails to give the correct output when I define a global array of size 1024 int type. When I make it local to a function it gives the correct output.
  The above is true for -o3 level optimization.
  
  But when I make the array global and o0 optimization, it gives the correct output.
  
  Any idea what the compiler would be doing in o3 level optimization to the global array.
  
  Kindly suggest.
  
  Regards,
  Vineet.
  
  
		
---------------------------------
Feel free to call! Free PC-to-PC calls. Low rates on PC-to-Phone.  Get Yahoo! Messenger with Voice

[Non-text portions of this message have been removed]

Re: [lpc2000] Global arrays

2006-05-26 by Tom Walsh

vineet jain wrote:

>Hello group,
>    My application fails to give the correct output when I define a global array of size 1024 int type. When I make it local to a function it gives the correct output.
>  The above is true for -o3 level optimization.
>  
>  But when I make the array global and o0 optimization, it gives the correct output.
>  
>  Any idea what the compiler would be doing in o3 level optimization to the global array.
>  
>  
>
The boingboing ARM compiler version 198 is broken, don't use -O3

TomW

-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: Global arrays

2006-05-26 by brendanmurphy37

--- In lpc2000@yahoogroups.com, Tom Walsh <tom@...> wrote:
> The boingboing ARM compiler version 198 is broken, don't use -O3
> 
> TomW

boingboing?

RE: [lpc2000] Re: Global arrays

2006-05-26 by Eric Rullens

> --- In lpc2000@yahoogroups.com, Tom Walsh <tom@...> wrote:
> > The boingboing ARM compiler version 198 is broken, don't use -O3
> > 
> > TomW
> 
> boingboing?

Yeah, the same goes for the bzzztbzzzt ARM compiler v2.01c....

  Eric

RE: [lpc2000] Re: Global arrays

2006-05-26 by vineet jain

Guys,
    I need to use that option for speed. Can't get away with that.
  
  Any other pointers?
  
  Regards,
  Vineet.

Eric Rullens <gorilla@...> wrote:        > --- In lpc2000@yahoogroups.com, Tom Walsh <tom@...> wrote:
  > > The boingboing ARM compiler version 198 is broken, don't use -O3
  > > 
  > > TomW
  > 
  > boingboing?
  
  Yeah, the same goes for the bzzztbzzzt ARM compiler v2.01c....
  
    Eric
                  

          SPONSORED LINKS    
                                                        Microcontrollers                                          Microprocessor                                          Intel microprocessors                                                                             
        
---------------------------------
    YAHOO! GROUPS LINKS  
  
      
    Visit your group "lpc2000" on the web.
     
    To unsubscribe from this group, send an email to:
 lpc2000-unsubscribe@yahoogroups.com
     
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.  
  
      
---------------------------------
  
  
          

		
---------------------------------
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail Beta.

[Non-text portions of this message have been removed]

Re: [lpc2000] Re: Global arrays

2006-05-26 by Bertrik Sikken

Is -O2 not enough?

Perhaps you can see what is happening by checking the generated
assembly between the -O0 and -O3?

Regards,
Bertrik

vineet jain wrote:
Show quoted textHide quoted text
> Guys,
>     I need to use that option for speed. Can't get away with that.
>   
>   Any other pointers?
>   
>   Regards,
>   Vineet.
> 
> Eric Rullens <gorilla@...> wrote:        > --- In lpc2000@yahoogroups.com, Tom Walsh <tom@...> wrote:
>   > > The boingboing ARM compiler version 198 is broken, don't use -O3
>   > > 
>   > > TomW
>   > 
>   > boingboing?
>   
>   Yeah, the same goes for the bzzztbzzzt ARM compiler v2.01c....

Re: Global arrays

2006-05-26 by brendanmurphy37

First off, it's not clear whether the problem is global/local or -O3/-
O0, as you seem to say that changing two things broke the code.

I'd recommend:

1. Get exactly two cases, with only one change between them with one 
correct and one incorrect. You then have a basis for looking for the 
source of the problem. That is, change only one thing at a time.

2. Look at the assembler o/p from the compiler: it'll probably give 
some clues.

By the way, which compiler are you using?

Brendan


--- In lpc2000@yahoogroups.com, vineet jain <vineetrvce@...> wrote:
>
> Guys,
>     I need to use that option for speed. Can't get away with that.
>   
>   Any other pointers?
>   
>   Regards,
>   Vineet.
> 
> Eric Rullens <gorilla@...> wrote:        > --- In 
lpc2000@yahoogroups.com, Tom Walsh <tom@> wrote:
>   > > The boingboing ARM compiler version 198 is broken, don't use -
O3
>   > > 
>   > > TomW
>   > 
>   > boingboing?
>   
>   Yeah, the same goes for the bzzztbzzzt ARM compiler v2.01c....
>   
>     Eric
>                   
> 
>           SPONSORED LINKS    
>                                                         
Microcontrollers                                          
Microprocessor                                          Intel 
microprocessors                                                       
                      
>         
> ---------------------------------
>     YAHOO! GROUPS LINKS  
>   
>       
>     Visit your group "lpc2000" on the web.
>      
>     To unsubscribe from this group, send an email to:
>  lpc2000-unsubscribe@yahoogroups.com
>      
>     Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.  
Show quoted textHide quoted text
>   
>       
> ---------------------------------
>   
>   
>           
> 
> 		
> ---------------------------------
> Do you Yahoo!?
>  Get on board. You're invited to try the new Yahoo! Mail Beta.
> 
> [Non-text portions of this message have been removed]
>

RE: [lpc2000] Re: Global arrays

2006-05-26 by Eric Rullens

Vineet,

>     I need to use that option for speed. Can't get away with that.
>   
>   Any other pointers?

It would help if you told what compiler (+version, platform etc.) you are
using. Also you might want to look at the code generated by your compiler to
get a clue about what it is doing... You may want to code that specific
section in assembly if speed really is an issue.

And if you do not find the problem, perhaps post a minimal code sample that
produces the same issue.

  Eric
Show quoted textHide quoted text
> Eric Rullens <gorilla@...> wrote:        > --- In 
> lpc2000@yahoogroups.com, Tom Walsh <tom@...> wrote:
>   > > The boingboing ARM compiler version 198 is broken, don't use -O3
>   > > 
>   > > TomW
>   > 
>   > boingboing?
>   
>   Yeah, the same goes for the bzzztbzzzt ARM compiler v2.01c....
>   
>     Eric

RE: [lpc2000] Re: Global arrays

2006-05-26 by balaji cr

Make it a static variable in a function and see if the
compiler treats it nicely.

Balaji

--- vineet jain <vineetrvce@...> wrote:

> Guys,
>     I need to use that option for speed. Can't get
> away with that.
>   
>   Any other pointers?
>   
>   Regards,
>   Vineet.
> 
> Eric Rullens <gorilla@...> wrote:        > --- In
> lpc2000@yahoogroups.com, Tom Walsh <tom@...> wrote:
>   > > The boingboing ARM compiler version 198 is
> broken, don't use -O3
>   > > 
>   > > TomW
>   > 
>   > boingboing?
>   
>   Yeah, the same goes for the bzzztbzzzt ARM
> compiler v2.01c....
>   
>     Eric
>                   
> 
>           SPONSORED LINKS    
>                                                     
>    Microcontrollers                                 
>         Microprocessor                              
>            Intel microprocessors                    
>                                                     
>    
>         
> ---------------------------------
>     YAHOO! GROUPS LINKS  
>   
>       
>     Visit your group "lpc2000" on the web.
>      
>     To unsubscribe from this group, send an email
> to:
>  lpc2000-unsubscribe@yahoogroups.com
>      
>     Your use of Yahoo! Groups is subject to the
> Yahoo! Terms of Service.  
>   
>       
> ---------------------------------
>   
>   
>           
> 
> 		
> ---------------------------------
> Do you Yahoo!?
>  Get on board. You're invited to try the new Yahoo!
> Mail Beta.
> 
> [Non-text portions of this message have been
> removed]
> 
> 


Dream is just a dream.  A goal is a dream with a plan and a deadline.
- Harvey Mackay

RE: [lpc2000] Re: Global arrays

2006-05-26 by vineet jain

Hello again,
    I am using the armcc compiler from ARM itself. Also I already  tried the static option. Doesn't quite work. Thanks for that.
  
  Difficult to understand the disassembly code comparsion b/n o0 and o3.
  
  Anyways thanks for all your comments. I'll do what I can.
  
  Cheers,
  Vineet.

Eric Rullens <gorilla@...> wrote:        Vineet,
  
  >     I need to use that option for speed. Can't get away with that.
  >   
  >   Any other pointers?
  
  It would help if you told what compiler (+version, platform etc.) you are
  using. Also you might want to look at the code generated by your compiler to
  get a clue about what it is doing... You may want to code that specific
  section in assembly if speed really is an issue.
  
  And if you do not find the problem, perhaps post a minimal code sample that
  produces the same issue.
  
    Eric
  
  
  
  
  > Eric Rullens <gorilla@...> wrote:        > --- In 
  > lpc2000@yahoogroups.com, Tom Walsh <tom@...> wrote:
  >   > > The boingboing ARM compiler version 198 is broken, don't use -O3
  >   > > 
  >   > > TomW
  >   > 
  >   > boingboing?
  >   
  >   Yeah, the same goes for the bzzztbzzzt ARM compiler v2.01c....
  >   
  >     Eric
                  

          SPONSORED LINKS    
                                                        Microcontrollers                                          Microprocessor                                          Intel microprocessors                                                                             
        
---------------------------------
    YAHOO! GROUPS LINKS  
  
      
    Visit your group "lpc2000" on the web.
     
    To unsubscribe from this group, send an email to:
 lpc2000-unsubscribe@yahoogroups.com
     
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.  
  
      
---------------------------------
  
  
          

			
---------------------------------
Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better. 

[Non-text portions of this message have been removed]

Re: Global arrays

2006-05-26 by brendanmurphy37

It's unlikely to be a compiler problem with optimisation: I believe 
the ARM compiler to be very reliable in terms of producing correct 
code.

You don't say anything about the exact failure mode.

I'd suggest removing as much as possible to get as small an example 
as possible of the problematic code, and work from there.

Brendan

--- In lpc2000@yahoogroups.com, vineet jain <vineetrvce@...> wrote:
>
> Hello again,
>     I am using the armcc compiler from ARM itself. Also I already  
tried the static option. Doesn't quite work. Thanks for that.
>   
>   Difficult to understand the disassembly code comparsion b/n o0 
and o3.
>   
>   Anyways thanks for all your comments. I'll do what I can.
>   
>   Cheers,
>   Vineet.
> 
> Eric Rullens <gorilla@...> wrote:        Vineet,
>   
>   >     I need to use that option for speed. Can't get away with 
that.
>   >   
>   >   Any other pointers?
>   
>   It would help if you told what compiler (+version, platform etc.) 
you are
>   using. Also you might want to look at the code generated by your 
compiler to
>   get a clue about what it is doing... You may want to code that 
specific
>   section in assembly if speed really is an issue.
>   
>   And if you do not find the problem, perhaps post a minimal code 
sample that
>   produces the same issue.
>   
>     Eric
>   
>   
>   
>   
>   > Eric Rullens <gorilla@...> wrote:        > --- In 
>   > lpc2000@yahoogroups.com, Tom Walsh <tom@> wrote:
>   >   > > The boingboing ARM compiler version 198 is broken, don't 
use -O3
>   >   > > 
>   >   > > TomW
>   >   > 
>   >   > boingboing?
>   >   
>   >   Yeah, the same goes for the bzzztbzzzt ARM compiler v2.01c....
>   >   
>   >     Eric
>                   
> 
>           SPONSORED LINKS    
>                                                         
Microcontrollers                                          
Microprocessor                                          Intel 
microprocessors                                                       
                      
>         
> ---------------------------------
>     YAHOO! GROUPS LINKS  
>   
>       
>     Visit your group "lpc2000" on the web.
>      
>     To unsubscribe from this group, send an email to:
>  lpc2000-unsubscribe@yahoogroups.com
>      
>     Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.  
>   
>       
> ---------------------------------
>   
>   
>           
> 
> 			
> ---------------------------------
> Sneak preview the  all-new Yahoo.com. It's not radically different. 
Just radically better. 
Show quoted textHide quoted text
> 
> [Non-text portions of this message have been removed]
>

Re: [lpc2000] Re: Global arrays

2006-05-26 by Tom Walsh

brendanmurphy37 wrote:

>--- In lpc2000@yahoogroups.com, Tom Walsh <tom@...> wrote:
>  
>
>>The boingboing ARM compiler version 198 is broken, don't use -O3
>>
>>TomW
>>    
>>
>
>boingboing?
>
>
>  
>
sigh, my ESP powers seem to diminish with age.  I could have sworn that 
was the vendor he was using.  :(

TomW

>  
>


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

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.