Check_Unset_Reference (P);
end if;
- -- Don't need access check if prefix is known to be non-null
+ -- We do not need access checks if prefix is known to be non-null
if Known_Non_Null (P) then
return;
- -- Don't need access checks if they are suppressed on the type
+ -- We do not need access checks if they are suppressed on the type
elsif Access_Checks_Suppressed (Etype (P)) then
return;
+
+ -- We do not need checks if we are not generating code (i.e. the
+ -- expander is not active). This is not just an optimization, there
+ -- are cases (e.g. with pragma Debug) where generating the checks
+ -- can cause real trouble).
+
+ elsif not Expander_Active then
+ return;
end if;
-- Case where P is an entity name
Expr := Expression (Expr);
elsif Nkind (Expr) = N_Function_Call
+ and then Is_Entity_Name (Name (Expr))
and then Is_RTE (Entity (Name (Expr)), RE_To_Address)
then
Expr := First (Parameter_Associations (Expr));
-- flag is not set anyway, or we are not doing code expansion.
if Backend_Overflow_Checks_On_Target
- or not Do_Overflow_Check (N)
- or not Expander_Active
+ or else not Do_Overflow_Check (N)
+ or else not Expander_Active
then
return;
end if;
-- part of the test is not controlled by the -gnato switch.
if Do_Division_Check (N) then
-
if (not ROK) or else (Rlo <= 0 and then 0 <= Rhi) then
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,