]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 2 Jan 2013 10:38:18 +0000 (11:38 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 2 Jan 2013 10:38:18 +0000 (11:38 +0100)
2013-01-02  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_attr.adb (Analyze_Attribute): Skip the special _Parent
scope generated for subprogram inlining purposes while trying
to locate the enclosing function.
* sem_prag.adb (Analyze_Pragma): Preanalyze the boolean
expression of pragma Postcondition when the pragma comes from
source and appears inside a subprogram body.

2013-01-02  Thomas Quinot  <quinot@adacore.com>

* switch-c.adb, fe.h, back_end.adb: Enable generation of instantiation
information in debug info unconditionally when using -fdump-scos,
instead of relying on a separate command line switch -fdebug-instances.

2013-01-02  Ed Schonberg  <schonberg@adacore.com>

* sem_ch12.adb: Additional refinement of predicate.

2013-01-02  Vincent Celier  <celier@adacore.com>

* vms_data.ads: Remove incorrect spaces at end of descriptions
of qualifiers for single switch.

2013-01-02  Ben Brosgol  <brosgol@adacore.com>

* gnat_rm.texi: Minor edits / wordsmithing in section on pragma
Check_Float_Overflow.

2013-01-02  Thomas Quinot  <quinot@adacore.com>

* sprint.adb (Sprint_Node_Actual): Do not add extra parens for
a conditional expression (CASE or IF expression) that already
has parens. Also omit ELSE keyword for an IF expression without
an ELSE part.

2013-01-02  Thomas Quinot  <quinot@adacore.com>

* gnat1drv.adb (Adjust_Global_Switches): Adjust back-end
flag_debug_instances here, after front-end switches have been
processed.

From-SVN: r194792

14 files changed:
gcc/ada/ChangeLog
gcc/ada/back_end.adb
gcc/ada/fe.h
gcc/ada/gcc-interface/Make-lang.in
gcc/ada/gcc-interface/gigi.h
gcc/ada/gcc-interface/misc.c
gcc/ada/gnat1drv.adb
gcc/ada/gnat_rm.texi
gcc/ada/sem_attr.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_prag.adb
gcc/ada/sprint.adb
gcc/ada/switch-c.adb
gcc/ada/vms_data.ads

index 10b2b5a47252e3bce6c2441393dad695b2827bf7..17ddd2692fd5889d05b5f41501b6d6d81074cdd0 100644 (file)
@@ -1,3 +1,48 @@
+2013-01-02  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_attr.adb (Analyze_Attribute): Skip the special _Parent
+       scope generated for subprogram inlining purposes while trying
+       to locate the enclosing function.
+       * sem_prag.adb (Analyze_Pragma): Preanalyze the boolean
+       expression of pragma Postcondition when the pragma comes from
+       source and appears inside a subprogram body.
+
+2013-01-02  Thomas Quinot  <quinot@adacore.com>
+
+       * switch-c.adb, fe.h, back_end.adb: Enable generation of instantiation
+       information in debug info unconditionally when using -fdump-scos,
+       instead of relying on a separate command line switch -fdebug-instances.
+       * gcc-interface/gigi.h, gcc-interface/misc.c
+       (set_flag_debug_instances): New subprogram.
+       * gcc-interface/Make-lang.in: Update dependencies.
+
+2013-01-02  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch12.adb: Additional refinement of predicate.
+
+2013-01-02  Vincent Celier  <celier@adacore.com>
+
+       * vms_data.ads: Remove incorrect spaces at end of descriptions
+       of qualifiers for single switch.
+
+2013-01-02  Ben Brosgol  <brosgol@adacore.com>
+
+       * gnat_rm.texi: Minor edits / wordsmithing in section on pragma
+       Check_Float_Overflow.
+
+2013-01-02  Thomas Quinot  <quinot@adacore.com>
+
+       * sprint.adb (Sprint_Node_Actual): Do not add extra parens for
+       a conditional expression (CASE or IF expression) that already
+       has parens. Also omit ELSE keyword for an IF expression without
+       an ELSE part.
+
+2013-01-02  Thomas Quinot  <quinot@adacore.com>
+
+       * gnat1drv.adb (Adjust_Global_Switches): Adjust back-end
+       flag_debug_instances here, after front-end switches have been
+       processed.
+
 2013-01-02  Vincent Celier  <celier@adacore.com>
 
        * usage.adb: Minor reformatting.
index aa398ff31c3f2650526c489e12f3f3638e3a4d66..f23230ecf9d34aee65e86422188b3671f5d4bdd6 100644 (file)
@@ -244,11 +244,6 @@ package body Back_End is
 
             elsif Switch_Chars (First .. Last) = "fdump-scos" then
                Opt.Generate_SCO := True;
-
-            --  Back end switch -fdebug-instances also enables instance table
-            --  SCO generation.
-
-            elsif Switch_Chars (First .. Last) = "fdebug-instances" then
                Opt.Generate_SCO_Instance_Table := True;
 
             end if;
index fe52233202bc7c11e3c0181dff90f29e682f8665..6c752e899b39515401230c4a5c557fbd6431a7e7 100644 (file)
@@ -178,19 +178,19 @@ extern Boolean In_Same_Source_Unit              (Node_Id, Node_Id);
 
 /* opt: */
 
-#define Global_Discard_Names           opt__global_discard_names
+#define Back_Annotate_Rep_Info         opt__back_annotate_rep_info
 #define Exception_Extra_Info           opt__exception_extra_info
 #define Exception_Locations_Suppressed opt__exception_locations_suppressed
 #define Exception_Mechanism            opt__exception_mechanism
-#define Back_Annotate_Rep_Info         opt__back_annotate_rep_info
+#define Global_Discard_Names           opt__global_discard_names
 
 typedef enum {Setjmp_Longjmp, Back_End_Exceptions} Exception_Mechanism_Type;
 
-extern Boolean Global_Discard_Names;
+extern Boolean Back_Annotate_Rep_Info;
 extern Boolean Exception_Extra_Info;
 extern Boolean Exception_Locations_Suppressed;
 extern Exception_Mechanism_Type Exception_Mechanism;
-extern Boolean Back_Annotate_Rep_Info;
+extern Boolean Global_Discard_Names;
 
 /* restrict: */
 
index 0d83ab8820809f919267717b864284963ed70cba..0e0cd6d266f4470b512ea8c5bf2cbf5e4af6c4c8 100644 (file)
@@ -2194,14 +2194,13 @@ ada/exp_vfpt.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
 ada/expander.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
    ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
    ada/atree.adb ada/casing.ads ada/debug.ads ada/debug_a.ads \
-   ada/debug_a.adb ada/einfo.ads ada/elists.ads ada/err_vars.ads \
-   ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads ada/exp_alfa.ads \
-   ada/exp_attr.ads ada/exp_ch11.ads ada/exp_ch12.ads ada/exp_ch13.ads \
-   ada/exp_ch2.ads ada/exp_ch3.ads ada/exp_ch4.ads ada/exp_ch5.ads \
-   ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch8.ads ada/exp_ch9.ads \
-   ada/exp_prag.ads ada/exp_tss.ads ada/expander.ads ada/expander.adb \
-   ada/fname.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \
-   ada/lib-load.ads ada/namet.ads ada/nlists.ads ada/opt.ads \
+   ada/debug_a.adb ada/einfo.ads ada/elists.ads ada/exp_aggr.ads \
+   ada/exp_alfa.ads ada/exp_attr.ads ada/exp_ch11.ads ada/exp_ch12.ads \
+   ada/exp_ch13.ads ada/exp_ch2.ads ada/exp_ch3.ads ada/exp_ch4.ads \
+   ada/exp_ch5.ads ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch8.ads \
+   ada/exp_ch9.ads ada/exp_prag.ads ada/exp_tss.ads ada/expander.ads \
+   ada/expander.adb ada/fname.ads ada/hostparm.ads ada/inline.ads \
+   ada/lib.ads ada/lib-load.ads ada/namet.ads ada/nlists.ads ada/opt.ads \
    ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
    ada/sem.ads ada/sem.adb ada/sem_attr.ads ada/sem_aux.ads \
    ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads \
@@ -2734,25 +2733,25 @@ ada/par.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads ada/a-uncdea.ads \
    ada/warnsw.ads ada/widechar.ads 
 
 ada/par_sco.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
-   ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
-   ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
-   ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_tss.ads \
-   ada/fname.ads ada/gnat.ads ada/g-byorma.ads ada/g-hesorg.ads \
-   ada/g-hesorg.adb ada/g-htable.ads ada/g-table.ads ada/g-table.adb \
-   ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
-   ada/lib-sort.adb ada/lib-util.ads ada/lib-util.adb ada/namet.ads \
-   ada/nlists.ads ada/nlists.adb ada/opt.ads ada/osint.ads ada/osint-c.ads \
-   ada/output.ads ada/par_sco.ads ada/par_sco.adb ada/put_scos.ads \
-   ada/put_scos.adb ada/scans.ads ada/scos.ads ada/scos.adb ada/sem.ads \
-   ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
-   ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
-   ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \
-   ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
-   ada/s-secsta.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
-   ada/s-strhas.ads ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
-   ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
-   ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
-   ada/unchdeal.ads ada/urealp.ads ada/widechar.ads 
+   ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/aspects.adb \
+   ada/atree.ads ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads \
+   ada/einfo.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+   ada/exp_tss.ads ada/fname.ads ada/gnat.ads ada/g-byorma.ads \
+   ada/g-hesorg.ads ada/g-hesorg.adb ada/g-htable.ads ada/g-table.ads \
+   ada/g-table.adb ada/hostparm.ads ada/lib.ads ada/lib.adb \
+   ada/lib-list.adb ada/lib-sort.adb ada/lib-util.ads ada/lib-util.adb \
+   ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads ada/osint.ads \
+   ada/osint-c.ads ada/output.ads ada/par_sco.ads ada/par_sco.adb \
+   ada/put_scos.ads ada/put_scos.adb ada/scans.ads ada/scos.ads \
+   ada/scos.adb ada/sem.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \
+   ada/sinput.ads ada/sinput.adb ada/snames.ads ada/stand.ads \
+   ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+   ada/s-htable.adb ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
+   ada/s-parame.ads ada/s-secsta.ads ada/s-stalib.ads ada/s-stoele.ads \
+   ada/s-stoele.adb ada/s-strhas.ads ada/s-string.ads ada/s-traent.ads \
+   ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+   ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uname.ads \
+   ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads 
 
 ada/prep.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
    ada/a-uncdea.ads ada/alloc.ads ada/casing.ads ada/csets.ads \
@@ -2795,12 +2794,12 @@ ada/put_alfa.o : ada/ada.ads ada/a-unccon.ads ada/alfa.ads ada/gnat.ads \
 ada/put_scos.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
    ada/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/gnat.ads \
    ada/g-table.ads ada/g-table.adb ada/hostparm.ads ada/namet.ads \
-   ada/opt.ads ada/output.ads ada/par_sco.ads ada/put_scos.ads \
-   ada/put_scos.adb ada/scos.ads ada/snames.ads ada/system.ads \
-   ada/s-exctab.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
-   ada/s-stalib.ads ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
-   ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
-   ada/types.ads ada/unchconv.ads ada/unchdeal.ads 
+   ada/opt.ads ada/output.ads ada/put_scos.ads ada/put_scos.adb \
+   ada/scos.ads ada/system.ads ada/s-exctab.ads ada/s-memory.ads \
+   ada/s-os_lib.ads ada/s-parame.ads ada/s-stalib.ads ada/s-string.ads \
+   ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+   ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \
+   ada/unchdeal.ads 
 
 ada/repinfo.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
    ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -3075,34 +3074,34 @@ ada/scng.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
 ada/scos.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
    ada/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/gnat.ads \
    ada/g-table.ads ada/g-table.adb ada/hostparm.ads ada/namet.ads \
-   ada/opt.ads ada/output.ads ada/scos.ads ada/scos.adb ada/snames.ads \
-   ada/system.ads ada/s-exctab.ads ada/s-memory.ads ada/s-os_lib.ads \
-   ada/s-parame.ads ada/s-stalib.ads ada/s-string.ads ada/s-traent.ads \
-   ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
-   ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads 
+   ada/opt.ads ada/output.ads ada/scos.ads ada/scos.adb ada/system.ads \
+   ada/s-exctab.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \
+   ada/s-stalib.ads ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
+   ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+   ada/types.ads ada/unchconv.ads ada/unchdeal.ads 
 
 ada/sem.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads ada/a-uncdea.ads \
    ada/alloc.ads ada/aspects.ads ada/atree.ads ada/atree.adb \
    ada/casing.ads ada/csets.ads ada/debug.ads ada/debug_a.ads \
    ada/debug_a.adb ada/einfo.ads ada/einfo.adb ada/elists.ads \
-   ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
-   ada/exp_tss.ads ada/expander.ads ada/fname.ads ada/gnat.ads \
-   ada/g-hesorg.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \
-   ada/lib.adb ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb \
-   ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \
-   ada/restrict.ads ada/rident.ads ada/sem.ads ada/sem.adb \
-   ada/sem_attr.ads ada/sem_aux.ads ada/sem_ch10.ads ada/sem_ch11.ads \
-   ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch2.adb \
-   ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads \
-   ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_dim.ads \
-   ada/sem_prag.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \
-   ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
-   ada/system.ads ada/s-exctab.ads ada/s-imenne.ads ada/s-memory.ads \
-   ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-secsta.ads \
-   ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
-   ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
-   ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uname.ads \
-   ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads 
+   ada/elists.adb ada/exp_tss.ads ada/expander.ads ada/fname.ads \
+   ada/gnat.ads ada/g-hesorg.ads ada/hostparm.ads ada/inline.ads \
+   ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-load.ads \
+   ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \
+   ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads ada/sem.ads \
+   ada/sem.adb ada/sem_attr.ads ada/sem_aux.ads ada/sem_ch10.ads \
+   ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch2.ads \
+   ada/sem_ch2.adb ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads \
+   ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch9.ads \
+   ada/sem_dim.ads ada/sem_prag.ads ada/sem_util.ads ada/sinfo.ads \
+   ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+   ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-imenne.ads \
+   ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
+   ada/s-secsta.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+   ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+   ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
+   ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+   ada/widechar.ads 
 
 ada/sem_aggr.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
    ada/a-uncdea.ads ada/alloc.ads ada/aspects.ads ada/atree.ads \
@@ -4372,11 +4371,14 @@ ada/validsw.o : ada/ada.ads ada/a-unccon.ads ada/a-uncdea.ads \
    ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/validsw.ads \
    ada/validsw.adb 
 
-ada/warnsw.o : ada/ada.ads ada/a-unccon.ads ada/a-uncdea.ads \
-   ada/hostparm.ads ada/opt.ads ada/system.ads ada/s-exctab.ads \
-   ada/s-stalib.ads ada/s-string.ads ada/s-unstyp.ads ada/s-wchcon.ads \
-   ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/warnsw.ads \
-   ada/warnsw.adb 
+ada/warnsw.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
+   ada/a-uncdea.ads ada/alloc.ads ada/debug.ads ada/err_vars.ads \
+   ada/hostparm.ads ada/namet.ads ada/opt.ads ada/output.ads \
+   ada/system.ads ada/s-exctab.ads ada/s-memory.ads ada/s-os_lib.ads \
+   ada/s-parame.ads ada/s-stalib.ads ada/s-string.ads ada/s-traent.ads \
+   ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+   ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+   ada/unchdeal.ads ada/warnsw.ads ada/warnsw.adb 
 
 ada/widechar.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
    ada/a-uncdea.ads ada/hostparm.ads ada/interfac.ads ada/opt.ads \
index 1d0d2fb216789f5b4806bc147ba29ff60ac12f58..28bf9380c1c57ab47b43a7ad7dfed0d58687ef31 100644 (file)
@@ -255,6 +255,8 @@ extern void gigi (Node_Id gnat_root, int max_gnat_node,
                   Entity_Id standard_exception_type,
                   Int gigi_operating_mode);
 
+extern void set_flag_debug_instances (int);
+
 #ifdef __cplusplus
 }
 #endif
