Bug 15532 - -mknuthdiv's docs could be improved
Summary: -mknuthdiv's docs could be improved
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: documentation
Depends on:
Blocks:
 
Reported: 2004-05-18 23:37 UTC by user42
Modified: 2006-02-26 19:17 UTC (History)
2 users (show)

See Also:
Host:
Target: mmix-*
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-26 19:17:38


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description user42 2004-05-18 23:37:26 UTC
I think the documentation of the mmix -mknuthdiv option in the "MMIX
Options" node of the gcc manual could be clarified a little.

Environment:
System: Linux blah 2.4.25-1-k6 #1 Tue Feb 24 13:18:52 EST 2004 i586 GNU/Linux
Architecture: i586
	<machine, os, target, libraries (multiple lines)>
host: i486-pc-linux-gnu
build: i486-pc-linux-gnu
target: i486-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib,gtk --enable-objc-gc i486-linux

How-To-Repeat:
If I understand the wording "Make the result of a division yielding a
remainder have the same sign as the divisor", -mknuthdiv is a "floor"
style division.  I think it may be clearer to say that outright,
something like: ... "floor" style division, meaning quotient rounded
towards negative infinity and remainder therefore having the same sign
as the divisor.

Also, I think it would be worth noting that this style is contrary to
the C99 standard (sec 6.5.5 in a draft I'm looking at).  I guess
either an explicit caution about (non)-conformance, or change the
wording "almost exclusively used" for -mno-knuthdiv to something
stronger.
Comment 1 Andrew Pinski 2004-05-19 12:10:56 UTC
Confirmed.