[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 4 Aug 2014 08:00:05 +0000 (10:00 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 4 Aug 2014 08:00:05 +0000 (10:00 +0200)
2014-08-04  Robert Dewar  <dewar@adacore.com>

* exp_ch4.adb: Minor reformatting.

2014-08-04  Olivier Hainque  <hainque@adacore.com>

* link.c: remove const on __gnat_objlist_file_supported for AIX

2014-08-04  Robert Dewar  <dewar@adacore.com>

* sem_util.ads: Minor addition of comment.

2014-08-04  Vincent Celier  <celier@adacore.com>

* prj-dect.adb (Check_Package_Allowed): Allow package IDE in
all projects, including aggregate and aggregate library projects.

2014-08-04  Yannick Moy  <moy@adacore.com>

* back_end.adb (Call_Back_End): Do not call gigi in GNATprove mode.

2014-08-04  Robert Dewar  <dewar@adacore.com>

* sem_eval.adb (Test_In_Range): Always in range for
Is_Known_Valid target type, where input type has smaller or
equal size and does not have biased rep.

2014-08-04  Ed Schonberg  <schonberg@adacore.com>

* sem_attr.adb (Eval_Attribute): Constrained is not treated as
a static attribute, and the Static flag must not be set on it
during resolution. It may be constant-folded during expansion,
but if expansion is disabled it is not a static expression.

From-SVN: r213535

gcc/ada/ChangeLog
gcc/ada/back_end.adb
gcc/ada/exp_ch4.adb
gcc/ada/link.c
gcc/ada/prj-dect.adb
gcc/ada/sem_attr.adb
gcc/ada/sem_eval.adb
gcc/ada/sem_util.ads

index 8f2243eb947e66a34cc5e9149d5ae4e0a6997d81..ed625f2a3e0de6bb574dfa4220667198eee4a4f0 100644 (file)
@@ -1,3 +1,37 @@
+2014-08-04  Robert Dewar  <dewar@adacore.com>
+
+       * exp_ch4.adb: Minor reformatting.
+
+2014-08-04  Olivier Hainque  <hainque@adacore.com>
+
+       * link.c: remove const on __gnat_objlist_file_supported for AIX
+
+2014-08-04  Robert Dewar  <dewar@adacore.com>
+
+       * sem_util.ads: Minor addition of comment.
+
+2014-08-04  Vincent Celier  <celier@adacore.com>
+
+       * prj-dect.adb (Check_Package_Allowed): Allow package IDE in
+       all projects, including aggregate and aggregate library projects.
+
+2014-08-04  Yannick Moy  <moy@adacore.com>
+
+       * back_end.adb (Call_Back_End): Do not call gigi in GNATprove mode.
+
+2014-08-04  Robert Dewar  <dewar@adacore.com>
+
+       * sem_eval.adb (Test_In_Range): Always in range for
+       Is_Known_Valid target type, where input type has smaller or
+       equal size and does not have biased rep.
+
+2014-08-04  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_attr.adb (Eval_Attribute): Constrained is not treated as
+       a static attribute, and the Static flag must not be set on it
+       during resolution. It may be constant-folded during expansion,
+       but if expansion is disabled it is not a static expression.
+
 2014-08-04  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * sem_ch8.adb (Build_Class_Wide_Wrapper): Mark the primitive as
index 1d5de114e245624cc6dbed56b26bd6222bb22cbe..3e535547db632d8072e285e14f81e3488beed421 100644 (file)
@@ -126,7 +126,8 @@ package body Back_End is
            Nat (Physical_To_Logical (Last_Source_Line (J), J));
       end loop;
 
-      --  Deal with case of generating SCIL, we should not be here!
+      --  Deal with case of generating SCIL, we should not be here unless
+      --  debugging CodePeer mode in GNAT.
 
       if Generate_SCIL then
          Error_Msg_N ("'S'C'I'L generation not available", Cunit (Main_Unit));
@@ -139,6 +140,14 @@ package body Back_End is
          end if;
       end if;
 
+      --  We should be here in GNATprove mode only when debugging GNAT. Do not
+      --  call gigi in that case, as it is not prepared to handle the special
+      --  form of the tree obtained in GNATprove mode.
+
+      if GNATprove_Mode then
+         return;
+      end if;
+
       --  The actual call to the back end
 
       gigi
index 6d43496d41947dc29c3610d5e96dc87fec04518e..d012fc6f59a5b815f7b4ea2fd3b934643b294456 100644 (file)
@@ -10416,18 +10416,22 @@ package body Exp_Ch4 is
          --  If the level of the operand type is statically deeper than the
          --  level of the target type, then force Program_Error. Note that this
          --  can only occur for cases where the attribute is within the body of
-         --  an instantiation (otherwise the conversion will already have been
-         --  rejected as illegal). (Note: warnings are issued by the analyzer
-         --  for the instance cases.) The case where the target type is an
-         --  anonymous access type of a discriminant is excluded, because the
-         --  level of such a type depends on the context and currently the
-         --  level returned for such types is zero, resulting in warnings about
-         --  about check failures in certain legal cases involving class-wide
-         --  interfaces as the designated type (some cases, such as return
-         --  statements, are checked at run time, but not clear if these are
-         --  handled right in general, see 3.10.2(12/2-12.5/3) ???).
+         --  an instantiation, otherwise the conversion will already have been
+         --  rejected as illegal.
+
+         --  Note: warnings are issued by the analyzer for the instance cases
 
          elsif In_Instance_Body
+
+           --  The case where the target type is an anonymous access type of
+           --  a discriminant is excluded, because the level of such a type
+           --  depends on the context and currently the level returned for such
+           --  types is zero, resulting in warnings about about check failures
+           --  in certain legal cases involving class-wide interfaces as the
+           --  designated type (some cases, such as return statements, are
+           --  checked at run time, but not clear if these are handled right
+           --  in general, see 3.10.2(12/2-12.5/3) ???).
+
            and then
              not (Ekind (Target_Type) = E_Anonymous_Access_Type
                    and then Present (Associated_Node_For_Itype (Target_Type))
index 8a8e12033d74a9d699977198e6a6fc7b3b3c8b60..ee591471af04f569b841a887a2f677d74d9a40f8 100644 (file)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *          Copyright (C) 1992-2012, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2014, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -153,7 +153,7 @@ const char *__gnat_run_path_option = "";
 char __gnat_shared_libgnat_default = STATIC;
 char __gnat_shared_libgcc_default = STATIC;
 int __gnat_link_max = 15000;
-const unsigned char __gnat_objlist_file_supported = 1;
+unsigned char __gnat_objlist_file_supported = 1;
 const char *__gnat_object_library_extension = ".a";
 unsigned char __gnat_separate_run_path_options = 0;
 const char *__gnat_default_libgcc_subdir = "lib";
index 028b2bc1a734126721be235274fbb7da7698bbad..9053cfca54f08f402f00d42ddef53b2fa1970f56 100644 (file)
@@ -214,10 +214,12 @@ package body Prj.Dect is
                  Project_Qualifier_Of (Project, In_Tree);
       Name   : constant Name_Id := Name_Of (Current_Package, In_Tree);
    begin
-      if (Qualif = Aggregate and then Name /= Snames.Name_Builder)
-        or else (Qualif = Aggregate_Library
-                  and then Name /= Snames.Name_Builder
-                  and then Name /= Snames.Name_Install)
+      if Name /= Snames.Name_Ide
+        and then
+          ((Qualif = Aggregate         and then Name /= Snames.Name_Builder)
+              or else
+           (Qualif = Aggregate_Library and then Name /= Snames.Name_Builder
+                                       and then Name /= Snames.Name_Install))
       then
          Error_Msg_Name_1 := Name;
          Error_Msg
index e3e9f5aaa49c419b87b89bfdbdee720b372cd6f8..2b4cee2e37874559471859fa599fa53f5060ec0a 100644 (file)
@@ -7775,6 +7775,12 @@ package body Sem_Attr is
       --  could be handled at compile time. To be looked at later.
 
       when Attribute_Constrained =>
+
+         --  The expander might fold it and set the static flag accordingly,
+         --  but with expansion disabled (as in ASIS), it remains as an
+         --  attribute reference, and this reference is not static.
+
+         Set_Is_Static_Expression (N, False);
          null;
 
       ---------------
index 7cf4b3d37da3628cf818b322e5bad0d04f74b5f2..2fb5d3757c95187f9ed8855c3523b69ce6ccfbe7 100644 (file)
@@ -6193,6 +6193,18 @@ package body Sem_Eval is
       then
          return In_Range;
 
+      --  Another special case. For signed integer types, if the target type
+      --  has Is_Known_Valid set, and the source type does not have a larger
+      --  size, then the source value must be in range. We exclude biased
+      --  types, because they bizarrely can generate out of range values.
+
+      elsif Is_Signed_Integer_Type (Etype (N))
+        and then Is_Known_Valid (Typ)
+        and then Esize (Etype (N)) <= Esize (Typ)
+        and then not Has_Biased_Representation (Etype (N))
+      then
+         return In_Range;
+
       --  For all other cases, result is unknown
 
       else
index 84b4572b0b1a587d6ad348524b9052d673c66fe7..b322405401f7e724dae3688f7e25dde74d1d9b36 100644 (file)
@@ -1318,7 +1318,8 @@ package Sem_Util is
    --  declaration.
 
    function Is_SPARK_Object_Reference (N : Node_Id) return Boolean;
-   --  Determines if the tree referenced by N represents an object in SPARK
+   --  Determines if the tree referenced by N represents an object in SPARK.
+   --  This differs from Is_Object_Reference in that ???
 
    function Is_Statement (N : Node_Id) return Boolean;
    pragma Inline (Is_Statement);