target/5700: [ARM, 2.95] __umodsi3 yields wrong answer

pb@nexus.co.uk pb@nexus.co.uk
Fri Feb 15 09:06:00 GMT 2002


>Number:         5700
>Category:       target
>Synopsis:       [ARM, 2.95] __umodsi3 yields wrong answer
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 15 06:16:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     pb@nexus.co.uk
>Release:        2.95 branch
>Organization:
>Environment:

>Description:
This code prints "40000000", which is clearly incorrect.

main()
{
unsigned long __umodsi3(unsigned long, unsigned long);
unsigned long a = __umodsi3(0xC0000000, 2);
printf("%x\n", a);
}
>How-To-Repeat:

>Fix:
Probably this change:

2000-08-22  Nick Clifton  <nickc@redhat.com>

	* config/arm/lib1funcs.asm (__umodsi3): Before performing any
	restorative additions, test for bottom bits of IP being set,
	rather than relying upon the RORs not matching.
	(__modsi3): Ditto.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list