IECS / MansOS

MansOS WSN/embedded operating system
MIT License
9 stars 4 forks source link

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

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 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

elomage commented 8 years ago

Could not repeat the issue. Perhaps, the updated compiler resolves it.