TIP: Click on subject to list as thread! ANSI
echo: cis.os9.68000.osk
to: all
from: Carl Kreider 71076,76
date: 1990-08-31 11:36:55
subject: c bug

#: 6420 S12/OS9/68000 (OSK)
    31-Aug-90  11:36:55
Sb: c bug
Fm: Carl Kreider 71076,76
To: all

The following source will generate bad code from both c68 and c68020 that come
with 'cc' version 3.1.  Both compilers will generate a call to float sized
addition in either the library or the trap lib, depending on the option
selected.  The -k=2f option (or c68020 -t881) will generate inline fpu code
that is correct.  Removing '++', using the '+=' shorthand, or removing
'register' will all permit the compilers to generate correct code.  They don't
get much more obscure than this!

        poly()
                {
                double  accum;
                register double *rdp;

                accum = accum + *rdp++;
                }

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.