[Tinyos-devel] FTSP not working with mspgcc 4.5.3 and -Os

Peter Bigot bigotp at acm.org
Tue Feb 21 10:41:16 PST 2012

On Tue, Feb 21, 2012 at 12:39 PM, Peter Bigot <bigotp at acm.org> wrote:
> On Mon, Feb 20, 2012 at 12:12 AM, Philip Levis <pal at cs.stanford.edu> wrote:
>> On Feb 19, 2012, at 9:42 PM, Thomas Schmid wrote:
>>> Hi all,
>>> We found a bug in msp430-gcc 4.5.3 while compiling FTSP (more
>>> specifically FtspLpl). It took us a while to pinpoint the problem, but
>>> it looks like mspgcc's optimization makes a mistake when multiplying
>>> two 64-bit integers (lines 216 and 217 in TimeSyncP.nc). For some
>>> reason, those multiplications produce super big numbers, even if the
>>> inputs are small. Turning off -Os and using -O1 or -O2 fixes the
>>> problem, and the multiplications work. Going one higher to -O3 has the
>>> same result as -Os.
>>> I looked at the diffs of the disassembled code of the binaries, and
>>> there is clearly a difference in those sections. However, my msp430
>>> assembly isn't good enough to actually understand what the problem
>>> could be.
>>> Any suggestions on how to track this further down?
>> Peter Bigot (cc'd) is a major contributor to msp430-gcc. Maybe he can provide some insight.
> Based on the test program you supplied (thank you) and my
> experimentation, you're using a version of mspgcc that does not have
> the patch for https://sourceforge.net/tracker/?func=detail&aid=3390964&group_id=42303&atid=432701

Sorry, wrong link: the real problem is this one:


> A build of LTS-20110716 with patches through 20110830 showed the
> problem on your test case; rebuilding with the patch set through
> 20110921 failed to reproduce the problem.
> Please make sure the mspgcc you are using is LTS-20110716 with all
> current official patches.  Patches are available at
> https://sourceforge.net/projects/mspgcc/files/Patches/LTS/20110716/.
> I know Eric Decker has expressed concern that the official TinyOS
> debian packages are not up to date; I'm not sure why, as I believe the
> same person takes care of those for both TinyProd and TinyOS.  I don't
> use Ubuntu/Debian systems so can't verify any binary distributions.
> Peter
>> Phil

More information about the Tinyos-devel mailing list