Setting build parameters for a sub-tree of RTEMS sources

Joel Sherrill joel.sherrill at OARcorp.com
Mon Apr 24 15:36:45 UTC 2000


Is -O4 allowed to reorder on the SH-2?  If so, it is possible that 
executing the statements in the order presented by the source is
incorrect and the reordered version is correct by the HW.

Is read8() a macro or subroutine?  Have you looked at the 
assembly generated at both levels to see if some obvious
set of operations is differently?  I know that when you are
missing volatile, the difference is amazingly clear this way.


"John M. Mills" wrote:
> 
> Nick,
> 
> On Mon, 24 Apr 2000 Nick.SIMON at syntegra.bt.co.uk wrote:
> > 'Fraid I don't know the answer to John's question, but I'm most concerned
> > about problems with 'volatile' - can anyone shed any light on this?
> 
> I don't know how general might be the problems, but the specifics are:
> 1) I am using Joel's 'rpms' for the sh-rtems toolset, essentially
>    gcc-2.95.2, I believe. I have not observed other problems with these
>    tools. (Thanks, Joel.)
> 2) I am staying close to Ralf Crosepius' SH-1 BSP, which provides macros
>    to read and write on-chip register. For example:
>    'c/src/exec/score/cpu/sh/rtems/score/sh_io.h' defines:
> '#define read8(addr)  (*(volatile unsigned8 *) (addr))'
> 
> so a line like:
>    'temp8 = read8(SOME_ONCHIP_REG);' should try to read the named byte.
> 
> My typical code then goes on to set and clear bits, then rewrites the
> register from 'temp8'.
> 
> I was failing to set some registers when (in gensh2.cfg) I used:
> CFLAGS_DEBUG_V= -O1
> 
> while the were being set successfully by:
> CFLAGS_DEBUG_V= -O4
> 
> Declaring 'volatile unsigned8 temp8;' had no effect on the failure.
> 
> I found the problem with enabling serial output, but I must assume it
> could be affecting my other hardware setup routines.
> 
> I haven't tried to see what '-O1' really implies, but it seems very
> aggressive with this processor ('-m2'), and does produce very compact
> executables. (A "_Good_Thing_"[TM]). It just seems toxic to my hardware
> setup. !(A "_Good_Thing_"[8-(])
> 
> I can send anyone snippets of the assembly-language results for the SCI
> registers; they're pretty short, but I didn't think they would be of
> general interest for such a specific case.
> 
> Thanks -
> 
>    John Mills
>    Sr. Software Engineer
>    TGA Technologies, Inc.
>    100 Pinnacle Way, Suite 140
>    Norcross, GA 30071-3633
>    e-mail: jmills at tga.com
>    Phone: 770-441-2100 ext.124 (voice)
>           770-449-7740 (FAX)

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985



More information about the users mailing list