vaibhav90 / mansos

Automatically exported from code.google.com/p/mansos
0 stars 0 forks source link

kernel/threads/threads.c generates a warning when compiled with -O0 #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce the problem:
1. Go to tests/ExpThreadTests/1a-Blink-mdelay
2. Disable compiler optimization (add -O0 to CFLAGS)
3. Type 'make telosb'

What is the expected output? What do you see instead?
The compiler generates a warning which seems important:
../../../../mos/kernel/threads/threads.c: In function 'schedule':
../../../../mos/kernel/threads/threads.c:256:18: warning: function requires 4 
bytes for stack storage but frame allocation inhibited by 'naked' [-Wattributes]
../../../../mos/kernel/threads/threads.c:256:18: warning: frame allocation 
destroys caller register due to 'task' [-Wattributes]

Version (SVN revision) of MansOS: 340

Any additional information below:
msp430-gcc (mspgcc_20120406) 4.6.3 20120301 (mspgcc LTS 20120406 unpatched)

I can get rid of half of the warning with

    __attribute__((__optimize__("omit-frame-pointer")))

or of all of it altogether with

    __attribute__((__optimize__("Os")))

But this isn't an ideal solution.

Original issue reported on code.google.com by andrey.vihrov on 17 Jul 2012 at 7:47