trans.c (Loop_Statement_to_gnu): Use gnat_type_for_size directly to obtain an unsigned version of the base type.

* gcc-interface/trans.c (Loop_Statement_to_gnu): Use gnat_type_for_size
	directly to obtain an unsigned version of the base type.

From-SVN: r192670
This commit is contained in:
Eric Botcazou 2012-10-22 08:23:01 +00:00 committed by Eric Botcazou
parent 60333a61a4
commit f9a6117fd7
5 changed files with 32 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-10-22 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (Loop_Statement_to_gnu): Use gnat_type_for_size
directly to obtain an unsigned version of the base type.
2012-10-22 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Out_Parameter>: Do not

View File

@ -2402,7 +2402,8 @@ Loop_Statement_to_gnu (Node_Id gnat_node)
{
if (TYPE_PRECISION (gnu_base_type)
> TYPE_PRECISION (size_type_node))
gnu_base_type = gnat_unsigned_type (gnu_base_type);
gnu_base_type
= gnat_type_for_size (TYPE_PRECISION (gnu_base_type), 1);
else
gnu_base_type = size_type_node;

View File

@ -1,3 +1,8 @@
2012-10-22 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/modular4.adb: New test.
* gnat.dg/modular4_pkg.ads: New helper.
2012-10-21 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/atomic1.ads: XFAIL on MIPS.

View File

@ -0,0 +1,11 @@
-- { dg-do compile }
-- { dg-options "-O" }
with Modular4_Pkg; use Modular4_Pkg;
procedure Modular4 is
begin
for I in Zero .. F mod 8 loop
raise Program_Error;
end loop;
end;

View File

@ -0,0 +1,9 @@
package Modular4_Pkg is
type Word is mod 2**48;
Zero : constant Word := 0;
function F return Word;
end Modular4_Pkg;