LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Advertise
  • Mirrors
  • Logos
  • Contact us
  • Find Resources
  • Job Opportunity
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Openrisc > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: Matjaz Breskvar <phoenix@o...>
    Date: Tue, 6 May 2003 13:13:59 +0200
    Subject: Re: [openrisc] GCC problem
    Top

    * vbaksa@n... (vbaksa@n...) wrote:
    > During debugging a RTOS kernel I discovered that following statement 
    > caused the Link Address Register R9[LR] to be set to 0.  Because of this 
    > kernel crashed. 
    > RTOSTcbHigRdy = RTOSTcbPrioTbl[(y << 3) + RTOSUnMapTbl
    > [RTOSRdyTbl[y]]];
    > 
    > To avoid this problem and to make the kernel work I split the previous 
    > statement to following 3 statements: 
    >     i = RTOSRdyTbl[y];
    >     t = (y << 3) + RTOSUnMapTbl[i];
    >     RTOSTCBHighRdy = RTOSTCBPrioTbl[t];
    > 
    > Local variables and global arrays used in both cases are as follow:
    >     ULONG         y, t, i;                       // Locals
    >     ULONG         RTOSRdyTbl[];            // Global array
    >     ULONG         RTOSUnMapTbl[];        // Global array
    >     ULONG        *RTOSTCBPrioTbl[];      // Global array
    > 
    > I used following compiler options to build the kernel:
    >     rtostest-O0.o: rtostest.c
    >          or32-uclinux-gcc -g -O0 $? -c -o $@
    >     rtostest-O2.o: rtostest.c
    >          or32-uclinux-gcc -g -O2 $? -c -o $@
    > 
    > I believe that cause of the problem is how the gcc compiler handles 
    > multiple array indexing.  
    > Would you look at this problem and suggest which compiler option to use 
    > to avoid this kind of problems in the future.
    
    first i would suggest you try with gcc-3.2.3 (just added into
    cvs) and letting us know if it fixes your problem.
    
    p.
    
    
    

    ReferenceAuthor
    [openrisc] GCC problemVbaksa

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.