1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2017, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 with Atree
; use Atree
;
27 with Back_End
; use Back_End
;
31 with Debug
; use Debug
;
33 with Errout
; use Errout
;
36 with Fname
; use Fname
;
37 with Fname
.UF
; use Fname
.UF
;
39 with Ghost
; use Ghost
;
40 with Gnatvsn
; use Gnatvsn
;
43 with Lib
.Writ
; use Lib
.Writ
;
45 with Namet
; use Namet
;
48 with Osint
; use Osint
;
49 with Osint
.C
; use Osint
.C
;
50 with Output
; use Output
;
53 with Repinfo
; use Repinfo
;
55 with Rident
; use Rident
;
64 with Sem_SPARK
; use Sem_SPARK
;
67 with Sinfo
; use Sinfo
;
68 with Sinput
.L
; use Sinput
.L
;
69 with Snames
; use Snames
;
70 with Sprint
; use Sprint
;
72 with Stylesw
; use Stylesw
;
73 with Targparm
; use Targparm
;
76 with Treepr
; use Treepr
;
78 with Types
; use Types
;
80 with Uname
; use Uname
;
83 with Validsw
; use Validsw
;
85 with System
.Assertions
;
93 procedure Adjust_Global_Switches
;
94 -- There are various interactions between front-end switch settings,
95 -- including debug switch settings and target dependent parameters.
96 -- This procedure takes care of properly handling these interactions.
97 -- We do it after scanning out all the switches, so that we are not
98 -- depending on the order in which switches appear.
100 procedure Check_Bad_Body
(Unit_Node
: Node_Id
; Unit_Kind
: Node_Kind
);
101 -- Called to check whether a unit described by its compilation unit node
102 -- and kind has a bad body.
104 procedure Check_Rep_Info
;
105 -- Called when we are not generating code, to check if -gnatR was requested
106 -- and if so, explain that we will not be honoring the request.
108 procedure Post_Compilation_Validation_Checks
;
109 -- This procedure performs various validation checks that have to be left
110 -- to the end of the compilation process, after generating code but before
111 -- issuing error messages. In particular, these checks generally require
112 -- the information provided by the back end in back annotation of declared
113 -- entities (e.g. actual size and alignment values chosen by the back end).
115 ----------------------------
116 -- Adjust_Global_Switches --
117 ----------------------------
119 procedure Adjust_Global_Switches
is
120 procedure SPARK_Library_Warning
(Kind
: String);
121 -- Issue a warning in GNATprove mode if the run-time library does not
122 -- fully support IEEE-754 floating-point semantics.
124 ---------------------------
125 -- SPARK_Library_Warning --
126 ---------------------------
128 procedure SPARK_Library_Warning
(Kind
: String) is
131 ("warning: run-time library may be configured incorrectly");
133 ("warning: (SPARK analysis requires support for " & Kind
& ')');
134 end SPARK_Library_Warning
;
136 -- Start of processing for Adjust_Global_Switches
139 -- Define pragma GNAT_Annotate as an alias of pragma Annotate, to be
140 -- able to work around bootstrap limitations with the old syntax of
141 -- pragma Annotate, and use pragma GNAT_Annotate in compiler sources
144 Map_Pragma_Name
(From
=> Name_Gnat_Annotate
, To
=> Name_Annotate
);
146 -- -gnatd.M enables Relaxed_RM_Semantics
148 if Debug_Flag_Dot_MM
then
149 Relaxed_RM_Semantics
:= True;
152 -- -gnatd.1 enables unnesting of subprograms
154 if Debug_Flag_Dot_1
then
155 Unnest_Subprogram_Mode
:= True;
158 -- -gnatd.u enables special C expansion mode
160 if Debug_Flag_Dot_U
then
161 Modify_Tree_For_C
:= True;
164 -- Set all flags required when generating C code
166 if Generate_C_Code
then
167 Modify_Tree_For_C
:= True;
168 Unnest_Subprogram_Mode
:= True;
169 Minimize_Expression_With_Actions
:= True;
170 Expand_Nonbinary_Modular_Ops
:= True;
172 -- Set operating mode to Generate_Code to benefit from full front-end
173 -- expansion (e.g. generics).
175 Operating_Mode
:= Generate_Code
;
177 -- Suppress alignment checks since we do not have access to alignment
178 -- info on the target.
180 Suppress_Options
.Suppress
(Alignment_Check
) := False;
183 -- -gnatd.E sets Error_To_Warning mode, causing selected error messages
184 -- to be treated as warnings instead of errors.
186 if Debug_Flag_Dot_EE
then
187 Error_To_Warning
:= True;
190 -- -gnatdJ sets Include_Subprogram_In_Messages, adding the related
191 -- subprogram as part of the error and warning messages.
193 if Debug_Flag_JJ
then
194 Include_Subprogram_In_Messages
:= True;
197 -- Disable CodePeer_Mode in Check_Syntax, since we need front-end
200 if Operating_Mode
= Check_Syntax
then
201 CodePeer_Mode
:= False;
204 -- Set ASIS mode if -gnatt and -gnatc are set
206 if Operating_Mode
= Check_Semantics
and then Tree_Output
then
209 -- Set ASIS GNSA mode if -gnatd.H is set
211 if Debug_Flag_Dot_HH
then
212 ASIS_GNSA_Mode
:= True;
215 -- Turn off inlining in ASIS mode, since ASIS cannot handle the extra
216 -- information in the trees caused by inlining being active.
218 -- More specifically, the tree seems to be malformed from the ASIS
219 -- point of view if -gnatc and -gnatn appear together???
221 Inline_Active
:= False;
223 -- Turn off SCIL generation and CodePeer mode in semantics mode,
224 -- since SCIL requires front-end expansion.
226 Generate_SCIL
:= False;
227 CodePeer_Mode
:= False;
230 -- SCIL mode needs to disable front-end inlining since the generated
231 -- trees (in particular order and consistency between specs compiled
232 -- as part of a main unit or as part of a with-clause) are causing
235 if Generate_SCIL
then
236 Front_End_Inlining
:= False;
239 -- Tune settings for optimal SCIL generation in CodePeer mode
241 if CodePeer_Mode
then
243 -- Turn off gnatprove mode (which can be set via e.g. -gnatd.F), not
244 -- compatible with CodePeer mode.
246 GNATprove_Mode
:= False;
247 Debug_Flag_Dot_FF
:= False;
249 -- Turn off C tree generation, not compatible with CodePeer mode. We
250 -- do not expect this to happen in normal use, since both modes are
251 -- enabled by special tools, but it is useful to turn off these flags
252 -- this way when we are doing CodePeer tests on existing test suites
253 -- that may have -gnateg set, to avoid the need for special casing.
255 Modify_Tree_For_C
:= False;
256 Generate_C_Code
:= False;
257 Unnest_Subprogram_Mode
:= False;
259 -- Turn off inlining, confuses CodePeer output and gains nothing
261 Front_End_Inlining
:= False;
262 Inline_Active
:= False;
264 -- Disable front-end optimizations, to keep the tree as close to the
265 -- source code as possible, and also to avoid inconsistencies between
266 -- trees when using different optimization switches.
268 Optimization_Level
:= 0;
270 -- Enable some restrictions systematically to simplify the generated
271 -- code (and ease analysis). Note that restriction checks are also
272 -- disabled in CodePeer mode, see Restrict.Check_Restriction, and
273 -- user specified Restrictions pragmas are ignored, see
274 -- Sem_Prag.Process_Restrictions_Or_Restriction_Warnings.
276 Restrict
.Restrictions
.Set
(No_Exception_Registration
) := True;
277 Restrict
.Restrictions
.Set
(No_Initialize_Scalars
) := True;
278 Restrict
.Restrictions
.Set
(No_Task_Hierarchy
) := True;
279 Restrict
.Restrictions
.Set
(No_Abort_Statements
) := True;
280 Restrict
.Restrictions
.Set
(Max_Asynchronous_Select_Nesting
) := True;
281 Restrict
.Restrictions
.Value
(Max_Asynchronous_Select_Nesting
) := 0;
283 -- Enable pragma Ignore_Pragma (Global) to support legacy code. As a
284 -- consequence, Refined_Global pragma should be ignored as well, as
285 -- it is only allowed on a body when pragma Global is given for the
288 Set_Name_Table_Boolean3
(Name_Global
, True);
289 Set_Name_Table_Boolean3
(Name_Refined_Global
, True);
291 -- Suppress division by zero checks since they are handled
292 -- implicitly by CodePeer.
294 -- Turn off dynamic elaboration checks: generates inconsistencies in
295 -- trees between specs compiled as part of a main unit or as part of
298 -- Turn off alignment checks: these cannot be proved statically by
299 -- CodePeer and generate false positives.
301 -- Enable all other language checks
303 Suppress_Options
.Suppress
:=
304 (Alignment_Check
=> True,
305 Division_Check
=> True,
306 Elaboration_Check
=> True,
309 Dynamic_Elaboration_Checks
:= False;
311 -- Set STRICT mode for overflow checks if not set explicitly. This
312 -- prevents suppressing of overflow checks by default, in code down
315 if Suppress_Options
.Overflow_Mode_General
= Not_Set
then
316 Suppress_Options
.Overflow_Mode_General
:= Strict
;
317 Suppress_Options
.Overflow_Mode_Assertions
:= Strict
;
320 -- CodePeer handles division and overflow checks directly, based on
321 -- the marks set by the frontend, hence no special expansion should
322 -- be performed in the frontend for division and overflow checks.
324 Backend_Divide_Checks_On_Target
:= True;
325 Backend_Overflow_Checks_On_Target
:= True;
327 -- Kill debug of generated code, since it messes up sloc values
329 Debug_Generated_Code
:= False;
331 -- Ditto for -gnateG which interacts badly with handling of pragma
332 -- Annotate in gnat2scil.
334 Generate_Processed_File
:= False;
336 -- Disable Exception_Extra_Info (-gnateE) which generates more
337 -- complex trees with no added value, and may confuse CodePeer.
339 Exception_Extra_Info
:= False;
341 -- Turn cross-referencing on in case it was disabled (e.g. by -gnatD)
342 -- to support source navigation.
346 -- Polling mode forced off, since it generates confusing junk
348 Polling_Required
:= False;
350 -- Set operating mode to Generate_Code to benefit from full front-end
351 -- expansion (e.g. generics).
353 Operating_Mode
:= Generate_Code
;
355 -- We need SCIL generation of course
357 Generate_SCIL
:= True;
359 -- Enable assertions, since they give CodePeer valuable extra info
361 Assertions_Enabled
:= True;
363 -- Set normal RM validity checking and checking of copies (to catch
364 -- e.g. wrong values used in unchecked conversions).
365 -- All other validity checking is turned off, since this can generate
366 -- very complex trees that only confuse CodePeer and do not bring
367 -- enough useful info.
369 Reset_Validity_Check_Options
;
370 Validity_Check_Default
:= True;
371 Validity_Check_Copies
:= True;
372 Check_Validity_Of_Parameters
:= False;
374 -- Turn off style check options and ignore any style check pragmas
375 -- since we are not interested in any front-end warnings when we are
376 -- getting CodePeer output.
378 Reset_Style_Check_Options
;
379 Ignore_Style_Checks_Pragmas
:= True;
381 -- Always perform semantics and generate ali files in CodePeer mode,
382 -- so that a gnatmake -c -k will proceed further when possible.
384 Force_ALI_Tree_File
:= True;
385 Try_Semantics
:= True;
387 -- Make the Ada front end more liberal so that the compiler will
388 -- allow illegal code that is allowed by other compilers. CodePeer
389 -- is in the business of finding problems, not enforcing rules.
390 -- This is useful when using CodePeer mode with other compilers.
392 Relaxed_RM_Semantics
:= True;
394 if not Generate_CodePeer_Messages
then
396 -- Suppress compiler warnings by default when generating SCIL for
397 -- CodePeer, except when combined with -gnateC where we do want to
398 -- emit GNAT warnings.
400 Warning_Mode
:= Suppress
;
403 -- Disable all simple value propagation. This is an optimization
404 -- which is valuable for code optimization, and also for generation
405 -- of compiler warnings, but these are being turned off by default,
406 -- and CodePeer generates better messages (referencing original
407 -- variables) this way.
408 -- Do this only if -gnatws is set (the default with -gnatcC), so that
409 -- if warnings are enabled, we'll get better messages from GNAT.
411 if Warning_Mode
= Suppress
then
412 Debug_Flag_MM
:= True;
416 -- Enable some individual switches that are implied by relaxed RM
419 if Relaxed_RM_Semantics
then
420 Opt
.Allow_Integer_Address
:= True;
421 Overriding_Renamings
:= True;
422 Treat_Categorization_Errors_As_Warnings
:= True;
425 -- Enable GNATprove_Mode when using -gnatd.F switch
427 if Debug_Flag_Dot_FF
then
428 GNATprove_Mode
:= True;
431 -- GNATprove_Mode is also activated by default in the gnat2why
434 if GNATprove_Mode
then
436 -- Turn off CodePeer mode (which can be set via e.g. -gnatC or
437 -- -gnateC), not compatible with GNATprove mode.
439 CodePeer_Mode
:= False;
440 Generate_SCIL
:= False;
442 -- Turn off C tree generation, not compatible with GNATprove mode. We
443 -- do not expect this to happen in normal use, since both modes are
444 -- enabled by special tools, but it is useful to turn off these flags
445 -- this way when we are doing GNATprove tests on existing test suites
446 -- that may have -gnateg set, to avoid the need for special casing.
448 Modify_Tree_For_C
:= False;
449 Generate_C_Code
:= False;
450 Unnest_Subprogram_Mode
:= False;
452 -- Turn off inlining, which would confuse formal verification output
455 Front_End_Inlining
:= False;
456 Inline_Active
:= False;
458 -- Issue warnings for failure to inline subprograms, as otherwise
459 -- expected in GNATprove mode for the local subprograms without
462 Ineffective_Inline_Warnings
:= True;
464 -- Disable front-end optimizations, to keep the tree as close to the
465 -- source code as possible, and also to avoid inconsistencies between
466 -- trees when using different optimization switches.
468 Optimization_Level
:= 0;
470 -- Enable some restrictions systematically to simplify the generated
471 -- code (and ease analysis).
473 Restrict
.Restrictions
.Set
(No_Initialize_Scalars
) := True;
475 -- Note: at this point we used to suppress various checks, but that
476 -- is not what we want. We need the semantic processing for these
477 -- checks (which will set flags like Do_Overflow_Check, showing the
478 -- points at which potential checks are required semantically). We
479 -- don't want the expansion associated with these checks, but that
480 -- happens anyway because this expansion is simply not done in the
481 -- SPARK version of the expander.
483 -- On the contrary, we need to enable explicitly all language checks,
484 -- as they may have been suppressed by the use of switch -gnatp.
486 Suppress_Options
.Suppress
:= (others => False);
488 -- Detect overflow on unconstrained floating-point types, such as
489 -- the predefined types Float, Long_Float and Long_Long_Float from
490 -- package Standard. Not necessary if float overflows are checked
491 -- (Machine_Overflow true), since appropriate Do_Overflow_Check flags
492 -- will be set in any case.
494 Check_Float_Overflow
:= not Machine_Overflows_On_Target
;
496 -- Set STRICT mode for overflow checks if not set explicitly. This
497 -- prevents suppressing of overflow checks by default, in code down
500 if Suppress_Options
.Overflow_Mode_General
= Not_Set
then
501 Suppress_Options
.Overflow_Mode_General
:= Strict
;
502 Suppress_Options
.Overflow_Mode_Assertions
:= Strict
;
505 -- Kill debug of generated code, since it messes up sloc values
507 Debug_Generated_Code
:= False;
509 -- Turn cross-referencing on in case it was disabled (e.g. by -gnatD)
510 -- as it is needed for computing effects of subprograms in the formal
511 -- verification backend.
515 -- Polling mode forced off, since it generates confusing junk
517 Polling_Required
:= False;
519 -- Set operating mode to Check_Semantics, but a light front-end
520 -- expansion is still performed.
522 Operating_Mode
:= Check_Semantics
;
524 -- Enable assertions, since they give valuable extra information for
525 -- formal verification.
527 Assertions_Enabled
:= True;
529 -- Disable validity checks, since it generates code raising
530 -- exceptions for invalid data, which confuses GNATprove. Invalid
531 -- data is directly detected by GNATprove's flow analysis.
533 Validity_Checks_On
:= False;
534 Check_Validity_Of_Parameters
:= False;
536 -- Turn off style check options since we are not interested in any
537 -- front-end warnings when we are getting SPARK output.
539 Reset_Style_Check_Options
;
541 -- Suppress the generation of name tables for enumerations, which are
542 -- not needed for formal verification, and fall outside the SPARK
543 -- subset (use of pointers).
545 Global_Discard_Names
:= True;
547 -- Suppress the expansion of tagged types and dispatching calls,
548 -- which lead to the generation of non-SPARK code (use of pointers),
549 -- which is more complex to formally verify than the original source.
551 Tagged_Type_Expansion
:= False;
553 -- Detect that the runtime library support for floating-point numbers
554 -- may not be compatible with SPARK analysis of IEEE-754 floats.
556 if Denorm_On_Target
= False then
557 SPARK_Library_Warning
("float subnormals");
559 elsif Machine_Rounds_On_Target
= False then
560 SPARK_Library_Warning
("float rounding");
562 elsif Signed_Zeros_On_Target
= False then
563 SPARK_Library_Warning
("signed zeros");
567 -- Set Configurable_Run_Time mode if system.ads flag set or if the
568 -- special debug flag -gnatdY is set.
570 if Targparm
.Configurable_Run_Time_On_Target
or Debug_Flag_YY
then
571 Configurable_Run_Time_Mode
:= True;
574 -- Set -gnatRm mode if debug flag A set
576 if Debug_Flag_AA
then
577 Back_Annotate_Rep_Info
:= True;
578 List_Representation_Info
:= 1;
579 List_Representation_Info_Mechanisms
:= True;
582 -- Force Target_Strict_Alignment true if debug flag -gnatd.a is set
584 if Debug_Flag_Dot_A
then
585 Ttypes
.Target_Strict_Alignment
:= True;
588 -- Increase size of allocated entities if debug flag -gnatd.N is set
590 if Debug_Flag_Dot_NN
then
591 Atree
.Num_Extension_Nodes
:= Atree
.Num_Extension_Nodes
+ 1;
594 -- Disable static allocation of dispatch tables if -gnatd.t is enabled.
595 -- The front end's layout phase currently treats types that have
596 -- discriminant-dependent arrays as not being static even when a
597 -- discriminant constraint on the type is static, and this leads to
598 -- problems with subtypes of type Ada.Tags.Dispatch_Table_Wrapper. ???
600 if Debug_Flag_Dot_T
then
601 Building_Static_Dispatch_Tables
:= False;
604 -- Flip endian mode if -gnatd8 set
607 Ttypes
.Bytes_Big_Endian
:= not Ttypes
.Bytes_Big_Endian
;
610 -- Set and check exception mechanism. This is only meaningful when
611 -- compiling, and in particular not meaningful for special modes used
612 -- for program analysis rather than compilation: ASIS mode, CodePeer
613 -- mode and GNATprove mode.
615 if Operating_Mode
= Generate_Code
616 and then not (ASIS_Mode
or CodePeer_Mode
or GNATprove_Mode
)
618 case Targparm
.Frontend_Exceptions_On_Target
is
620 case Targparm
.ZCX_By_Default_On_Target
is
623 ("Run-time library configured incorrectly");
625 ("(requesting support for Frontend ZCX exceptions)");
626 raise Unrecoverable_Error
;
629 Exception_Mechanism
:= Front_End_SJLJ
;
633 case Targparm
.ZCX_By_Default_On_Target
is
635 Exception_Mechanism
:= Back_End_ZCX
;
637 Exception_Mechanism
:= Back_End_SJLJ
;
642 -- Set proper status for overflow check mechanism
644 -- If already set (by -gnato or above in SPARK or CodePeer mode) then we
645 -- have nothing to do.
647 if Opt
.Suppress_Options
.Overflow_Mode_General
/= Not_Set
then
650 -- Otherwise set overflow mode defaults
653 -- Overflow checks are on by default (Suppress set False) except in
654 -- GNAT_Mode, where we want them off by default (we are not ready to
655 -- enable overflow checks in the compiler yet, for one thing the case
656 -- of 64-bit checks needs System.Arith_64 which is not a compiler
657 -- unit and it is a pain to try to include it in the compiler.
659 Suppress_Options
.Suppress
(Overflow_Check
) := GNAT_Mode
;
661 -- Set appropriate default overflow handling mode. Note: at present
662 -- we set STRICT in all three of the following cases. They are
663 -- separated because in the future we may make different choices.
665 -- By default set STRICT mode if -gnatg in effect
668 Suppress_Options
.Overflow_Mode_General
:= Strict
;
669 Suppress_Options
.Overflow_Mode_Assertions
:= Strict
;
671 -- If we have backend divide and overflow checks, then by default
672 -- overflow checks are STRICT. Historically this code used to also
673 -- activate overflow checks, although no target currently has these
674 -- flags set, so this was dead code anyway.
676 elsif Targparm
.Backend_Divide_Checks_On_Target
678 Targparm
.Backend_Overflow_Checks_On_Target
680 Suppress_Options
.Overflow_Mode_General
:= Strict
;
681 Suppress_Options
.Overflow_Mode_Assertions
:= Strict
;
683 -- Otherwise for now, default is STRICT mode. This may change in the
684 -- future, but for now this is the compatible behavior with previous
688 Suppress_Options
.Overflow_Mode_General
:= Strict
;
689 Suppress_Options
.Overflow_Mode_Assertions
:= Strict
;
693 -- Set default for atomic synchronization. As this synchronization
694 -- between atomic accesses can be expensive, and not typically needed
695 -- on some targets, an optional target parameter can turn the option
696 -- off. Note Atomic Synchronization is implemented as check.
698 Suppress_Options
.Suppress
(Atomic_Synchronization
) :=
699 not Atomic_Sync_Default_On_Target
;
701 -- Set default for Alignment_Check, if we are on a machine with non-
702 -- strict alignment, then we suppress this check, since it is over-
703 -- zealous for such machines.
705 if not Ttypes
.Target_Strict_Alignment
then
706 Suppress_Options
.Suppress
(Alignment_Check
) := True;
709 -- Set switch indicating if back end can handle limited types, and
710 -- guarantee that no incorrect copies are made (e.g. in the context
711 -- of an if or case expression).
713 -- Debug flag -gnatd.L decisively sets usage on
715 if Debug_Flag_Dot_LL
then
716 Back_End_Handles_Limited_Types
:= True;
718 -- If no debug flag, usage off for SCIL cases
720 elsif Generate_SCIL
then
721 Back_End_Handles_Limited_Types
:= False;
723 -- Otherwise normal gcc back end, for now still turn flag off by
724 -- default, since there are unresolved problems in the front end.
727 Back_End_Handles_Limited_Types
:= False;
730 -- If the inlining level has not been set by the user, compute it from
731 -- the optimization level: 1 at -O1/-O2 (and -Os), 2 at -O3 and above.
733 if Inline_Level
= 0 then
734 if Optimization_Level
< 3 then
741 -- Treat -gnatn as equivalent to -gnatN for non-GCC targets
743 if Inline_Active
and not Front_End_Inlining
then
745 -- We really should have a tag for this, what if we added a new
746 -- back end some day, it would not be true for this test, but it
747 -- would be non-GCC, so this is a bit troublesome ???
749 Front_End_Inlining
:= Generate_C_Code
;
752 -- Set back-end inlining indication
756 -- No back-end inlining available on C generation
760 -- No back-end inlining in GNATprove mode, since it just confuses
761 -- the formal verification process.
763 and then not GNATprove_Mode
765 -- No back-end inlining if front-end inlining explicitly enabled.
766 -- Done to minimize the output differences to customers still using
767 -- this deprecated switch; in addition, this behavior reduces the
768 -- output differences in old tests.
770 and then not Front_End_Inlining
772 -- Back-end inlining is disabled if debug flag .z is set
774 and then not Debug_Flag_Dot_Z
;
776 -- Output warning if -gnateE specified and cannot be supported
778 if Exception_Extra_Info
779 and then Restrict
.No_Exception_Handlers_Set
783 ("warning: extra exception information (-gnateE) was specified");
786 ("warning: this capability is not available in this configuration");
791 -- Finally capture adjusted value of Suppress_Options as the initial
792 -- value for Scope_Suppress, which will be modified as we move from
793 -- scope to scope (by Suppress/Unsuppress/Overflow_Checks pragmas).
795 Sem
.Scope_Suppress
:= Opt
.Suppress_Options
;
796 end Adjust_Global_Switches
;
802 procedure Check_Bad_Body
(Unit_Node
: Node_Id
; Unit_Kind
: Node_Kind
) is
803 Fname
: File_Name_Type
;
805 procedure Bad_Body_Error
(Msg
: String);
806 -- Issue message for bad body found
812 procedure Bad_Body_Error
(Msg
: String) is
814 Error_Msg_N
(Msg
, Unit_Node
);
815 Error_Msg_File_1
:= Fname
;
816 Error_Msg_N
("remove incorrect body in file{!", Unit_Node
);
821 Sname
: Unit_Name_Type
;
822 Src_Ind
: Source_File_Index
;
824 -- Start of processing for Check_Bad_Body
827 -- Nothing to do if we are only checking syntax, because we don't know
828 -- enough to know if we require or forbid a body in this case.
830 if Operating_Mode
= Check_Syntax
then
834 -- Check for body not allowed
836 if (Unit_Kind
= N_Package_Declaration
837 and then not Body_Required
(Unit_Node
))
838 or else (Unit_Kind
= N_Generic_Package_Declaration
839 and then not Body_Required
(Unit_Node
))
840 or else Unit_Kind
= N_Package_Renaming_Declaration
841 or else Unit_Kind
= N_Subprogram_Renaming_Declaration
842 or else Nkind
(Original_Node
(Unit
(Unit_Node
)))
843 in N_Generic_Instantiation
845 Sname
:= Unit_Name
(Main_Unit
);
847 -- If we do not already have a body name, then get the body name
849 if not Is_Body_Name
(Sname
) then
850 Sname
:= Get_Body_Name
(Sname
);
853 Fname
:= Get_File_Name
(Sname
, Subunit
=> False);
854 Src_Ind
:= Load_Source_File
(Fname
);
856 -- Case where body is present and it is not a subunit. Exclude the
857 -- subunit case, because it has nothing to do with the package we are
858 -- compiling. It is illegal for a child unit and a subunit with the
859 -- same expanded name (RM 10.2(9)) to appear together in a partition,
860 -- but there is nothing to stop a compilation environment from having
861 -- both, and the test here simply allows that. If there is an attempt
862 -- to include both in a partition, this is diagnosed at bind time. In
863 -- Ada 83 mode this is not a warning case.
865 -- Note that in general we do not give the message if the file in
866 -- question does not look like a body. This includes weird cases,
867 -- but in particular means that if the file is just a No_Body pragma,
868 -- then we won't give the message (that's the whole point of this
869 -- pragma, to be used this way and to cause the body file to be
870 -- ignored in this context).
872 if Src_Ind
> No_Source_File
873 and then Source_File_Is_Body
(Src_Ind
)
875 Errout
.Finalize
(Last_Call
=> False);
877 Error_Msg_Unit_1
:= Sname
;
879 -- Ada 83 case of a package body being ignored. This is not an
880 -- error as far as the Ada 83 RM is concerned, but it is almost
881 -- certainly not what is wanted so output a warning. Give this
882 -- message only if there were no errors, since otherwise it may
883 -- be incorrect (we may have misinterpreted a junk spec as not
884 -- needing a body when it really does).
886 if Unit_Kind
= N_Package_Declaration
887 and then Ada_Version
= Ada_83
888 and then Operating_Mode
= Generate_Code
889 and then Distribution_Stub_Mode
/= Generate_Caller_Stub_Body
890 and then not Compilation_Errors
893 ("package $$ does not require a body??", Unit_Node
);
894 Error_Msg_File_1
:= Fname
;
895 Error_Msg_N
("body in file{ will be ignored??", Unit_Node
);
897 -- Ada 95 cases of a body file present when no body is
898 -- permitted. This we consider to be an error.
901 -- For generic instantiations, we never allow a body
903 if Nkind
(Original_Node
(Unit
(Unit_Node
))) in
904 N_Generic_Instantiation
907 ("generic instantiation for $$ does not allow a body");
909 -- A library unit that is a renaming never allows a body
911 elsif Unit_Kind
in N_Renaming_Declaration
then
913 ("renaming declaration for $$ does not allow a body!");
915 -- Remaining cases are packages and generic packages. Here
916 -- we only do the test if there are no previous errors,
917 -- because if there are errors, they may lead us to
918 -- incorrectly believe that a package does not allow a
919 -- body when in fact it does.
921 elsif not Compilation_Errors
then
922 if Unit_Kind
= N_Package_Declaration
then
924 ("package $$ does not allow a body!");
926 elsif Unit_Kind
= N_Generic_Package_Declaration
then
928 ("generic package $$ does not allow a body!");
941 procedure Check_Rep_Info
is
943 if List_Representation_Info
/= 0
944 or else List_Representation_Info_Mechanisms
949 ("cannot generate representation information, no code generated");
956 ----------------------------------------
957 -- Post_Compilation_Validation_Checks --
958 ----------------------------------------
960 procedure Post_Compilation_Validation_Checks
is
962 -- Validate alignment check warnings. In some cases we generate warnings
963 -- about possible alignment errors because we don't know the alignment
964 -- that will be chosen by the back end. This routine is in charge of
965 -- getting rid of those warnings if we can tell they are not needed.
967 Checks
.Validate_Alignment_Check_Warnings
;
969 -- Validate compile time warnings and errors (using the values for size
970 -- and alignment annotated by the backend where possible). We need to
971 -- unlock temporarily these tables to reanalyze their expression.
976 Sem_Ch13
.Validate_Compile_Time_Warning_Errors
;
981 -- Validate unchecked conversions (using the values for size and
982 -- alignment annotated by the backend where possible).
984 Sem_Ch13
.Validate_Unchecked_Conversions
;
986 -- Validate address clauses (again using alignment values annotated
987 -- by the backend where possible).
989 Sem_Ch13
.Validate_Address_Clauses
;
991 -- Validate independence pragmas (again using values annotated by the
992 -- back end for component layout where possible) but only for non-GCC
993 -- back ends, as this is done a priori for GCC back ends.
994 -- ??? We use to test for AAMP_On_Target which is now gone, consider
996 -- if AAMP_On_Target then
997 -- Sem_Ch13.Validate_Independence;
999 end Post_Compilation_Validation_Checks
;
1003 Back_End_Mode
: Back_End
.Back_End_Mode_Type
;
1004 Ecode
: Exit_Code_Type
;
1006 Main_Unit_Kind
: Node_Kind
;
1007 -- Kind of main compilation unit node
1009 Main_Unit_Node
: Node_Id
;
1010 -- Compilation unit node for main unit
1012 -- Start of processing for Gnat1drv
1015 -- This inner block is set up to catch assertion errors and constraint
1016 -- errors. Since the code for handling these errors can cause another
1017 -- exception to be raised (namely Unrecoverable_Error), we need two
1018 -- nested blocks, so that the outer one handles unrecoverable error.
1021 -- Initialize all packages. For the most part, these initialization
1022 -- calls can be made in any order. Exceptions are as follows:
1024 -- Lib.Initialize need to be called before Scan_Compiler_Arguments,
1025 -- because it initializes a table filled by Scan_Compiler_Arguments.
1030 Lib
.Xref
.Initialize
;
1031 Scan_Compiler_Arguments
;
1032 Osint
.Add_Default_Search_Dirs
;
1049 Sem_Ch12
.Initialize
;
1050 Sem_Ch13
.Initialize
;
1051 Sem_Elim
.Initialize
;
1052 Sem_Eval
.Initialize
;
1053 Sem_Type
.Init_Interp_Tables
;
1055 -- Capture compilation date and time
1057 Opt
.Compilation_Time
:= System
.OS_Lib
.Current_Time_String
;
1059 -- Get the target parameters only when -gnats is not used, to avoid
1060 -- failing when there is no default runtime.
1062 if Operating_Mode
/= Check_Syntax
then
1064 -- Acquire target parameters from system.ads (package System source)
1066 Targparm_Acquire
: declare
1069 S
: Source_File_Index
;
1073 Name_Buffer
(1 .. 10) := "system.ads";
1076 S
:= Load_Source_File
(N
);
1078 -- Failed to read system.ads, fatal error
1080 if S
= No_Source_File
then
1082 ("fatal error, run-time library not installed correctly");
1083 Write_Line
("cannot locate file system.ads");
1084 raise Unrecoverable_Error
;
1086 elsif S
= No_Access_To_Source_File
then
1088 ("fatal error, run-time library not installed correctly");
1089 Write_Line
("no read access for file system.ads");
1090 raise Unrecoverable_Error
;
1092 -- Read system.ads successfully, remember its source index
1095 System_Source_File_Index
:= S
;
1098 -- Call to get target parameters. Note that the actual interface
1099 -- routines are in Tbuild. They can't be in this procedure because
1100 -- of accessibility issues.
1102 Targparm
.Get_Target_Parameters
1103 (System_Text
=> Source_Text
(S
),
1104 Source_First
=> Source_First
(S
),
1105 Source_Last
=> Source_Last
(S
),
1106 Make_Id
=> Tbuild
.Make_Id
'Access,
1107 Make_SC
=> Tbuild
.Make_SC
'Access,
1108 Set_NOD
=> Tbuild
.Set_NOD
'Access,
1109 Set_NSA
=> Tbuild
.Set_NSA
'Access,
1110 Set_NUA
=> Tbuild
.Set_NUA
'Access,
1111 Set_NUP
=> Tbuild
.Set_NUP
'Access);
1113 -- Acquire configuration pragma information from Targparm
1115 Restrict
.Restrictions
:= Targparm
.Restrictions_On_Target
;
1116 end Targparm_Acquire
;
1119 -- Perform various adjustments and settings of global switches
1121 Adjust_Global_Switches
;
1123 -- Output copyright notice if full list mode unless we have a list
1124 -- file, in which case we defer this so that it is output in the file.
1126 if (Verbose_Mode
or else (Full_List
and then Full_List_File_Name
= null))
1128 -- Debug flag gnatd7 suppresses this copyright notice
1130 and then not Debug_Flag_7
1133 Write_Str
("GNAT ");
1134 Write_Str
(Gnat_Version_String
);
1136 Write_Str
("Copyright 1992-" & Current_Year
1137 & ", Free Software Foundation, Inc.");
1141 -- Check we do not have more than one source file, this happens only in
1142 -- the case where the driver is called directly, it cannot happen when
1143 -- gnat1 is invoked from gcc in the normal case.
1145 if Osint
.Number_Of_Files
/= 1 then
1148 Osint
.Fail
("you must provide one source file");
1150 elsif Usage_Requested
then
1154 -- Generate target dependent output file if requested
1156 if Target_Dependent_Info_Write_Name
/= null then
1157 Set_Targ
.Write_Target_Dependent_Values
;
1160 -- Call the front end
1162 Original_Operating_Mode
:= Operating_Mode
;
1165 -- Exit with errors if the main source could not be parsed
1167 if Sinput
.Main_Source_File
<= No_Source_File
then
1168 Errout
.Finalize
(Last_Call
=> True);
1169 Errout
.Output_Messages
;
1170 Exit_Program
(E_Errors
);
1173 Main_Unit_Node
:= Cunit
(Main_Unit
);
1174 Main_Unit_Kind
:= Nkind
(Unit
(Main_Unit_Node
));
1176 Check_Bad_Body
(Main_Unit_Node
, Main_Unit_Kind
);
1178 -- In CodePeer mode we always delete old SCIL files before regenerating
1179 -- new ones, in case of e.g. errors, and also to remove obsolete scilx
1180 -- files generated by CodePeer itself.
1182 if CodePeer_Mode
then
1183 Comperr
.Delete_SCIL_Files
;
1186 -- Ditto for old C files before regenerating new ones
1188 if Generate_C_Code
then
1193 -- Exit if compilation errors detected
1195 Errout
.Finalize
(Last_Call
=> False);
1197 if Compilation_Errors
then
1199 Post_Compilation_Validation_Checks
;
1200 Errout
.Finalize
(Last_Call
=> True);
1201 Errout
.Output_Messages
;
1204 -- Generate ALI file if specially requested
1206 if Opt
.Force_ALI_Tree_File
then
1207 Write_ALI
(Object
=> False);
1211 Exit_Program
(E_Errors
);
1214 -- Set Generate_Code on main unit and its spec. We do this even if are
1215 -- not generating code, since Lib-Writ uses this to determine which
1216 -- units get written in the ali file.
1218 Set_Generate_Code
(Main_Unit
);
1220 -- If we have a corresponding spec, and it comes from source or it is
1221 -- not a generated spec for a child subprogram body, then we need object
1222 -- code for the spec unit as well.
1224 if Nkind
(Unit
(Main_Unit_Node
)) in N_Unit_Body
1225 and then not Acts_As_Spec
(Main_Unit_Node
)
1227 if Nkind
(Unit
(Main_Unit_Node
)) = N_Subprogram_Body
1228 and then not Comes_From_Source
(Library_Unit
(Main_Unit_Node
))
1233 (Get_Cunit_Unit_Number
(Library_Unit
(Main_Unit_Node
)));
1237 -- Case of no code required to be generated, exit indicating no error
1239 if Original_Operating_Mode
= Check_Syntax
then
1241 Errout
.Finalize
(Last_Call
=> True);
1242 Errout
.Output_Messages
;
1247 -- Use a goto instead of calling Exit_Program so that finalization
1250 goto End_Of_Program
;
1252 elsif Original_Operating_Mode
= Check_Semantics
then
1253 Back_End_Mode
:= Declarations_Only
;
1255 -- All remaining cases are cases in which the user requested that code
1256 -- be generated (i.e. no -gnatc or -gnats switch was used). Check if we
1257 -- can in fact satisfy this request.
1259 -- Cannot generate code if someone has turned off code generation for
1260 -- any reason at all. We will try to figure out a reason below.
1262 elsif Operating_Mode
/= Generate_Code
then
1263 Back_End_Mode
:= Skip
;
1265 -- We can generate code for a subprogram body unless there were missing
1266 -- subunits. Note that we always generate code for all generic units (a
1267 -- change from some previous versions of GNAT).
1269 elsif Main_Unit_Kind
= N_Subprogram_Body
1270 and then not Subunits_Missing
1272 Back_End_Mode
:= Generate_Object
;
1274 -- We can generate code for a package body unless there are subunits
1275 -- missing (note that we always generate code for generic units, which
1276 -- is a change from some earlier versions of GNAT).
1278 elsif Main_Unit_Kind
= N_Package_Body
and then not Subunits_Missing
then
1279 Back_End_Mode
:= Generate_Object
;
1281 -- We can generate code for a package declaration or a subprogram
1282 -- declaration only if it does not required a body.
1284 elsif Nkind_In
(Main_Unit_Kind
, N_Package_Declaration
,
1285 N_Subprogram_Declaration
)
1287 (not Body_Required
(Main_Unit_Node
)
1288 or else Distribution_Stub_Mode
= Generate_Caller_Stub_Body
)
1290 Back_End_Mode
:= Generate_Object
;
1292 -- We can generate code for a generic package declaration of a generic
1293 -- subprogram declaration only if does not require a body.
1295 elsif Nkind_In
(Main_Unit_Kind
, N_Generic_Package_Declaration
,
1296 N_Generic_Subprogram_Declaration
)
1297 and then not Body_Required
(Main_Unit_Node
)
1299 Back_End_Mode
:= Generate_Object
;
1301 -- Compilation units that are renamings do not require bodies, so we can
1302 -- generate code for them.
1304 elsif Nkind_In
(Main_Unit_Kind
, N_Package_Renaming_Declaration
,
1305 N_Subprogram_Renaming_Declaration
)
1307 Back_End_Mode
:= Generate_Object
;
1309 -- Compilation units that are generic renamings do not require bodies
1310 -- so we can generate code for them.
1312 elsif Main_Unit_Kind
in N_Generic_Renaming_Declaration
then
1313 Back_End_Mode
:= Generate_Object
;
1315 -- It is not an error to analyze in CodePeer mode a spec which requires
1316 -- a body, in order to generate SCIL for this spec.
1317 -- Ditto for Generate_C_Code mode and generate a C header for a spec.
1319 elsif CodePeer_Mode
or Generate_C_Code
then
1320 Back_End_Mode
:= Generate_Object
;
1322 -- It is not an error to analyze in GNATprove mode a spec which requires
1323 -- a body, when the body is not available. During frame condition
1324 -- generation, the corresponding ALI file is generated. During
1325 -- analysis, the spec is analyzed.
1327 elsif GNATprove_Mode
then
1328 Back_End_Mode
:= Declarations_Only
;
1330 -- In all other cases (specs which have bodies, generics, and bodies
1331 -- where subunits are missing), we cannot generate code and we generate
1332 -- a warning message. Note that generic instantiations are gone at this
1333 -- stage since they have been replaced by their instances.
1336 Back_End_Mode
:= Skip
;
1339 -- At this stage Back_End_Mode is set to indicate if the backend should
1340 -- be called to generate code. If it is Skip, then code generation has
1341 -- been turned off, even though code was requested by the original
1342 -- command. This is not an error from the user point of view, but it is
1343 -- an error from the point of view of the gcc driver, so we must exit
1344 -- with an error status.
1346 -- We generate an informative message (from the gcc point of view, it
1347 -- is an error message, but from the users point of view this is not an
1348 -- error, just a consequence of compiling something that cannot
1351 if Back_End_Mode
= Skip
then
1353 -- An ignored Ghost unit is rewritten into a null statement because
1354 -- it must not produce an ALI or object file. Do not emit any errors
1355 -- related to code generation because the unit does not exist.
1357 if Is_Ignored_Ghost_Unit
(Main_Unit_Node
) then
1359 -- Exit the gnat driver with success, otherwise external builders
1360 -- such as gnatmake and gprbuild will treat the compilation of an
1361 -- ignored Ghost unit as a failure. Note that this will produce
1362 -- an empty object file for the unit.
1366 -- Otherwise the unit is missing a crucial piece that prevents code
1373 Write_Str
("cannot generate code for file ");
1374 Write_Name
(Unit_File_Name
(Main_Unit
));
1376 if Subunits_Missing
then
1377 Write_Str
(" (missing subunits)");
1380 -- Force generation of ALI file, for backward compatibility
1382 Opt
.Force_ALI_Tree_File
:= True;
1384 elsif Main_Unit_Kind
= N_Subunit
then
1385 Write_Str
(" (subunit)");
1388 -- Do not generate an ALI file in this case, because it would
1389 -- become obsolete when the parent is compiled, and thus
1390 -- confuse tools such as gnatfind.
1392 elsif Main_Unit_Kind
= N_Subprogram_Declaration
then
1393 Write_Str
(" (subprogram spec)");
1396 -- Generic package body in GNAT implementation mode
1398 elsif Main_Unit_Kind
= N_Package_Body
and then GNAT_Mode
then
1399 Write_Str
(" (predefined generic)");
1402 -- Force generation of ALI file, for backward compatibility
1404 Opt
.Force_ALI_Tree_File
:= True;
1406 -- Only other case is a package spec
1409 Write_Str
(" (package spec)");
1414 Set_Standard_Output
;
1416 Post_Compilation_Validation_Checks
;
1417 Errout
.Finalize
(Last_Call
=> True);
1418 Errout
.Output_Messages
;
1422 -- Generate ALI file if specially requested, or for missing subunits,
1423 -- subunits or predefined generic.
1425 if Opt
.Force_ALI_Tree_File
then
1426 Write_ALI
(Object
=> False);
1432 -- Exit the driver with an appropriate status indicator. This will
1433 -- generate an empty object file for ignored Ghost units, otherwise
1434 -- no object file will be generated.
1436 Exit_Program
(Ecode
);
1439 -- In -gnatc mode, we only do annotation if -gnatt or -gnatR is also set
1440 -- as indicated by Back_Annotate_Rep_Info being set to True.
1442 -- We don't call for annotations on a subunit, because to process those
1443 -- the back end requires that the parent(s) be properly compiled.
1445 -- Annotation is suppressed for targets where front-end layout is
1446 -- enabled, because the front end determines representations.
1448 -- The back end is not invoked in ASIS mode with GNSA because all type
1449 -- representation information will be provided by the GNSA back end, not
1452 if Back_End_Mode
= Declarations_Only
1454 (not (Back_Annotate_Rep_Info
or Generate_SCIL
or GNATprove_Mode
)
1455 or else Main_Unit_Kind
= N_Subunit
1456 or else ASIS_GNSA_Mode
)
1458 Post_Compilation_Validation_Checks
;
1459 Errout
.Finalize
(Last_Call
=> True);
1460 Errout
.Output_Messages
;
1461 Write_ALI
(Object
=> False);
1469 -- Ensure that we properly register a dependency on system.ads, since
1470 -- even if we do not semantically depend on this, Targparm has read
1471 -- system parameters from the system.ads file.
1473 Lib
.Writ
.Ensure_System_Dependency
;
1475 -- Add dependencies, if any, on preprocessing data file and on
1476 -- preprocessing definition file(s).
1478 Prepcomp
.Add_Dependencies
;
1480 if GNATprove_Mode
then
1482 -- Perform the new SPARK checking rules for pointer aliasing. This is
1483 -- only activated in GNATprove mode and on SPARK code.
1485 if Debug_Flag_FF
then
1486 Check_Safe_Pointers
(Main_Unit_Node
);
1489 -- In GNATprove mode we're writing the ALI much earlier than usual
1490 -- as flow analysis needs the file present in order to append its
1491 -- own globals to it.
1493 -- Note: In GNATprove mode, an "object" file is always generated as
1494 -- the result of calling gnat1 or gnat2why, although this is not the
1495 -- same as the object file produced for compilation.
1497 Write_ALI
(Object
=> True);
1500 -- Some back ends (for instance Gigi) are known to rely on SCOs for code
1501 -- generation. Make sure they are available.
1503 if Generate_SCO
then
1504 Par_SCO
.SCO_Record_Filtered
;
1507 -- Back end needs to explicitly unlock tables it needs to touch
1521 -- Here we call the back end to generate the output code
1523 Generating_Code
:= True;
1524 Back_End
.Call_Back_End
(Back_End_Mode
);
1526 -- Once the backend is complete, we unlock the names table. This call
1527 -- allows a few extra entries, needed for example for the file name
1528 -- for the library file output.
1532 -- Generate the call-graph output of dispatching calls
1534 Exp_CG
.Generate_CG_Output
;
1536 -- Perform post compilation validation checks
1538 Post_Compilation_Validation_Checks
;
1540 -- Now we complete output of errors, rep info and the tree info. These
1541 -- are delayed till now, since it is perfectly possible for gigi to
1542 -- generate errors, modify the tree (in particular by setting flags
1543 -- indicating that elaboration is required, and also to back annotate
1544 -- representation information for List_Rep_Info).
1546 Errout
.Finalize
(Last_Call
=> True);
1547 Errout
.Output_Messages
;
1548 List_Rep_Info
(Ttypes
.Bytes_Big_Endian
);
1549 Inline
.List_Inlining_Info
;
1551 -- Only write the library if the backend did not generate any error
1552 -- messages. Otherwise signal errors to the driver program so that
1553 -- there will be no attempt to generate an object file.
1555 if Compilation_Errors
then
1557 Exit_Program
(E_Errors
);
1560 if not GNATprove_Mode
then
1561 Write_ALI
(Object
=> (Back_End_Mode
= Generate_Object
));
1564 if not Compilation_Errors
then
1566 -- In case of ada backends, we need to make sure that the generated
1567 -- object file has a timestamp greater than the ALI file. We do this
1568 -- to make gnatmake happy when checking the ALI and obj timestamps,
1569 -- where it expects the object file being written after the ali file.
1571 -- Gnatmake's assumption is true for gcc platforms where the gcc
1572 -- wrapper needs to call the assembler after calling gnat1, but is
1573 -- not true for ada backends, where the object files are created
1574 -- directly by gnat1 (so are created before the ali file).
1576 Back_End
.Gen_Or_Update_Object_File
;
1579 -- Generate ASIS tree after writing the ALI file, since in ASIS mode,
1580 -- Write_ALI may in fact result in further tree decoration from the
1581 -- original tree file. Note that we dump the tree just before generating
1582 -- it, so that the dump will exactly reflect what is written out.
1587 -- Finalize name table and we are all done
1592 -- Handle fatal internal compiler errors
1594 when Rtsfind
.RE_Not_Available
=>
1595 Comperr
.Compiler_Abort
("RE_Not_Available");
1597 when System
.Assertions
.Assert_Failure
=>
1598 Comperr
.Compiler_Abort
("Assert_Failure");
1600 when Constraint_Error
=>
1601 Comperr
.Compiler_Abort
("Constraint_Error");
1603 when Program_Error
=>
1604 Comperr
.Compiler_Abort
("Program_Error");
1606 -- Assume this is a bug. If it is real, the message will in any case
1607 -- say Storage_Error, giving a strong hint.
1609 when Storage_Error
=>
1610 Comperr
.Compiler_Abort
("Storage_Error");
1612 when Unrecoverable_Error
=>
1616 Comperr
.Compiler_Abort
("exception");
1622 -- The outer exception handler handles an unrecoverable error
1625 when Unrecoverable_Error
=>
1626 Errout
.Finalize
(Last_Call
=> True);
1627 Errout
.Output_Messages
;
1630 Write_Str
("compilation abandoned");
1633 Set_Standard_Output
;
1636 Exit_Program
(E_Errors
);