index 3d3f16110ce0075bc5e1b1e25343a1fc66f4954f..4c5bd321eaff95213401805c3a68cc3a11ec9d46 100644 (file)
@@ -228,7 +228,9 @@ int optimize_size;
 int flag_compare_debug;
 enum stack_check_type flag_stack_check = NO_STACK_CHECK;
 
-/* Post-switch processing.  */
+/* Settings adjustments after switches processing by the back-end.
+   Note that the front-end switches processing (Scan_Compiler_Arguments)
+   has not been done yet at this point!  */
 
 static bool
 gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
@@ -807,6 +809,23 @@ gnat_eh_personality (void)
   return gnat_eh_personality_decl;
 }
 
+/* Set flag_debug_instances.  */
+
+void
+set_flag_debug_instances (int val ATTRIBUTE_UNUSED)
+{
+#if 0
+  /* Temporary compatibility shim???
+     This should be enabled when back-end support for instance info in
+     DWARF is merged at the FSF.  */
+  flag_debug_instances = val;
+#else
+  /* Until then, forcibly turn off SCO instance table generation.  */
+  extern Boolean opt__generate_sco_instance_table;
+  opt__generate_sco_instance_table = False;
+#endif
+}
+
 /* Initialize language-specific bits of tree_contains_struct.  */
 
 static void
