This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] change largest non-binary modulus


Tested on i686-linux, committed on trunk

This patch changes the largest non-binary modulus from 2**31-1 to 2**32-1
It turns out that gigi and the back end could already handle this, the only
change was the check on the limit and the constant in system.ads.

The following program:

with Text_IO; use Text_IO;
procedure q is
   type m is mod 2 ** 32 - 1;
   a, b, c : m;
begin
   b := 3;
   c := 2 ** 32 - 2;
   Put_line (c'Img);
   a := b + c;
   Put_Line (a'Img);
   a := a - 3;
   Put_line (a'Img);
   a := b * c;
   Put_Line (a'Img);
end;

compiles quietly and outputs:

 4294967294
 2
 4294967294
 4294967292

The following shows the new limit being checked:

     1. package r is
     2.    type m1 is mod Integer'Last * 2 + 1;
     3.    type m3 is mod Integer'Last * 2 + 3;
                          |
        >>> nonbinary modulus exceeds limit (2 ** 32 - 1)

     4. end r;

Also explain how to map Ada priorities to OS priorities and how priority
ranges are used, and remove optional parameters.

2007-06-06  Arnaud Charlet  <charlet@adacore.com>

	* system-vxworks-sparcv9.ads, system-solaris-x86.ads, 
	system-irix-o32.ads, system-freebsd-x86.ads, system-lynxos-ppc.ads, 
	system-lynxos-x86.ads, system-vxworks-m68k.ads, system-linux-x86.ads, 
	system-vxworks-mips.ads, system-vxworks-alpha.ads, 
	system-vxworks-x86.ads, system-linux-ppc.ads, system-mingw.ads, 
	system-vms-zcx.ads, system-darwin-ppc.ads, system-vxworks-ppc.ads, 
	system-interix.ads, system-linux-hppa.ads, system-tru64.ads, 
	system-hpux.ads, system-irix-n32.ads, system-solaris-sparc.ads, 
	system-solaris-sparcv9.ads, system-vms.ads, system.ads,
	system-vms_64.ads, system-hpux-ia64.ads, system-linux-x86_64.ads,
	system-linux-ia64.ads: Document mapping between Ada and OS priorities.
	This patch changes the largest non-binary modulus from 2**31-1 to
	2**32-1.
	(Compiler_System_Version): Removed, no longer used.
	Clean up system files by removing flags only used on a single target.
	Also remove obsolete flags, only used during bootstrap from system.ads
	(Address): Add a pragma Preelaborable_Initialization.

	* system-aix.ads:  Ditto.
	(GCC_ZCX_Support): Set to true.
	Update priority range on AIX and map Ada priorities to target
	priorities appropriately for different scheduling policies.

	* ttypes.ads: set largest non-binary modulus from 2**31-1 to 2**32-1

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]