From 955871d37fc3f6022ac6bd19dfd8a7134cbcdfac Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 17 Jun 2010 17:50:40 +0200 Subject: [multiple changes] 2010-06-17 Robert Dewar * exp_ch4.ads: Minor code reorganization (specs in alpha order). 2010-06-17 Robert Dewar * debug.adb: New debug flag -gnatd.X to use Expression_With_Actions node when expanding short circuit form with actions present for right opnd. * exp_ch4.adb: Minor reformatting (Expand_Short_Circuit_Operator): Use new Expression_With_Actions node if right opeand has actions present, and debug flag -gnatd.X is set. * exp_util.adb (Insert_Actions): Handle case of Expression_With_Actions node. * nlists.adb (Prepend_List): New procedure (Prepend_List_To): New procedure * nlists.ads (Prepend_List): New procedure (Prepend_List_To): New procedure * sem.adb: Add processing for Expression_With_Actions * sem_ch4.adb (Analyze_Expression_With_Actions): New procedure * sem_ch4.ads (Analyze_Expression_With_Actions): New procedure * sem_res.adb: Add processing for Expression_With_Actions. * sem_scil.adb: Add processing for Expression_With_Actions * sinfo.ads, sinfo.adb (N_Expression_With_Actions): New node. * sprint.ads, sprint.adb: Add processing for Expression_With_Actions 2010-06-17 Doug Rupp * sem_intr.adb (Check_Intrinsic_Operator): Check that the types involved both have underlying integer types. * exp_intr.adb (Expand_Binary_Operator) New subprogram to expand a call to an intrinsic operator when the operand types or sizes are not identical. * s-auxdec-vms_64.ads: Revert "+" "-" ops back to Address now that 64/32 Address/Integer works. From-SVN: r160929 --- gcc/ada/sem_intr.adb | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'gcc/ada/sem_intr.adb') diff --git a/gcc/ada/sem_intr.adb b/gcc/ada/sem_intr.adb index 2fb0999..63cecbd 100644 --- a/gcc/ada/sem_intr.adb +++ b/gcc/ada/sem_intr.adb @@ -54,7 +54,7 @@ package body Sem_Intr is procedure Check_Intrinsic_Operator (E : Entity_Id; N : Node_Id); -- Check that operator is one of the binary arithmetic operators, and - -- that the types involved have the same size. + -- that the types involved both have underlying integer types.. procedure Check_Shift (E : Entity_Id; N : Node_Id); -- Check intrinsic shift subprogram, the two arguments are the same @@ -198,11 +198,24 @@ package body Sem_Intr is T2 := Etype (Next_Formal (First_Formal (E))); end if; - if Root_Type (T1) /= Root_Type (T2) - or else Root_Type (T1) /= Root_Type (Ret) + if Root_Type (T1) = Root_Type (T2) + or else Root_Type (T1) = Root_Type (Ret) + then + -- Same types, predefined operator will apply + + null; + + elsif Is_Integer_Type (Underlying_Type (T1)) + and then Is_Integer_Type (Underlying_Type (T2)) + and then Is_Integer_Type (Underlying_Type (Ret)) then + -- Expansion will introduce conversions if sizes are not equal + + null; + + else Errint - ("types of intrinsic operator must have the same size", E, N); + ("types of intrinsic operator operands do not match", E, N); end if; -- Comparison operators -- cgit v1.1