index 6e90c2b6d058dbf7a5f9aa851959c3c6ebe54678..b2e0647c1575e2eaa1dc1cf9e5c6103aa1fac682 100644 (file)
@@ -109,6 +109,9 @@ procedure Gnat1drv is
    ----------------------------
 
    procedure Adjust_Global_Switches is
+      procedure set_flag_debug_instances (Val : Int);
+      pragma Import (C, set_flag_debug_instances);
+
    begin
       --  Debug flag -gnatd.I is a synonym for Generate_SCIL and requires code
       --  generation.
@@ -573,6 +576,10 @@ procedure Gnat1drv is
          end if;
       end if;
 
+      --  Set back-end flag_debug_instances from corresponding front-end flag
+
+      set_flag_debug_instances (Boolean'Pos (Generate_SCO_Instance_Table));
+
       --  Finally capture adjusted value of Suppress_Options as the initial
       --  value for Scope_Suppress, which will be modified as we move from
       --  scope to scope (by Suppress/Unsuppress/Overflow_Checks pragmas).
index 759ae5a8f8c92161122b35739fdf5d2d7d870fd6..1e54eb0abff2ccb510c6f199c4b23f8bb1fef660 100644 (file)
@@ -1417,41 +1417,43 @@ pragma Check_Float_Overflow;
 @noindent
 In Ada, the predefined floating-point types (@code{Short_Float},
 @code{Float}, @code{Long_Float}, @code{Long_Long_Float}) are
-defined as being unconstrained. This means that even though they
-have well defined base ranges, there is no requirement that an
-overflow exception be raised when the result of an operation is
-outside this base range. This definition accomodates the notion
+defined to be @emph{unconstrained}. This means that even though each
+has a well-defined base range, an operation that delivers a result
+outside this base range is not required to raise an exception.
+This implementation permission accommodates the notion
 of infinities in IEEE floating-point, and corresponds to the
 efficient execution mode on most machines. GNAT will not raise
-overflow exceptions on these machines, instead it will generate
+overflow exceptions on these machines; instead it will generate
 infinities and NaN's as defined in the IEEE standard.
 
-Although the generation of infinities is efficient, it is not
-always desirable, and it is often the case that it would be
-preferable to check for overflows, even if this resulted in
-substantially less efficient code. This can be accomplished
-by defining your own float subtypes, and indeed such types
-can have the same base range as in:
+Generating infinities, although efficient, is not always desirable.
+Often the preferable approach is to check for overflow, even at the
+(perhaps considerable) expense of run-time performance.
+This can be accomplished by defining your own constrained floating-point subtypes -- i.e., by supplying explicit
+range constraints -- and indeed such a subtype
+can have the same base range as its base type. For example:
 
 @smallexample @c ada
 subtype My_Float is Float range Float'Range;
 @end smallexample
 
 @noindent
-In this example, @code{My_Float} has the same range as
-@code{Float} but it is constrained, so operations on
+Here @code{My_Float} has the same range as
+@code{Float} but is constrained, so operations on
 @code{My_Float} values will be checked for overflow
 against this range.
 
-However, it is often convenient to avoid the need to
-define your own floating-point types, and instead use
-the standard predefined types. The @code{Check_Float_Overflow}
-configuration pragma achieves that. If a unit is compiled
+This style will achieve the desired goal, but
+it is often more convenient to be able to simply use
+the standard predefined floating-point types as long
+as overflow checking could be guaranteed.
+The @code{Check_Float_Overflow}
+configuration pragma achieves this effect. If a unit is compiled
 subject to this configuration pragma, then all operations
 on predefined floating-point types will be treated as
-though those types were constrained and overflow checks
-will be generated, resulting in a @code{Constraint_Error}
-exception if the result is out of range.
+though those types were constrained, and overflow checks
+will be generated. The @code{Constraint_Error}
+exception is raised if the result is out of range.
 
 This mode can also be set by use of the compiler
 switch @option{-gnateF}.
index 002f7272ba0ad0ea0d5c6562a5483639b95a96c3..ff008786bfe576c7cea9d85fee94648412604d53 100644 (file)
@@ -4586,11 +4586,26 @@ package body Sem_Attr is
          --  During pre-analysis, Prag is the enclosing pragma node if any
 
       begin
-         --  Find enclosing scopes, excluding loops
+         --  Find the proper enclosing scope
 
          CS := Current_Scope;
-         while Ekind (CS) = E_Loop loop
-            CS := Scope (CS);
+         while Present (CS) loop
+
+            --  Skip generated loops
+
+            if Ekind (CS) = E_Loop then
+               CS := Scope (CS);
+
+            --  Skip the special _Parent scope generated to capture references
+            --  to formals during the process of subprogram inlining.
+
+            elsif Ekind (CS) = E_Function
+              and then Chars (CS) = Name_uParent
+            then
+               CS := Scope (CS);
+            else
+               exit;
+            end if;
          end loop;
 
          PS := Scope (CS);
index d3c735b38edc26664abda3ec6468892951be4478..ee883327054d9b6178e859fe756ddb9aaeb88b29 100644 (file)
@@ -13001,12 +13001,15 @@ package body Sem_Ch12 is
                --  an expanded name, it has been rewritten as the renamed
                --  package, which is necessary semantically but complicates
                --  ASIS tree traversal, so we recover the original entity to
-               --  expose the renaming.
+               --  expose the renaming. Take into account that the context may
+               --  be a nested generic and that the original node may itself
+               --  have an associated node.
 
                if Ekind (E) = E_Package
                  and then Nkind (Parent (N)) = N_Expanded_Name
                  and then Present (Original_Node (N2))
                  and then Present (Entity (Original_Node (N2)))
+                 and then Is_Entity_Name (Entity (Original_Node (N2)))
                then
                   if Is_Global (Entity (Original_Node (N2))) then
                      N2 := Original_Node (N2);
index ae69b0e194559268c2405b23868c28ffe32fcfef..c83d1f61fb86200bac8a5906f89e5906982d5000 100644 (file)
@@ -12748,7 +12748,6 @@ package body Sem_Prag is
 
          when Pragma_Postcondition => Postcondition : declare
             In_Body : Boolean;
-            pragma Warnings (Off, In_Body);
 
          begin
             GNAT_Pragma;
@@ -12756,10 +12755,22 @@ package body Sem_Prag is
             Check_At_Most_N_Arguments (2);
             Check_Optional_Identifier (Arg1, Name_Check);
 
-            --  All we need to do here is call the common check procedure,
-            --  the remainder of the processing is found in Sem_Ch6/Sem_Ch7.
+            --  Verify the proper placement of the pragma. The remainder of the
+            --  processing is found in Sem_Ch6/Sem_Ch7.
 
             Check_Precondition_Postcondition (In_Body);
+
+            --  When the pragma is a source contruct and appears inside a body,
+            --  preanalyze the boolean_expression to detect illegal forward
+            --  references:
+
+            --    procedure P is
+            --       pragma Postcondition (X'Old ...);
+            --       X : ...
+
+            if Comes_From_Source (N) and then In_Body then
+               Preanalyze_Spec_Expression (Expression (Arg1), Any_Boolean);
+            end if;
          end Postcondition;
 
          ------------------
index e80708e67b05253d2451471c992372098ed90300..bfa245fd9dc284832eab3ccc8ecb7916e8211a49 100644 (file)
@@ -1159,14 +1159,19 @@ package body Sprint is
 
          when N_Case_Expression =>
             declare
-               Alt : Node_Id;
+               Has_Parens : constant Boolean := Paren_Count (Node) > 0;
+               Alt        : Node_Id;
 
             begin
                --  The syntax for case_expression does not include parentheses,
                --  but sometimes parentheses are required, so unconditionally
-               --  generate them here.
+               --  generate them here unless already present.
 
-               Write_Str_With_Col_Check_Sloc ("(case ");
+               if not Has_Parens then
+                  Write_Char ('(');
+               end if;
+
+               Write_Str_With_Col_Check_Sloc ("case ");
                Sprint_Node (Expression (Node));
                Write_Str_With_Col_Check (" is");
 
@@ -1178,7 +1183,9 @@ package body Sprint is
                   Write_Char (',');
                end loop;
 
-               Write_Char (')');
+               if not Has_Parens then
+                  Write_Char (')');
+               end if;
             end;
 
          when N_Case_Expression_Alternative =>
@@ -1963,15 +1970,19 @@ package body Sprint is
 
          when N_If_Expression =>
             declare
-               Condition : constant Node_Id := First (Expressions (Node));
-               Then_Expr : constant Node_Id := Next (Condition);
+               Has_Parens : constant Boolean := Paren_Count (Node) > 0;
+               Condition  : constant Node_Id := First (Expressions (Node));
+               Then_Expr  : constant Node_Id := Next (Condition);
 
             begin
                --  The syntax for if_expression does not include parentheses,
                --  but sometimes parentheses are required, so unconditionally
-               --  generate them here.
+               --  generate them here unless already present.
 
-               Write_Str_With_Col_Check_Sloc ("(if ");
+               if not Has_Parens then
+                  Write_Char ('(');
+               end if;
+               Write_Str_With_Col_Check_Sloc ("if ");
                Sprint_Node (Condition);
                Write_Str_With_Col_Check (" then ");
 
@@ -1979,11 +1990,16 @@ package body Sprint is
 
                if Present (Then_Expr) then
                   Sprint_Node (Then_Expr);
-                  Write_Str_With_Col_Check (" else ");
-                  Sprint_Node (Next (Then_Expr));
+
+                  if Present (Next (Then_Expr)) then
+                     Write_Str_With_Col_Check (" else ");
+                     Sprint_Node (Next (Then_Expr));
+                  end if;
                end if;
 
-               Write_Char (')');
+               if not Has_Parens then
+                  Write_Char (')');
+               end if;
             end;
 
          when N_If_Statement =>
index f6d8fee2348d0edb55ff0e2780142b0961293233..ebb18b0c4016f25a67d1b351072f263ed7567424 100644 (file)
@@ -618,6 +618,7 @@ package body Switch.C is
 
                   when 'S' =>
                      Generate_SCO := True;
+                     Generate_SCO_Instance_Table := True;
                      Ptr := Ptr + 1;
 
                   --  -gnatet (generate target dependent information)
index cf5817738520cb6b9d2052ab0020765871d6ec9c..96cace5bd9640c9d2dfb320dfb01692d53683801 100644 (file)
@@ -1402,11 +1402,11 @@ package VMS_Data is
    --   source.
 
    S_GCC_ChecksX : aliased constant S := "/NOCHECKS "                      &
-                                             "-gnatp,!-gnato,!-gnatE ";
+                                             "-gnatp,!-gnato,!-gnatE";
    --  NODOC (see /CHECKS)
 
    S_GCC_Chflov  : aliased constant S := "/FLOAT_OVERFLOW_CHECK "          &
-                                             "-gnateF ";
+                                             "-gnateF";
    --        /NOFLOAT_OVERFLOW_CHECK (D)
    --        /FLOAT_OVERFLOW_CHECK
    --
@@ -1414,7 +1414,7 @@ package VMS_Data is
    --   those using an unconstrained predefined type (i.e. no infinities).
 
    S_GCC_Compres : aliased constant S := "/COMPRESS_NAMES "                &
-                                             "-gnatC ";
+                                             "-gnatC";
    --        /NOCOMPRESS_NAMES (D)
    --        /COMPRESS_NAMES
    --