From 685094bfdee3a606aa8ebf491f4968d9cd4879db Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Tue, 20 May 2008 14:44:55 +0200 Subject: re PR ada/30740 (Improper semantics in gnat's compilation of certain expressions involving modular arithmetic) 2008-05-20 Robert Dewar PR ada/30740 * einfo.ads, einfo.adb (Non_Binary_Modulus): Applies to all types and subtypes, always False for non-modular types. Shared_Var_Assign_Proc (node22) and Shared_Var_Read_Proc (node 15) entry nodes have been replaced by Shared_Var_Procs_Instance (node22) for Shared_Storage package. (Is_RACW_Stub_Type): New entity flag. * exp_ch4.adb (Expand_N_Op_Expon): Avoid incorrect optimization of a*(2**b) in the case where we have a modular type with a non-binary modules. Comments reformattings. * sem_intr.adb: Simplify code not that Non_Binary_Modulus applies to all types. From-SVN: r135619 --- gcc/ada/sem_intr.adb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gcc/ada/sem_intr.adb') diff --git a/gcc/ada/sem_intr.adb b/gcc/ada/sem_intr.adb index 9d73197..0b7adc4 100644 --- a/gcc/ada/sem_intr.adb +++ b/gcc/ada/sem_intr.adb @@ -418,9 +418,7 @@ package body Sem_Intr is Ptyp1, N); return; - elsif Is_Modular_Integer_Type (Typ1) - and then Non_Binary_Modulus (Typ1) - then + elsif Non_Binary_Modulus (Typ1) then Errint ("shifts not allowed for non-binary modular types", Ptyp1, N); -- cgit v1.1