[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] Trial fix for F9 / OpenSuSE / gcc 4.3 make check fail

From: Eric Blossom
Subject: [Discuss-gnuradio] Trial fix for F9 / OpenSuSE / gcc 4.3 make check failure (ticket:258)
Date: Thu, 14 Aug 2008 18:20:12 -0700
User-agent: Mutt/1.5.17 (2007-11-01)

Revision 9296 contains a a trial fix for the make check
problem we've been seeing with gcc 4.3 (F9 and OpenSuSE), ticket:258.

The problem is that we were using a signed integer for a fixed point
accumulator which we were counting on overflowing.

According to the fine print in the C and C++ standards, if a signed
integer type overflows, the result is undefined.  As of gcc 4.3, gcc
was proving that our code was overflowing, and took advantage of the
"undefined" result to short circuit the evaluation.

Moral of the story: if you're using a fixed point phase accumulator,
or anything else where you're counting on overflow happening, be sure
that your variable is unsigned.

See also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37067 and

Thanks to Stefan Bruens and Philip Ballister for working on this.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]