PIPS
used_before_set.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "genC.h"
#include "linear.h"
#include "ri.h"
#include "effects.h"
#include "ri-util.h"
#include "prettyprint.h"
#include "effects-util.h"
#include "database.h"
#include "pipsdbm.h"
#include "resources.h"
#include "transformer.h"
#include "misc.h"
#include "properties.h"
#include "pipsmake.h"
#include "alias_private.h"
#include "instrumentation.h"
#include "ubs_private.h"
#include "effects-generic.h"
#include "effects-convex.h"
#include "effects-simple.h"
#include "conversion.h"
#include "text-util.h"
#include "alias-classes.h"
+ Include dependency graph for used_before_set.c:

Go to the source code of this file.

Macros

#define PREFIX1   "$UBS_CHECK"
 This analysis checks if the program uses a variable or an array element which has not been assigned a value. More...
 
#define PREFIX2   "$UBS_CHECK_END"
 

Functions

static void display_used_before_set_statistics ()
 
static list entities_to_expressions2 (list l_ent)
 
static string print_list_of_entities (list l)
 
static string print_list_of_expressions (list l)
 
static bool common_variable_in_module_scope_p (entity ent, entity mod)
 
static bool initialized_by_equivalent_variable_p (entity ent)
 
static Psysteme remove_temporal_variables_from_system (Psysteme ps)
 
static expression make_special_value (entity ent)
 
static expression make_test_condition (expression exp, entity ent)
 This function makes a test like X.EQ.100000 or id_nan(A(PHI1)) or ir_nan(A(I,B(J)) More...
 
static void initialize_scalar_variable (entity ent)
 This function generates an assignment that initializes the scalar variable. More...
 
static void initialize_array_variable (entity ent)
 This function generates code that initializes every array element in the array region to a special value. More...
 
static void verify_scalar_variable (entity ent)
 
static void verify_array_element (entity ent, expression exp)
 
static void verify_array_variable (entity ent, region reg)
 This function generates code that verifies if all array elements in the array region are initialized or not. More...
 
static void verify_used_before_set_expression (expression exp, statement s)
 
static void verify_used_before_set_call (call c, statement s)
 
static bool verify_used_before_set_statement_flt (statement s)
 
static void verify_used_before_set_statement ()
 
static void verify_formal_and_common_variables (entity ent, list l_callers)
 
static list words_numerical_dimension (dimension obj)
 This function prints a common variable with its numerical size, because we do not want to generate the PARAMETER declarations PARAMETER (NX=50) COMMON W(5*NX) => COMMON W(250) More...
 
static list words_common_variable (entity e)
 
static void insert_common_declaration (entity ent, entity sec)
 
static void insert_initialization (entity ent)
 
static void initialize_and_verify_common_variable (entity ent, region reg)
 
static void initialize_and_verify_local_variable (entity ent, region reg)
 
bool used_before_set (const char *module_name)
 used_before_set.c More...
 

Variables

static FILE * out
 
static FILE * out2
 
static entity current_entity = entity_undefined
 
static entity current_mod = entity_undefined
 
static statement module_statement = statement_undefined
 
static int number_of_may_uninitialized_scalar_variables = 0
 
static int number_of_may_uninitialized_array_variables = 0
 
static int number_of_uninitialized_scalar_variables = 0
 
static int number_of_uninitialized_array_variables = 0
 
static int number_of_added_verifications = 0
 
static int number_of_processed_modules = 0
 
static string file_name
 
static string initialization_file
 
static list l_ubs_checks = NIL
 
static list l_initialized_commons = NIL
 

Macro Definition Documentation

◆ PREFIX1

#define PREFIX1   "$UBS_CHECK"

This analysis checks if the program uses a variable or an array element which has not been assigned a value.

In this case, anything may happen: the program may appear to run normally, or may crash, or may behave unpredictably. We use IN regions that give a set of read variables not previously written. Depending on the nature of the variable: local, formal or global, we have different cases.
This is a top-down analysis that process a procedure before all its callees. Information given by callers is used to verify if we have to check for the formal parameters in the current module or not. In addition, we produce information in the resource MODULE.ubs to tell if the formal parameters of the called procedures have to be checked or not.
used_before_set > MODULE.ubs < PROGRAM.entities < MODULE.code < MODULE.in_regions < CALLERS.ubs Algorithm: take the list of IN regions of the module statement (attention, the IN region list contains the IN effect list and more exact, so always take the IN region list, although it is heavier) and check for each variable in this list. Case 1. Local variable a. if MUST IN at module statement, insert STOP 'Variable is used before set' b. else MAY IN at module statement,

  • insert an INITIALIZE function
  • insert a VERIFY function before each sub-statement with MUST IN region.
    If the sub-statement is a call site and we only have MAY IN, then update UBS resource of the current procedure with the name of the called procedure and the offset of corresponding formal parameters (the actual variable may occur in several places in the argument list) in order to check these formal variables in the callee's frame. Case 2. Formal variable If no UBS resource for this variable is stored in the callers => no need to VERIFY this variable. Otherwise, which means that there exists at least 1 actual argument that may not defined (but already INITIALIZED), then :
  • insert a VERIFY function before each sub-statement with MUST IN region. If the sub-statement is a call site and we only have MAY IN, then update UBS resource of the current procedure with the name of the called procedure and the offset of corresponding formal parameters (the actual variable may occur in several places in the argument list) in order to check these formal variables in the callee's frame. Case 3. Common variables, depend on if we have the main program or not. a. if the current module is the main program, or in general, has no callers (maybe unreachable, or a library case): for all kind of common variables (visible in the module or not), do like case 1. Attention, for the invisible variable, we have to declare the common in its INITIALIZE function. When updating the resource ubs, there are two possibilities:
  • (called procedure, common variable)
  • (called procedure, formal parameter) in case if the common variable is passed as actual argument. b. if not, the current module has several callers, do like case 2. If the sub-statement is a call site and we only have MAY IN => also update ubs resource for the current procedure with two possibilities

(called procedure, common variable)

  • (called procedure, formal parameter) in case if the common variable is passed as actual argument. ATTENTION : we have to treat variables initialized by a DATA statement and take care of variables in an EQUIVALENCE statement. Current IN effects/regions do not take into account if an equivalenced variable is defined, there no more IN effects/regions on the other :-) This must be its task in order to keep the analysis conservative !!!

Some possible improvements: a.If V is a local variable/or common variable in module with no caller and 1.There is no WRITE on V in the current module => no need INITIALIZE + VERIFY, insert STOP before each MUST IN
2.If before a MUST IN on V, there is no WRITE on V => no need VERIFY, insert STOP before this MUST IN No no no, because we always VERIFY the formal variable => the actual variable may not be INITIALIZED => false We must have a mechanism to tell the called procedure if it have to insert a VERIFY or a STOP. But with some call paths : VERIFY, the others : STOP => what to do ? Safe way => INITIALIZE and VERIFY all.

By using IN regions, we can limit the number of variables to be checked, and code instrumentation is only used when we do not have enough information. Only array elements in the MAY IN regions are initialized, and array elements in the EXACT IN regions are verified, not the whole array.

do i_pips = k,l a(i_pips) = undef enddo

<A(PHI)-IN-MAY-{K<=PHI<=L}> DO I = M,N A(I) =I ENDDO

do i_pips = k,l if (a(i_pips) == undef) stop "used before set" enddo

<A(PHI)-IN-EXACT-{K<=PHI<=L}> DO I = K,L X(I) = A(I) ENDDO

There are two possible implementations :

  1. Put checks in an instrumented file and then use a script to insert them into the initial code
  2. Insert checks directly in the code, but more complicated with gen_recurse, unstructured, and for different variables

Definition at line 149 of file used_before_set.c.

◆ PREFIX2

#define PREFIX2   "$UBS_CHECK_END"

Definition at line 150 of file used_before_set.c.

Function Documentation

◆ common_variable_in_module_scope_p()

static bool common_variable_in_module_scope_p ( entity  ent,
entity  mod 
)
static

Check if a common variable, i.e SUB1:COM1, declared in a common block BLOCK1 is visible in a module SUB2 or not

Definition at line 214 of file used_before_set.c.

215 {
216  /* Check if a common variable, i.e SUB1:COM1, declared in a common block BLOCK1
217  is visible in a module SUB2 or not */
219  MAP(ENTITY,e,
220  {
221  if (strcmp(entity_local_name(e),entity_local_name(ent)) == 0)
222  {
223  ram r1 = storage_ram(entity_storage(e));
224  ram r2 = storage_ram(entity_storage(ent));
225  entity a1 = ram_section(r1);
226  entity a2 = ram_section(r2);
227  if (a1 == a2) return true;
228  }
229  },d);
230  return false;
231 }
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
Definition: newgen_list.h:226
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
#define ENTITY(x)
ENTITY.
Definition: ri.h:2755
#define entity_storage(x)
Definition: ri.h:2794
#define code_declarations(x)
Definition: ri.h:784
#define ram_section(x)
Definition: ri.h:2249
#define value_code(x)
Definition: ri.h:3067
#define storage_ram(x)
Definition: ri.h:2521
#define entity_initial(x)
Definition: ri.h:2796
The structure used to build lists in NewGen.
Definition: newgen_list.h:41

References code_declarations, ENTITY, entity_initial, entity_local_name(), entity_storage, MAP, ram_section, storage_ram, and value_code.

Referenced by initialize_and_verify_common_variable(), and verify_used_before_set_statement_flt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ display_used_before_set_statistics()

static void display_used_before_set_statistics ( )
static

Definition at line 168 of file used_before_set.c.

169 {
170  user_log("\n Number of uninitialized scalar variables : %d",
172  user_log("\n Number of uninitialized array variables : %d",
174  user_log("\n Number of may uninitialized scalar variables : %d",
176  user_log("\n Number of may uninitialized array variables : %d",
178  user_log("\n Number of added verifications : %d",
180  user_log("\n Number of processed modules : %d\n",
182 }
void user_log(const char *format,...)
Definition: message.c:234
static int number_of_uninitialized_scalar_variables
static int number_of_added_verifications
static int number_of_may_uninitialized_scalar_variables
static int number_of_processed_modules
static int number_of_uninitialized_array_variables
static int number_of_may_uninitialized_array_variables

References number_of_added_verifications, number_of_may_uninitialized_array_variables, number_of_may_uninitialized_scalar_variables, number_of_processed_modules, number_of_uninitialized_array_variables, number_of_uninitialized_scalar_variables, and user_log().

Referenced by used_before_set().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ entities_to_expressions2()

static list entities_to_expressions2 ( list  l_ent)
static

Definition at line 184 of file used_before_set.c.

185 {
186  list l_exp = NIL;
187  MAP(ENTITY,ent,
188  {
189  l_exp = gen_nconc(l_exp, CONS(EXPRESSION,entity_to_expression(ent),NIL));
190  },l_ent);
191  return(l_exp);
192 }
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
list gen_nconc(list cp1, list cp2)
physically concatenates CP1 and CP2 but do not duplicates the elements
Definition: list.c:344
expression entity_to_expression(entity e)
if v is a constant, returns a constant call.
Definition: expression.c:165
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217

References CONS, ENTITY, entity_to_expression(), EXPRESSION, gen_nconc(), MAP, and NIL.

Referenced by initialize_array_variable(), and verify_array_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize_and_verify_common_variable()

static void initialize_and_verify_common_variable ( entity  ent,
region  reg 
)
static

Check if ent has already been initialized by a BLOCK DATA subprogram. Check if ent can also be initialized by an EQUIVALENCE variable

ram_shared does not work so we use common layout

ent is not in the main module scope. Since there may be variables in different common blocks with the same name => it is safe to add CALL INITIALIZATION_COMMONNAME for each common block, then add in subroutine INITIALIZATION_COMMONNAME the common, type, parameter declaration + common variable initializations

TO BE IMPROVED, do not verify unvisible common variable

Definition at line 902 of file used_before_set.c.

903 {
904  /* Check if ent has already been initialized by a BLOCK DATA subprogram.
905  Check if ent can also be initialized by an EQUIVALENCE variable */
906  storage s = entity_storage(ent);
907  ram r = storage_ram(s);
908  entity sec = ram_section(r);
909  list l_layout = area_layout(type_area(entity_type(sec)));
911  /* ram_shared does not work so we use common layout*/
912  MAP(ENTITY,other,
913  {
914  if (entities_may_conflict_p(ent,other))
915  {
916  const char* mod_name = entity_module_name(other);
917  entity mod = local_name_to_top_level_entity(mod_name);
918  if (entity_blockdata_p(mod))
919  {
920  if (entity_scalar_p(ent))
921  user_log("\nCommon scalar variable %s is initialized by BLOCKDATA\n",entity_name(ent));
922  else
923  user_log("\nCommon array variable %s is fully initialized by BLOCKDATA???\n",
924  entity_name(ent));
925  return;
926  }
927  }
928  },l_layout);
929  if (approximation_exact_p(app))
930  {
931  pips_debug(2,"MUST IN at module statement\n");
932  user_log("\nCommon variable %s is used before set\n",entity_name(ent));
933  if (entity_scalar_p(ent))
935  else
937  fprintf(out,"%s\t%s\t%s\t(0,1)\n",PREFIX1,file_name,module_local_name(current_mod));
938  fprintf(out," STOP 'Variable %s is used before set'\n",entity_name(ent));
939  fprintf(out,"%s\n",PREFIX2);
940  }
941  else
942  {
943  pips_debug(2,"MAY IN at module statement\n");
944  user_log("\nCommon variable %s maybe used before set\n",entity_name(ent));
946  {
947  fprintf(out,"%s\t%s\t%s\t(0,1)\n",PREFIX1,file_name,module_local_name(current_mod));
948  insert_initialization(ent);
949  fprintf(out,"%s\n",PREFIX2);
950  }
951  else
952  {
953  /* ent is not in the main module scope.
954  Since there may be variables in different common blocks with the same name => it is safe
955  to add CALL INITIALIZATION_COMMONNAME for each common block, then add in subroutine
956  INITIALIZATION_COMMONNAME the common, type, parameter declaration + common variable
957  initializations */
959  const char* area_name = module_local_name(sec);
960  ifdebug(1)
961  fprintf(stderr,"\nCommon variable %s not in main module scope\n",entity_name(ent));
963  {
964  fprintf(out,"%s\t%s\t%s\t(0,1)\n",PREFIX1,file_name,module_local_name(current_mod));
965  if (strcmp(area_name, BLANK_COMMON_LOCAL_NAME) == 0)
966  {
967  fprintf(out," CALL INITIALIZE_BLANK\n");
968  fprintf(out2," SUBROUTINE INITIALIZE_BLANK\n");
969  }
970  else
971  {
972  fprintf(out," CALL INITIALIZE_%s\n",area_name);
973  fprintf(out2," SUBROUTINE INITIALIZE_%s\n",area_name);
974  }
975  fprintf(out,"%s\n",PREFIX2);
976  insert_common_declaration(ent,sec);
977  fprintf(out2,"C (0,1)\n");
978  fprintf(out2," END\n");
980  }
981  if (strcmp(area_name, BLANK_COMMON_LOCAL_NAME) == 0)
982  fprintf(out,"%s\t%s\tINITIALIZE_BLANK\t(0,1)\n",PREFIX1,initialization_file);
983  else
984  fprintf(out,"%s\t%s\tINITIALIZE_%s\t(0,1)\n",PREFIX1,initialization_file,area_name);
986  fprintf(out,"%s\n",PREFIX2);
987  }
988  /* TO BE IMPROVED, do not verify unvisible common variable*/
989  current_entity = ent;
992  }
993 }
#define region_approximation(reg)
#define approximation_exact_p(x)
Definition: effects.h:369
if(!(yy_init))
Definition: genread_lex.c:1029
bool entities_may_conflict_p(entity e1, entity e2)
Check if two entities may conflict.
Definition: conflicts.c:984
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define BLANK_COMMON_LOCAL_NAME
Definition: naming-local.h:68
int main(int argc, char *argv[])
MAIN is the C entry (in fact a renaming for BUILD).
Definition: new.c:39
static char * module
Definition: pips.c:74
bool entity_in_list_p(entity ent, list ent_l)
look for ent in ent_l
Definition: entity.c:2221
entity local_name_to_top_level_entity(const char *n)
This function try to find a top-level entity from a local name.
Definition: entity.c:1450
const char * module_local_name(entity e)
Returns the module local user name.
Definition: entity.c:582
bool entity_blockdata_p(entity e)
Definition: entity.c:712
const char * entity_module_name(entity e)
See comments about module_name().
Definition: entity.c:1092
bool entity_scalar_p(entity)
The concrete type of e is a scalar type.
Definition: variable.c:1113
#define entity_undefined
Definition: ri.h:2761
#define entity_name(x)
Definition: ri.h:2790
#define area_layout(x)
Definition: ri.h:546
#define type_area(x)
Definition: ri.h:2946
#define entity_type(x)
Definition: ri.h:2792
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
#define ifdebug(n)
Definition: sg.c:47
static FILE * out
static string initialization_file
static void insert_initialization(entity ent)
static FILE * out2
#define PREFIX1
This analysis checks if the program uses a variable or an array element which has not been assigned a...
static string file_name
static entity current_entity
static list l_initialized_commons
static void insert_common_declaration(entity ent, entity sec)
#define PREFIX2
static bool common_variable_in_module_scope_p(entity ent, entity mod)
static void verify_used_before_set_statement()
static entity current_mod

References approximation_exact_p, area_layout, BLANK_COMMON_LOCAL_NAME, common_variable_in_module_scope_p(), CONS, current_entity, current_mod, entities_may_conflict_p(), ENTITY, entity_blockdata_p(), entity_in_list_p(), entity_module_name(), entity_name, entity_scalar_p(), entity_storage, entity_type, entity_undefined, file_name, fprintf(), gen_nconc(), ifdebug, initialization_file, insert_common_declaration(), insert_initialization(), l_initialized_commons, local_name_to_top_level_entity(), MAP, module_local_name(), NIL, number_of_uninitialized_array_variables, number_of_uninitialized_scalar_variables, out, out2, pips_debug, PREFIX1, PREFIX2, ram_section, region_approximation, storage_ram, type_area, user_log(), and verify_used_before_set_statement().

Referenced by used_before_set().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize_and_verify_local_variable()

static void initialize_and_verify_local_variable ( entity  ent,
region  reg 
)
static

Check if ent has already been initialized by a DATA statement. There are 3 cases:

  1. ent is not initialized by any DATA statement
  2. ent is fully initialized by DATA statements
  3. ent is partially initialized, insert a sequence of assignments corresponding to the DATAs Check if ent can also be initialized by an EQUIVALENCE variable

Local variable ent is in a DATA or SAVE statement (distinguish DATA vs SAVE ???)

test to rewrite

Definition at line 995 of file used_before_set.c.

996 {
997  /* Check if ent has already been initialized by a DATA statement. There are 3 cases:
998  1. ent is not initialized by any DATA statement
999  2. ent is fully initialized by DATA statements
1000  3. ent is partially initialized, insert a sequence of assignments corresponding to
1001  the DATAs
1002  Check if ent can also be initialized by an EQUIVALENCE variable */
1003  if (variable_static_p(ent))
1004  {
1005  /* Local variable ent is in a DATA or SAVE statement (distinguish DATA vs SAVE ???) */
1006  if (entity_scalar_p(ent))
1007  user_log("\nLocal scalar variable %s is initialized by DATA\n",entity_name(ent));
1008  else
1009  user_log("\nLocal array variable %s is fully initialized by DATA???\n",entity_name(ent));
1010  }
1011  else
1012  {
1014  /* test to rewrite */
1015  user_log("\nLocal variable %s is initialized through EQUIVALENCE\n",entity_name(ent));
1016  else
1017  {
1019  if (approximation_exact_p(app))
1020  {
1021  pips_debug(2,"MUST IN at module statement\n");
1022  user_log("\nLocal variable %s is used before set\n",entity_name(ent));
1023  if (entity_scalar_p(ent))
1025  else
1027  fprintf(out,"%s\t%s\t%s\t(0,1)\n",PREFIX1,file_name,module_local_name(current_mod));
1028  fprintf(out," STOP 'Variable %s is used before set'\n",entity_name(ent));
1029  fprintf(out,"%s\n",PREFIX2);
1030  }
1031  else
1032  {
1033  pips_debug(2,"MAY IN at module statement\n");
1034  user_log("\nLocal variable %s maybe used before set\n",entity_name(ent));
1035  fprintf(out,"%s\t%s\t%s\t(0,1)\n",PREFIX1,file_name,module_local_name(current_mod));
1036  insert_initialization(ent);
1037  fprintf(out,"%s\n",PREFIX2);
1038  current_entity = ent;
1041  }
1042  }
1043  }
1044 }
bool variable_static_p(entity)
true if v appears in a SAVE statement, or in a DATA statement, or is declared static i C.
Definition: variable.c:1579
static bool initialized_by_equivalent_variable_p(entity ent)

References approximation_exact_p, current_entity, current_mod, entity_name, entity_scalar_p(), entity_undefined, file_name, fprintf(), initialized_by_equivalent_variable_p(), insert_initialization(), module_local_name(), number_of_uninitialized_array_variables, number_of_uninitialized_scalar_variables, out, pips_debug, PREFIX1, PREFIX2, region_approximation, user_log(), variable_static_p(), and verify_used_before_set_statement().

Referenced by used_before_set().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize_array_variable()

static void initialize_array_variable ( entity  ent)
static

This function generates code that initializes every array element in the array region to a special value.

We use the algorithm_row_echelon(initial system, list of variables to scan, return condition, returned enumeration system) to generate the nested loop.
The generated code will be like this: IF (condition) THEN DO PHI1 = low1,up1 DO PHI2 = low2,up2 A(PHI1,PHI2) = SNan ENDDO ENDDO ENDIF If bounds can not be computed from the region, we use bounds from the array declaration DO PHI1 = dec_low1,dec_up1 DO PHI2 = dec_low2,dec_up2 A(PHI1,PHI2) = SNan ENDDO ENDDO CURRENTLY: we cannot check if all lower/upper bounds can be generated for variables Phii from region => use bounds from array declarations ATTENTION: the initialization is expensive, it increases much execution time (number of array variables * size of arrays :-))

Attention, this analysis uses PHI entities, static variables of region => init_regions

The assumed-size case cannot happen, because formal variables are not initialized

Definition at line 386 of file used_before_set.c.

387 {
389  int n = gen_length(dims);
390  list l_phi = phi_entities_list(1,n);
391  /* Attention, this analysis uses PHI entities, static variables of region => init_regions*/
395  Psysteme row_echelon = entity_declaration_sc(ent);
396  /* The assumed-size case cannot happen, because formal variables are not initialized*/
397  smt = systeme_to_loop_nest(row_echelon,l_phi,smt,entity_intrinsic(DIVIDE_OPERATOR_NAME));
398  fprint_statement(out,smt);
399 }
reference make_reference(entity a1, list a2)
Definition: ri.c:2083
static reference ref
Current stmt (an integer)
Definition: adg_read_paf.c:163
statement systeme_to_loop_nest(Psysteme, list, statement, entity)
sc is used to generate the loop nest bounds for variables vars.
list phi_entities_list(int, int)
Psysteme entity_declaration_sc(entity)
size_t gen_length(const list l)
Definition: list.c:150
statement make_assign_statement(expression, expression)
Definition: statement.c:583
void fprint_statement(FILE *, statement)
Print statement "s" on file descriptor "fd".
Definition: statement.c:68
#define DIVIDE_OPERATOR_NAME
entity entity_intrinsic(const char *name)
FI: I do not understand this function name (see next one!).
Definition: entity.c:1292
expression reference_to_expression(reference r)
Definition: expression.c:196
#define type_variable(x)
Definition: ri.h:2949
#define variable_dimensions(x)
Definition: ri.h:3122
static list entities_to_expressions2(list l_ent)
static expression make_special_value(entity ent)
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207

References DIVIDE_OPERATOR_NAME, entities_to_expressions2(), entity_declaration_sc(), entity_intrinsic(), entity_type, exp, fprint_statement(), gen_length(), make_assign_statement(), make_reference(), make_special_value(), out, phi_entities_list(), ref, reference_to_expression(), systeme_to_loop_nest(), type_variable, and variable_dimensions.

Referenced by insert_initialization().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize_scalar_variable()

static void initialize_scalar_variable ( entity  ent)
static

This function generates an assignment that initializes the scalar variable.

Definition at line 357 of file used_before_set.c.

References entity_to_expression(), fprint_statement(), make_assign_statement(), make_special_value(), and out.

Referenced by insert_initialization().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialized_by_equivalent_variable_p()

static bool initialized_by_equivalent_variable_p ( entity  ent)
static

This is not true !!! We must follow the IN regions of the equivalent variables

Definition at line 233 of file used_before_set.c.

234 {
235  /* This is not true !!! We must follow the IN regions of the equivalent variables*/
236  storage s = entity_storage(ent);
237  list local_shared = ram_shared(storage_ram(s));
238  if (gen_length(local_shared)>0)
239  {
240  ifdebug(3)
241  {
242  pips_debug(3,"List of shared variables of %s \n",entity_name(ent));
243  print_entities(local_shared);
244  }
245  return true;
246  }
247  return false;
248 }
void print_entities(list l)
Definition: entity.c:167
#define ram_shared(x)
Definition: ri.h:2253

References entity_name, entity_storage, gen_length(), ifdebug, pips_debug, print_entities(), ram_shared, and storage_ram.

Referenced by initialize_and_verify_local_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert_common_declaration()

static void insert_common_declaration ( entity  ent,
entity  sec 
)
static

Definition at line 860 of file used_before_set.c.

861 {
862  const char* mod_name = entity_module_name(ent);
863  entity mod = local_name_to_top_level_entity(mod_name);
864  list entities = common_members_of_module(sec,mod,true);
865  ifdebug(3)
866  {
867  fprintf(stderr,"\nList of entities in the common declaration");
869  }
870  if (!ENDP(entities))
871  {
872  const char* area_name = module_local_name(sec);
873  bool comma = false;
874  fprintf(out2," COMMON ");
875  if (strcmp(area_name, BLANK_COMMON_LOCAL_NAME) != 0)
876  fprintf(out2,"/%s/ ", area_name);
877  MAP(ENTITY, ee,
878  {
879  if (comma) fprintf(out2,",");
880  else comma = true;
882  }, entities);
883  fprintf(out2,"\n");
884  }
886 }
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
void gen_free_list(list l)
free the spine of the list
Definition: list.c:327
struct _newgen_struct_entities_ * entities
Definition: hpf_private.h:89
list common_members_of_module(entity common, entity module, bool only_primary)
returns the list of entity to appear in the common declaration.
Definition: entity.c:1741
string words_to_string(cons *lw)
Definition: print.c:211
static list words_common_variable(entity e)

References BLANK_COMMON_LOCAL_NAME, common_members_of_module(), ENDP, ENTITY, entity_module_name(), fprintf(), gen_free_list(), ifdebug, local_name_to_top_level_entity(), MAP, module_local_name(), out2, print_entities(), words_common_variable(), and words_to_string().

Referenced by initialize_and_verify_common_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert_initialization()

static void insert_initialization ( entity  ent)
static

Definition at line 888 of file used_before_set.c.

889 {
890  if (entity_scalar_p(ent))
891  {
894  }
895  else
896  {
899  }
900 }
static void initialize_scalar_variable(entity ent)
This function generates an assignment that initializes the scalar variable.
static void initialize_array_variable(entity ent)
This function generates code that initializes every array element in the array region to a special va...

References entity_scalar_p(), initialize_array_variable(), initialize_scalar_variable(), number_of_may_uninitialized_array_variables, and number_of_may_uninitialized_scalar_variables.

Referenced by initialize_and_verify_common_variable(), and initialize_and_verify_local_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_special_value()

static expression make_special_value ( entity  ent)
static

nteger

loat

ogical : false = 0, true = 1

verloaded

omplex

tring

Definition at line 272 of file used_before_set.c.

273 {
274  basic b = entity_basic(ent);
275  switch (basic_tag(b)) {
276  case 0: /*integer*/
277  return int_to_expression(1000000000);
278  case 1: /*float*/
279  switch (basic_float(b)) {
280  case 4:
281  return make_call_expression(make_constant_entity("r_signaling_nan()",is_basic_float,4),NIL);
282  case 8:
283  return make_call_expression(make_constant_entity("d_signaling_nan()",is_basic_float,8),NIL);
284  default:
285  user_log("\nInitialize floating number with more than 8 bytes ?");
286  return make_call_expression(MakeConstant("which_value",is_basic_float),NIL);
287  }
288  case 2: /*logical : false = 0, true = 1*/
289  return int_to_expression(2);
290  case 3: /*overloaded*/
291  user_log("\nInitialize overloaded ?");
293  case 4: /*complex*/
294  switch (basic_complex(b)) {
295  case 8:
296  return make_call_expression(make_constant_entity("CMPLX(r_signaling_nan(),r_signaling_nan())",
297  is_basic_complex,8),NIL);
298  case 16:
299  return make_call_expression(make_constant_entity("CMPLX(d_signaling_nan(),d_signaling_nan())",
300  is_basic_complex,16),NIL);
301  default:
302  user_log("\nInitialize complex number with more than 16 bytes ?");
303  return make_call_expression(MakeConstant("which_value",is_basic_complex),NIL);
304  }
305  case 5: /*string*/
306  return make_call_expression(MakeConstant("\'Nga Nguyen\'",is_basic_string),NIL);
307  default:
308  pips_internal_error("Unexpected basic tag");
309  return expression_undefined; // just to avoid gcc warning
310  }
311 }
entity make_constant_entity(string name, tag bt, size_t size)
For historical reason, call the Fortran version.
Definition: constant.c:301
entity MakeConstant(string name, tag bt)
Make a Fortran constant.
Definition: constant.c:351
#define pips_internal_error
Definition: misc-local.h:149
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
Definition: entity.c:1380
expression make_call_expression(entity e, list l)
Build an expression that call an function entity with an argument list.
Definition: expression.c:321
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
@ is_basic_string
Definition: ri.h:576
@ is_basic_float
Definition: ri.h:572
@ is_basic_overloaded
Definition: ri.h:574
@ is_basic_complex
Definition: ri.h:575
#define basic_tag(x)
Definition: ri.h:613
#define expression_undefined
Definition: ri.h:1223
#define basic_float(x)
Definition: ri.h:619
#define basic_complex(x)
Definition: ri.h:628

References basic_complex, basic_float, basic_tag, entity_basic(), expression_undefined, int_to_expression(), is_basic_complex, is_basic_float, is_basic_overloaded, is_basic_string, make_call_expression(), make_constant_entity(), MakeConstant(), NIL, pips_internal_error, and user_log().

Referenced by initialize_array_variable(), initialize_scalar_variable(), and make_test_condition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ make_test_condition()

static expression make_test_condition ( expression  exp,
entity  ent 
)
static

This function makes a test like X.EQ.100000 or id_nan(A(PHI1)) or ir_nan(A(I,B(J))

loat

omplex

Definition at line 314 of file used_before_set.c.

315 {
316  basic b = entity_basic(ent);
318  switch (basic_tag(b)) {
319  case 1: /*float*/
320  switch (basic_float(b)) {
321  case 4:
324  break;
325  case 8:
328  break;
329  default:
330  cond = eq_expression(exp,make_special_value(ent));
331  break;
332  }
333  break;
334  case 4:/*complex*/
335  switch (basic_complex(b)) {
336  case 8:
339  break;
340  case 16:
343  break;
344  default:
345  cond = eq_expression(exp,make_special_value(ent));
346  break;
347  }
348  break;
349  default:
350  cond = eq_expression(exp,make_special_value(ent));
351  break;
352  }
353  return cond;
354 }
#define eq_expression(e1, e2)

References basic_complex, basic_float, basic_tag, CONS, entity_basic(), eq_expression, exp, EXPRESSION, expression_undefined, is_basic_complex, is_basic_float, make_call_expression(), make_constant_entity(), make_special_value(), and NIL.

Referenced by verify_array_element(), verify_array_variable(), and verify_scalar_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_list_of_entities()

static string print_list_of_entities ( list  l)
static

Definition at line 194 of file used_before_set.c.

195 {
196  string retour = "";
197  MAP(ENTITY, e,
198  {
199  retour = strdup(concatenate(retour,",",entity_local_name(e),NULL));
200  }, l);
201  return retour;
202 }
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
char * strdup()

References concatenate(), ENTITY, entity_local_name(), MAP, and strdup().

Referenced by verify_array_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_list_of_expressions()

static string print_list_of_expressions ( list  l)
static

Definition at line 204 of file used_before_set.c.

205 {
206  string retour = "";
207  MAP(EXPRESSION, exp,
208  {
209  retour = strdup(concatenate(retour,",",expression_to_string(exp),NULL));
210  }, l);
211  return retour;
212 }
string expression_to_string(expression e)
Definition: expression.c:77

References concatenate(), exp, EXPRESSION, expression_to_string(), MAP, and strdup().

Referenced by verify_array_element().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ remove_temporal_variables_from_system()

static Psysteme remove_temporal_variables_from_system ( Psysteme  ps)
static

Project all init variables from the system ps, there are 2 cases :

  1. The result is not sure , there are over flow Return the SC_UNDEFINED
  2. The projection is exact

Definition at line 250 of file used_before_set.c.

251 {
252  /* Project all #init variables from the system ps,
253  there are 2 cases :
254  1. The result is not sure , there are over flow
255  Return the SC_UNDEFINED
256  2. The projection is exact */
257  if (!sc_empty_p(ps) && !sc_rn_p(ps))
258  {
259  Pvecteur pv_var = NULL;
260  Pbase b = ps->base;
261  for(; !VECTEUR_NUL_P(b);b = b->succ)
262  {
263  entity e = (entity) vecteur_var(b);
264  if (old_value_entity_p(e))
265  vect_add_elem(&pv_var, (Variable) e, VALUE_ONE);
266  }
267  return sc_system_projection_along_variables(ps, pv_var);
268  }
269  return ps;
270 }
struct _newgen_struct_entity_ * entity
Definition: abc_private.h:14
#define VALUE_ONE
bool sc_rn_p(Psysteme sc)
bool sc_rn_p(Psysteme sc): check if the set associated to sc is the whole space, rn
Definition: sc_alloc.c:369
bool sc_empty_p(Psysteme sc)
bool sc_empty_p(Psysteme sc): check if the set associated to sc is the constant sc_empty or not.
Definition: sc_alloc.c:350
Pbase base
Definition: sc-local.h:75
le type des coefficients dans les vecteurs: Value est defini dans le package arithmetique
Definition: vecteur-local.h:89
struct Svecteur * succ
Definition: vecteur-local.h:92
bool old_value_entity_p(entity)
Definition: value.c:936
#define vecteur_var(v)
#define VECTEUR_NUL_P(v)
void * Variable
arithmetique is a requirement for vecteur, but I do not want to inforce it in all pips files....
Definition: vecteur-local.h:60
void vect_add_elem(Pvecteur *pvect, Variable var, Value val)
void vect_add_elem(Pvecteur * pvect, Variable var, Value val): addition d'un vecteur colineaire au ve...
Definition: unaires.c:72

References Ssysteme::base, old_value_entity_p(), sc_empty_p(), sc_rn_p(), Svecteur::succ, VALUE_ONE, vect_add_elem(), VECTEUR_NUL_P, and vecteur_var.

Referenced by verify_array_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ used_before_set()

bool used_before_set ( const char *  module_name)

used_before_set.c

File instrument.out is used to store ubs checks

Set and get the current properties concerning regions

Get the code of the module

Get IN regions of the module

File xxx.database/Src/initialization.f contains all the initializations of global variables

Common variable in main program

Local variable in main program, but attention, IN regions contain also static variables of other modules !!!

Formal or common variable

Local variable

save to resource

Parameters
module_nameodule_name

Definition at line 1046 of file used_before_set.c.

1047 {
1048  list l_in_regions = NIL;
1049  ubs module_ubs;
1050  string user_file = db_get_memory_resource(DBR_USER_FILE,module_name,true);
1051  string base_name = pips_basename(user_file, NULL);
1052  /* File instrument.out is used to store ubs checks*/
1053  string dir_name = db_get_current_workspace_directory();
1054  string instrument_file = strdup(concatenate(dir_name, "/instrument.out", NULL));
1055  out = safe_fopen(instrument_file, "a");
1057  "/",base_name,NULL));
1059  if (!same_string_p(rule_phase(find_rule_by_resource("REGIONS")),"MUST_REGIONS"))
1060  pips_user_warning("\nMUST REGIONS not selected - " "Do not expect wonderful results\n");
1061  /* Set and get the current properties concerning regions */
1062  set_bool_property("MUST_REGIONS", true);
1063  set_bool_property("EXACT_REGIONS", true);
1067  /* Get the code of the module */
1070  /* Get IN regions of the module */
1072  regions_init();
1074  debug_on("USED_BEFORE_SET_DEBUG_LEVEL");
1076  ifdebug(2)
1077  {
1078  pips_debug(2,"List of IN regions of module %s:",module_name);
1079  print_inout_regions(l_in_regions);
1080  }
1081  fprintf(out,"%s\t%s\t%s\t(0,1)\n",PREFIX1,file_name,module_name);
1082  fprintf(out," EXTERNAL ir_isnan,id_isnan\n");
1083  fprintf(out," LOGICAL*4 ir_isnan,id_isnan\n");
1084  fprintf(out,"%s\n",PREFIX2);
1086  {
1087  /* File xxx.database/Src/initialization.f contains all the initializations of
1088  global variables */
1089  initialization_file = strdup(concatenate(dir_name, "/Src/initialization.f", NULL));
1091  MAP(REGION,reg,
1092  {
1093  entity ent = region_entity(reg);
1094  if (strcmp(entity_module_name(ent),IO_EFFECTS_PACKAGE_NAME)!=0)
1095  {
1096  if (variable_in_common_p(ent))
1097  /* Common variable in main program */
1099  else
1100  {
1101  /* Local variable in main program, but attention,
1102  IN regions contain also static variables of other modules !!!*/
1105  }
1106  }
1107  },l_in_regions);
1110  }
1111  else
1112  {
1113  callees callers = (callees) db_get_memory_resource(DBR_CALLERS,module_name,true);
1114  list l_callers = callees_callees(callers);
1115  MAP(REGION,reg,
1116  {
1117  entity ent = region_entity(reg);
1118  if (strcmp(entity_module_name(ent),IO_EFFECTS_PACKAGE_NAME)!=0)
1119  {
1121  /* Formal or common variable */
1122  verify_formal_and_common_variables(ent,l_callers);
1123  else
1124  {
1125  /* Local variable */
1128  }
1129  }
1130  },l_in_regions);
1131  }
1132  module_ubs = make_ubs(l_ubs_checks);
1133  // message_assert("module ubs is consistent",ubs_consistent_p(module_ubs));
1134  /* save to resource */
1135  DB_PUT_MEMORY_RESOURCE(DBR_UBS,module_name,copy_ubs(module_ubs));
1137  debug_off();
1138  safe_fclose(out,instrument_file);
1139  free(instrument_file), instrument_file = NULL;
1140  free(dir_name), dir_name = NULL;
1143  regions_end();
1144  reset_in_effects();
1147  return true;
1148 }
ubs copy_ubs(ubs p)
UBS.
Definition: ubs_private.c:58
ubs make_ubs(list a)
Definition: ubs_private.c:94
struct _newgen_struct_statement_ * statement
Definition: cloning.h:21
#define region_entity(reg)
#define REGION
void regions_end(void)
void regions_init(void)
void get_regions_properties(void)
void print_inout_regions(list)
void set_in_effects(statement_effects)
void reset_in_effects(void)
list load_statement_in_regions(statement)
const char * module_name(const char *s)
Return the module part of an entity name.
Definition: entity_names.c:296
FILE * safe_fopen(const char *filename, const char *what)
Definition: file.c:67
int safe_fclose(FILE *stream, const char *filename)
Definition: file.c:77
char * pips_basename(char *fullpath, char *suffix)
Definition: file.c:822
static FILE * user_file
These functions implements the writing of objects.
Definition: genClib.c:1485
void free(void *)
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
void reset_current_module_statement(void)
Reset the current module statement.
Definition: static.c:221
statement set_current_module_statement(statement)
Set the current module statement.
Definition: static.c:165
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
string db_get_memory_resource(const char *rname, const char *oname, bool pure)
Return the pointer to the resource, whatever it is.
Definition: database.c:755
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
string db_get_directory_name_for_module(const char *name)
returns the allocated and mkdir'ed directory for module name
Definition: lowlevel.c:150
#define rule_phase(x)
Definition: makefile.h:244
#define debug_on(env)
Definition: misc-local.h:157
#define pips_user_warning
Definition: misc-local.h:146
#define debug_off()
Definition: misc-local.h:160
#define same_string_p(s1, s2)
hash_table set_ordering_to_statement(statement s)
To be used instead of initialize_ordering_to_statement() to make sure that the hash table ots is in s...
Definition: ordering.c:172
void reset_ordering_to_statement(void)
Reset the mapping from ordering to statement.
Definition: ordering.c:185
#define WORKSPACE_SRC_SPACE
Definition: pipsdbm-local.h:32
string db_get_current_workspace_directory(void)
Definition: workspace.c:96
rule find_rule_by_resource(const char *rname)
This function returns the active rule to produce resource rname.
Definition: pipsmake.c:694
void set_bool_property(const char *, bool)
#define IO_EFFECTS_PACKAGE_NAME
Implicit variables to handle IO effetcs.
bool entity_main_module_p(entity e)
Definition: entity.c:700
bool variable_in_common_p(entity)
true if v is in a common.
Definition: variable.c:1570
bool formal_parameter_p(entity)
Definition: variable.c:1489
struct _newgen_struct_callees_ * callees
Definition: ri.h:55
#define callees_callees(x)
Definition: ri.h:675
static list l_ubs_checks
static void display_used_before_set_statistics()
static void verify_formal_and_common_variables(entity ent, list l_callers)
static statement module_statement
static void initialize_and_verify_local_variable(entity ent, region reg)
static void initialize_and_verify_common_variable(entity ent, region reg)

References callees_callees, concatenate(), copy_ubs(), current_mod, db_get_current_workspace_directory(), db_get_directory_name_for_module(), db_get_memory_resource(), DB_PUT_MEMORY_RESOURCE, debug_off, debug_on, display_used_before_set_statistics(), entity_main_module_p(), entity_module_name(), entity_undefined, file_name, find_rule_by_resource(), formal_parameter_p(), fprintf(), free(), get_regions_properties(), ifdebug, initialization_file, initialize_and_verify_common_variable(), initialize_and_verify_local_variable(), IO_EFFECTS_PACKAGE_NAME, l_ubs_checks, load_statement_in_regions(), local_name_to_top_level_entity(), make_ubs(), MAP, module_name(), module_statement, NIL, number_of_processed_modules, out, out2, pips_basename(), pips_debug, pips_user_warning, PREFIX1, PREFIX2, print_inout_regions(), REGION, region_entity, regions_end(), regions_init(), reset_current_module_entity(), reset_current_module_statement(), reset_in_effects(), reset_ordering_to_statement(), rule_phase, safe_fclose(), safe_fopen(), same_string_p, set_bool_property(), set_current_module_entity(), set_current_module_statement(), set_in_effects(), set_ordering_to_statement(), strdup(), user_file, variable_in_common_p(), verify_formal_and_common_variables(), and WORKSPACE_SRC_SPACE.

+ Here is the call graph for this function:

◆ verify_array_element()

static void verify_array_element ( entity  ent,
expression  exp 
)
static

o help debugging, reinitialize the integer and real array elements by 0 in order to avoid so much propagated NaN or 1000000 values. By doing this, we cannot detect all uninitialized variables but it helps Corinne, with thousand lines of code

nsert the assignment after the PRINT statement

Definition at line 429 of file used_before_set.c.

430 {
432  test t = test_undefined;
434  string stop_message = strdup(concatenate("\'Array ",entity_name(ent)," is used before set\'",NULL));
435  string print_message = strdup(concatenate("\'Array element ",entity_name(ent),"(\'",
436  print_list_of_expressions(args),",\') is used before set\'",NULL));
437  expression cond = make_test_condition(exp,ent);
438  basic b = entity_basic(ent);
439  ifdebug(3)
440  {
441  pips_debug(3,"Verify array element:");
443  }
444  if (get_bool_property("PROGRAM_VERIFICATION_WITH_PRINT_MESSAGE"))
445  {
446  smt = make_print_statement(print_message);
447  /*To help debugging, reinitialize the integer and real array elements by 0 in order to
448  avoid so much propagated NaN or 1000000 values. By doing this, we cannot
449  detect all uninitialized variables but it helps Corinne, with thousand lines of code */
450  if ((basic_tag(b)==0) || (basic_tag(b)==1))
451  {
453  /*insert the assignment after the PRINT statement*/
454  insert_statement(smt,s,false);
455  }
456  }
457  else
458  smt = make_stop_statement(stop_message);
459  t = make_test(cond,smt,make_block_statement(NIL));
460  smt = test_to_statement(t);
461  ifdebug(3)
462  {
463  fprintf(stderr,"\nGenerated statement:");
464  print_statement(smt);
465  }
466  print_statement(smt);
467  free(print_message), print_message = NULL;
468  free(stop_message), stop_message = NULL;
469 }
test make_test(expression a1, statement a2, statement a3)
Definition: ri.c:2607
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
statement make_block_statement(list)
Make a block statement from a list of statement.
Definition: statement.c:616
statement make_print_statement(string)
Make a Fortran print statement.
Definition: statement.c:835
statement make_stop_statement(string)
This function returns a Fortran stop statement with an error message.
Definition: statement.c:908
void insert_statement(statement, statement, bool)
This is the normal entry point.
Definition: statement.c:2570
void print_expression(expression e)
no file descriptor is passed to make is easier to use in a debugging stage.
Definition: expression.c:58
void print_statement(statement)
Print a statement on stderr.
Definition: statement.c:98
#define test_to_statement(t)
reference expression_reference(expression e)
Short cut, meaningful only if expression_reference_p(e) holds.
Definition: expression.c:1832
#define test_undefined
Definition: ri.h:2808
#define reference_indices(x)
Definition: ri.h:2328
#define statement_undefined
Definition: ri.h:2419
static expression make_test_condition(expression exp, entity ent)
This function makes a test like X.EQ.100000 or id_nan(A(PHI1)) or ir_nan(A(I,B(J))
static string print_list_of_expressions(list l)

References basic_tag, concatenate(), entity_basic(), entity_name, exp, expression_reference(), fprintf(), free(), get_bool_property(), ifdebug, insert_statement(), int_to_expression(), make_assign_statement(), make_block_statement(), make_print_statement(), make_stop_statement(), make_test(), make_test_condition(), NIL, pips_debug, print_expression(), print_list_of_expressions(), print_statement(), reference_indices, statement_undefined, strdup(), test_to_statement, and test_undefined.

Referenced by verify_used_before_set_expression().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_array_variable()

static void verify_array_variable ( entity  ent,
region  reg 
)
static

This function generates code that verifies if all array elements in the array region are initialized or not.

We use the algorithm_row_echelon(initial system, list of variables to scan, return condition, returned enumeration system) to generate the nested loop.
The generated code will be like this: IF (condition) THEN DO PHI1 = low1,up1 DO PHI2 = low2,up2 IF (A(PHI1,PHI2).EQ.SNan) STOP "A is used before set" ENDDO ENDDO ENDIF

o help debugging, reinitialize the integer and real array elements by 0 in order to avoid so much propagated NaN or 1000000 values. By doing this, we cannot detect all uninitialized variables but it helps Corinne, with thousand lines of code

nsert the assignment after the PRINT statement

o simplify the test condition, we have to remove preconditions from regions

If no bound is found for a variable PHIi => it is not the case because the region is MUST => TO PROVE

Definition at line 484 of file used_before_set.c.

485 {
488  test t = test_undefined;
490  int n = gen_length(dims);
491  list l_phi = phi_entities_list(1,n);
494  Pbase phi_variables = entity_list_to_base(l_phi);
495  Psysteme ps = region_system(reg);
496  Psysteme row_echelon = SC_UNDEFINED, condition = SC_UNDEFINED;
497  string stop_message = strdup(concatenate("\'Array ",entity_name(ent)," is used before set\'",NULL));
498  string print_message = strdup(concatenate("\'Array element ",entity_name(ent),"(\'",
499  print_list_of_entities(l_phi),",\') is used before set\'",NULL));
500  expression cond = make_test_condition(exp,ent);
501  basic b = entity_basic(ent);
502  ifdebug(3)
503  {
504  pips_debug(3,"Verify array region:");
505  print_region(reg);
506  }
507  if (get_bool_property("PROGRAM_VERIFICATION_WITH_PRINT_MESSAGE"))
508  {
509  smt = make_print_statement(print_message);
510  /*To help debugging, reinitialize the integer and real array elements by 0 in order to
511  avoid so much propagated NaN or 1000000 values. By doing this, we cannot
512  detect all uninitialized variables but it helps Corinne, with thousand lines of code */
513  if ((basic_tag(b)==0) || (basic_tag(b)==1))
514  {
516  /*insert the assignment after the PRINT statement*/
517  insert_statement(smt,s,false);
518  }
519  }
520  else
521  smt = make_stop_statement(stop_message);
522  t = make_test(cond,smt,make_block_statement(NIL));
523  smt = test_to_statement(t);
524  ps = remove_temporal_variables_from_system(ps); // remove I#init like variables
525 
526  /*to simplify the test condition, we have to remove preconditions from regions*/
527 
528  algorithm_row_echelon(ps,phi_variables, &condition, &row_echelon);
529  sc_find_equalities(&condition);
530  /* If no bound is found for a variable PHIi => it is not the case because the
531  region is MUST => TO PROVE*/
532  l = systeme_to_loop_nest(row_echelon,l_phi,smt,entity_intrinsic(DIVIDE_OPERATOR_NAME));
533  smt = generate_optional_if(condition,l);
534  ifdebug(3)
535  {
536  fprintf(stderr,"\nGenerated statement:");
537  print_statement(smt);
538  }
539  print_statement(smt);
540  free(print_message), print_message = NULL;
541  free(stop_message), stop_message = NULL;
542 }
statement generate_optional_if(Psysteme, statement)
statement generate_optional_if(sc, stat)
#define region_system(reg)
#define print_region(x)
Definition: print.c:343
Pbase entity_list_to_base(list l)
Definition: entity.c:2860
void algorithm_row_echelon(Psysteme scn, Pbase base_index, Psysteme *pcondition, Psysteme *penumeration)
see comments above.
void sc_find_equalities(Psysteme *ps)
static Psysteme remove_temporal_variables_from_system(Psysteme ps)
static string print_list_of_entities(list l)

References algorithm_row_echelon(), basic_tag, concatenate(), DIVIDE_OPERATOR_NAME, entities_to_expressions2(), entity_basic(), entity_intrinsic(), entity_list_to_base(), entity_name, entity_type, exp, fprintf(), free(), gen_length(), generate_optional_if(), get_bool_property(), ifdebug, insert_statement(), int_to_expression(), make_assign_statement(), make_block_statement(), make_print_statement(), make_reference(), make_stop_statement(), make_test(), make_test_condition(), NIL, phi_entities_list(), pips_debug, print_list_of_entities(), print_region, print_statement(), ref, reference_to_expression(), region_system, remove_temporal_variables_from_system(), sc_find_equalities(), statement_undefined, strdup(), systeme_to_loop_nest(), test_to_statement, test_undefined, type_variable, and variable_dimensions.

Referenced by verify_used_before_set_statement_flt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_formal_and_common_variables()

static void verify_formal_and_common_variables ( entity  ent,
list  l_callers 
)
static

Definition at line 758 of file used_before_set.c.

759 {
760  bool check = false;
762  {
763  list l_caller_ubs = ubs_list((ubs)db_get_memory_resource(DBR_UBS,caller_name,true));
764  MAP(UBS_CHECK,fp,
765  {
766  entity mod = ubs_check_module(fp);
767  if (same_entity_p(mod,current_mod))
768  {
769  entity e = ubs_check_variable(fp);
770  int off;
771  if (integer_constant_p(e,&off))
772  {
773  if (formal_parameter_p(ent))
774  {
776  if (off == offset)
777  {
778  pips_debug(1,"Formal parameter %s must be verified\n",entity_name(ent));
779  check = true;
780  break;
781  }
782  }
783  }
784  else
785  {
786  if (entities_may_conflict_p(e,ent))
787  {
788  pips_debug(1,"Common variable %s must be verified\n",entity_name(ent));
789  check = true;
790  break;
791  }
792  }
793  }
794  },l_caller_ubs);
795  if (check) break;
796  },l_callers);
797  if (check)
798  {
799  current_entity = ent;
802  }
803 }
static const char * caller_name
Definition: alias_check.c:122
bool integer_constant_p(entity ent, int *int_p)
Returns the double value associated to a PIPS constant.
Definition: constant.c:542
static Value offset
Definition: translation.c:283
#define STRING(x)
Definition: genC.h:87
bool same_entity_p(entity e1, entity e2)
predicates on entities
Definition: entity.c:1321
#define formal_offset(x)
Definition: ri.h:1408
#define storage_formal(x)
Definition: ri.h:2524
#define ubs_list(x)
Definition: ubs_private.h:99
#define UBS_CHECK(x)
newgen_ubs_domain_defined
Definition: ubs_private.h:35
#define ubs_check_module(x)
Definition: ubs_private.h:65
#define ubs_check_variable(x)
Definition: ubs_private.h:67

References caller_name, current_entity, current_mod, db_get_memory_resource(), entities_may_conflict_p(), entity_name, entity_storage, entity_undefined, formal_offset, formal_parameter_p(), integer_constant_p(), MAP, offset, pips_debug, same_entity_p(), storage_formal, STRING, UBS_CHECK, ubs_check_module, ubs_check_variable, ubs_list, and verify_used_before_set_statement().

Referenced by used_before_set().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_scalar_variable()

static void verify_scalar_variable ( entity  ent)
static

o help debugging, reinitialize the integer and real variables by 0 in order to avoid so much propagated NaN or 1000000 values. By doing this, we cannot detect all uninitialized variables but it helps Corinne, with thousand lines of code

nsert the assignment after the PRINT statement

Definition at line 401 of file used_before_set.c.

402 {
403  string message = strdup(concatenate("\'Scalar variable ",entity_name(ent)," is used before set\'",NULL));
405  test t = test_undefined;
407  basic b = entity_basic(ent);
408  if (get_bool_property("PROGRAM_VERIFICATION_WITH_PRINT_MESSAGE"))
409  {
411  /*To help debugging, reinitialize the integer and real variables by 0 in order to
412  avoid so much propagated NaN or 1000000 values. By doing this, we cannot
413  detect all uninitialized variables but it helps Corinne, with thousand lines of code */
414  if ((basic_tag(b)==0) || (basic_tag(b)==1))
415  {
417  /*insert the assignment after the PRINT statement*/
418  insert_statement(smt,s,false);
419  }
420  }
421  else
423  t = make_test(cond,smt,make_block_statement(NIL));
424  smt = test_to_statement(t);
425  print_statement(smt);
426  free(message), message = NULL;
427 }

References basic_tag, concatenate(), entity_basic(), entity_name, entity_to_expression(), free(), get_bool_property(), insert_statement(), int_to_expression(), make_assign_statement(), make_block_statement(), make_print_statement(), make_stop_statement(), make_test(), make_test_condition(), NIL, print_statement(), statement_undefined, strdup(), test_to_statement, and test_undefined.

Referenced by verify_used_before_set_expression(), and verify_used_before_set_statement_flt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_used_before_set_call()

static void verify_used_before_set_call ( call  c,
statement  s 
)
static

If c is a procedure call, we have to update UBS resource in order to check for the corresponding variables in the frame of the called procedure. There are two possibilities:

  • if the current entity is passed as actual arguments insert (called procedure,offset of actual argument)
  • the current entity is a common variable and it has IN regions in the called procedure => insert (called procedure,common variable)

always add (called procedure,common variable) to ubs resource, although current_entity may not in the IN regions of the called procedure

The current statement is not a call to another routine, so an assignment, or a READ, a WRITE, ... We have go though the argument list and generate a verification for each read (= IN region) of the current entity. This is really a redundant work with region's computation :-( So may be it is better to keep the list of regions, not a convex hull.

Examples : A = C(J) + FOO(C(I)), X(A(I)) = A(J) + A(K) READ *, A(B(I)), A(B(J))

SO FOR THE MOMENT, I ONLY TREAT SOME FREQUENT CASES: assignment, WRITE

Definition at line 547 of file used_before_set.c.

548 {
549  entity fun = call_function(c);
550  list l_args = call_arguments(c);
551  if (entity_module_p(fun))
552  {
553  /* If c is a procedure call, we have to update UBS resource in order to check
554  for the corresponding variables in the frame of the called procedure.
555  There are two possibilities:
556  - if the current entity is passed as actual arguments
557  insert (called procedure,offset of actual argument)
558  - the current entity is a common variable and it has IN regions in the called
559  procedure => insert (called procedure,common variable)*/
560  int i = 0;
561  ifdebug(3)
562  fprintf(stderr,"\nCall to other module\n");
564  {
565  /* always add (called procedure,common variable) to ubs resource,
566  although current_entity may not in the IN regions of the called procedure */
569  }
570  ifdebug(3)
571  {
572  fprintf(stderr,"\nCall to %s with argument list:",entity_local_name(fun));
573  print_expressions(l_args);
574  }
576  {
578  i++;
579  MAP(REFERENCE,ref,
580  {
582  if (same_entity_p(var,current_entity))
583  {
585  ifdebug(4)
586  {
587  fprintf(stderr,"\nFound at %d-th argument:",i);
589  fprintf(stderr,"\nAdd ubs (%s,%d)\n",entity_local_name(fun),i);
590  }
592  break;
593  }
594  },l_refs);
595  },l_args);
596  }
597  else
598  {
599  /* The current statement is not a call to another routine, so an assignment,
600  or a READ, a WRITE, ...
601  We have go though the argument list and generate a verification for each
602  read (= IN region) of the current entity. This is really a redundant work
603  with region's computation :-(
604  So may be it is better to keep the list of regions, not a convex hull.
605 
606  Examples : A = C(J) + FOO(C(I)), X(A(I)) = A(J) + A(K)
607  READ *, A(B(I)), A(B(J))
608 
609  SO FOR THE MOMENT, I ONLY TREAT SOME FREQUENT CASES: assignment, WRITE*/
610  ifdebug(3)
611  fprintf(stderr,"\nMAY IN region of elementary statement\n");
613  {
615  },l_args);
616  }
617 }
ubs_check make_ubs_check(entity a1, entity a2)
Definition: ubs_private.c:52
#define region
simulation of the type region
void print_expressions(list le)
Definition: expression.c:98
bool entity_module_p(entity e)
Definition: entity.c:683
list expression_to_reference_list(expression e, list lr)
conversion of an expression into a list of references; references are appended to list lr as they are...
Definition: expression.c:1263
entity make_integer_constant_entity(_int)
entity make_integer_constant_entity(int c) make entity for integer constant c
Definition: variable.c:1345
#define REFERENCE(x)
REFERENCE.
Definition: ri.h:2296
#define call_function(x)
Definition: ri.h:709
#define reference_variable(x)
Definition: ri.h:2326
#define call_arguments(x)
Definition: ri.h:711
static void verify_used_before_set_expression(expression exp, statement s)

References call_arguments, call_function, CONS, current_entity, entity_local_name(), entity_module_p(), exp, EXPRESSION, expression_to_reference_list(), fprintf(), gen_nconc(), ifdebug, l_ubs_checks, make_integer_constant_entity(), make_ubs_check(), MAP, NIL, print_expression(), print_expressions(), ref, REFERENCE, reference_variable, same_entity_p(), UBS_CHECK, variable_in_common_p(), and verify_used_before_set_expression().

Referenced by verify_used_before_set_expression(), and verify_used_before_set_statement_flt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_used_before_set_expression()

static void verify_used_before_set_expression ( expression  exp,
statement  s 
)
static

xists ? MAY IN for a MUST IN?

Definition at line 619 of file used_before_set.c.

620 {
622  tag t = syntax_tag(syn);
623  ifdebug(4)
624  {
625  fprintf(stderr,"\nVerify expression\n");
627  }
628  switch (t){
629  case is_syntax_range:
630  break;
631  case is_syntax_reference:
632  {
635  if (same_entity_p(var,current_entity))
636  {
637  int order = statement_ordering(s);
638  ifdebug(3)
639  fprintf(stderr,"\nInsert a VERIFY function before a reference\n");
641  fprintf(out,"%s\t%s\t%s\t(%d,%d)\n",PREFIX1,file_name,module_local_name(current_mod),
642  ORDERING_NUMBER(order),ORDERING_STATEMENT(order));
643  if (entity_scalar_p(var)) /*exists ? MAY IN for a MUST IN?*/
645  else
647  fprintf(out,"%s\n",PREFIX2);
648  }
649  break;
650  }
651  case is_syntax_call:
652  {
653  call c = syntax_call(syn);
655  break;
656  }
657  default:
658  {
659  pips_internal_error("Unexpected expression tag %d ", t );
660  break;
661  }
662  }
663 }
int tag
TAG.
Definition: newgen_types.h:92
#define ORDERING_NUMBER(o)
#define ORDERING_STATEMENT(o)
#define syntax_reference(x)
Definition: ri.h:2730
#define syntax_tag(x)
Definition: ri.h:2727
#define statement_ordering(x)
Definition: ri.h:2454
@ is_syntax_range
Definition: ri.h:2692
@ is_syntax_call
Definition: ri.h:2693
@ is_syntax_reference
Definition: ri.h:2691
#define syntax_call(x)
Definition: ri.h:2736
#define expression_syntax(x)
Definition: ri.h:1247
else
Definition: set.c:239
static void verify_array_element(entity ent, expression exp)
static void verify_used_before_set_call(call c, statement s)
static void verify_scalar_variable(entity ent)

References current_entity, current_mod, entity_scalar_p(), exp, expression_syntax, file_name, fprintf(), ifdebug, is_syntax_call, is_syntax_range, is_syntax_reference, module_local_name(), number_of_added_verifications, ORDERING_NUMBER, ORDERING_STATEMENT, out, pips_internal_error, PREFIX1, PREFIX2, print_expression(), ref, reference_variable, same_entity_p(), statement_ordering, syntax_call, syntax_reference, syntax_tag, verify_array_element(), verify_scalar_variable(), and verify_used_before_set_call().

Referenced by verify_used_before_set_call(), and verify_used_before_set_statement_flt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_used_before_set_statement()

static void verify_used_before_set_statement ( )
static

Definition at line 750 of file used_before_set.c.

751 {
755  gen_null);
756 }
#define gen_recurse(start, domain_number, flt, rwt)
Definition: genC.h:283
void gen_null(__attribute__((unused)) void *unused)
Ignore the argument.
Definition: genClib.c:2752
#define statement_domain
newgen_sizeofexpression_domain_defined
Definition: ri.h:362
static bool verify_used_before_set_statement_flt(statement s)

References gen_null(), gen_recurse, module_statement, statement_domain, and verify_used_before_set_statement_flt().

Referenced by initialize_and_verify_common_variable(), initialize_and_verify_local_variable(), and verify_formal_and_common_variables().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ verify_used_before_set_statement_flt()

static bool verify_used_before_set_statement_flt ( statement  s)
static

there are IN regions like IN-EXACT-{0==-1} !!!

MUST IN region and variable belonging to current module scope (local, formal and visible global variable)

MAY IN region or common variable not in current module scope If the current statement is elementary, we have to treat it, else, we continue to go down with gen_recurse

Definition at line 665 of file used_before_set.c.

666 {
667  list l_in_regions = load_statement_in_regions(s);
668  ifdebug(3)
669  {
670  pips_debug(3,"Verify the current statement:");
671  print_statement(s);
672  fprintf(stderr,"with list of IN regions:");
673  print_inout_regions(l_in_regions);
674  }
675  MAP(REGION,reg,
676  {
677  /* there are IN regions like IN-EXACT-{0==-1} !!!*/
678  if (!region_empty_p(reg))
679  {
680  entity ent = region_entity(reg);
681  if (same_entity_p(ent,current_entity))
682  {
684  ifdebug(3)
685  fprintf(stderr,"\nFound variable %s in the IN region list\n",entity_name(ent));
686  if (approximation_exact_p(app) &&
690  {
691  /* MUST IN region and variable belonging to current module scope
692  (local, formal and visible global variable)*/
693  int order = statement_ordering(s);
694  ifdebug(3)
695  fprintf(stderr,"\nMUST IN region, variable in module scope\n");
697  fprintf(out,"%s\t%s\t%s\t(%d,%d)\n",PREFIX1,file_name,module_local_name(current_mod),
698  ORDERING_NUMBER(order),ORDERING_STATEMENT(order));
699  if (entity_scalar_p(ent))
701  else
702  verify_array_variable(ent,reg);
703  fprintf(out,"%s\n",PREFIX2);
704  return false;
705  }
706  else
707  {
708  /* MAY IN region or common variable not in current module scope
709  If the current statement is elementary, we have to treat it,
710  else, we continue to go down with gen_recurse */
712  tag t = instruction_tag(i);
713  ifdebug(3)
714  fprintf(stderr,"\nMAY IN region or common variable not in current module scope\n");
715  switch(t)
716  {
717  case is_instruction_call:
718  {
719  call c = statement_call(s);
721  return false;
722  }
724  {
728  break;
729  }
730  case is_instruction_test:
731  {
732  test it = instruction_test(i);
733  expression e = test_condition(it);
735  break;
736  }
738  case is_instruction_loop:
739  // suppose that there are only MUST IN region in loop's range
741  return true;
742  }
743  }
744  }
745  }
746  },l_in_regions);
747  return false;
748 }
#define region_empty_p(reg)
call statement_call(statement)
Get the call of a statement.
Definition: statement.c:1406
#define false
Definition: newgen_types.h:80
@ is_instruction_unstructured
Definition: ri.h:1475
@ is_instruction_whileloop
Definition: ri.h:1472
@ is_instruction_test
Definition: ri.h:1470
@ is_instruction_call
Definition: ri.h:1474
@ is_instruction_sequence
Definition: ri.h:1469
@ is_instruction_loop
Definition: ri.h:1471
#define instruction_tag(x)
Definition: ri.h:1511
#define test_condition(x)
Definition: ri.h:2833
#define instruction_whileloop(x)
Definition: ri.h:1523
#define statement_instruction(x)
Definition: ri.h:2458
#define instruction_test(x)
Definition: ri.h:1517
#define whileloop_condition(x)
Definition: ri.h:3160
return(s1)
static size_t current
Definition: string.c:115
static void verify_array_variable(entity ent, region reg)
This function generates code that verifies if all array elements in the array region are initialized ...

References approximation_exact_p, common_variable_in_module_scope_p(), current_entity, current_mod, entity_name, entity_scalar_p(), file_name, fprintf(), ifdebug, instruction_tag, instruction_test, instruction_whileloop, is_instruction_call, is_instruction_loop, is_instruction_sequence, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, load_statement_in_regions(), MAP, module_local_name(), number_of_added_verifications, ORDERING_NUMBER, ORDERING_STATEMENT, out, pips_debug, PREFIX1, PREFIX2, print_inout_regions(), print_statement(), REGION, region_approximation, region_empty_p, region_entity, same_entity_p(), statement_call(), statement_instruction, statement_ordering, test_condition, variable_in_common_p(), verify_array_variable(), verify_scalar_variable(), verify_used_before_set_call(), verify_used_before_set_expression(), and whileloop_condition.

Referenced by verify_used_before_set_statement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ words_common_variable()

static list words_common_variable ( entity  e)
static

Definition at line 839 of file used_before_set.c.

840 {
841  list pl = NIL;
844  {
846  {
848  pl = CHAIN_SWORD(pl, "(");
849  MAPL(pd,
850  {
852  if (CDR(pd) != NIL) pl = CHAIN_SWORD(pl, ",");
853  }, dims);
854  pl = CHAIN_SWORD(pl, ")");
855  }
856  }
857  return(pl);
858 }
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define MAPL(_map_list_cp, _code, _l)
Apply some code on the addresses of all the elements of a list.
Definition: newgen_list.h:203
static hash_table pl
properties are stored in this hash table (string -> property) for fast accesses.
Definition: properties.c:783
#define type_variable_p(x)
Definition: ri.h:2947
#define CHAIN_SWORD(l, s)
static list words_numerical_dimension(dimension obj)
This function prints a common variable with its numerical size, because we do not want to generate th...

References CAR, CDR, CHAIN_SWORD, DIMENSION, entity_local_name(), entity_type, gen_nconc(), MAPL, NIL, pl, type_variable, type_variable_p, variable_dimensions, and words_numerical_dimension().

Referenced by insert_common_declaration().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ words_numerical_dimension()

static list words_numerical_dimension ( dimension  obj)
static

This function prints a common variable with its numerical size, because we do not want to generate the PARAMETER declarations PARAMETER (NX=50) COMMON W(5*NX) => COMMON W(250)

Definition at line 811 of file used_before_set.c.

812 {
813  list pc = NIL;
814  expression low_exp = dimension_lower(obj);
815  expression up_exp = dimension_upper(obj);
816  normalized n_low = NORMALIZE_EXPRESSION(low_exp);
817  normalized n_up = NORMALIZE_EXPRESSION(up_exp);
818  int low,up;
819  if (EvalNormalized(n_low,&low))
820  {
821  if (low!=1)
822  {
823  pc = CHAIN_SWORD(pc,int2a(low));
824  pc = CHAIN_SWORD(pc,":");
825  }
826  }
827  else
828  {
829  pc = Words_Expression(low_exp);
830  pc = CHAIN_SWORD(pc,":");
831  }
832  if (EvalNormalized(n_up,&up))
833  pc = CHAIN_SWORD(pc,int2a(up));
834  else
835  pc = gen_nconc(pc, Words_Expression(up_exp));
836  return(pc);
837 }
bool EvalNormalized(normalized n, int *pv)
Definition: normalize.c:404
list Words_Expression(expression obj)
of string
Definition: misc.c:2616
#define NORMALIZE_EXPRESSION(e)
#define dimension_lower(x)
Definition: ri.h:980
#define dimension_upper(x)
Definition: ri.h:982
char * int2a(int)
util.c
Definition: util.c:42

References CHAIN_SWORD, dimension_lower, dimension_upper, EvalNormalized(), gen_nconc(), int2a(), NIL, NORMALIZE_EXPRESSION, and Words_Expression().

Referenced by words_common_variable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ current_entity

◆ current_mod

◆ file_name

string file_name
static

Definition at line 163 of file used_before_set.c.

Referenced by actual_c_parser(), add_new_compilation_unit(), add_new_module_from_text(), ask_emacs_to_display_a_graph(), check_c_file_syntax(), check_fortran_syntax_before_pips(), check_input_file_syntax(), close_resource_file(), compile_a_pure_function(), compile_a_special_io_function(), csplit(), csplit_close_files(), dbll_stat_file(), dbll_stat_local_file(), dbll_stat_resource_file(), edit_notify(), f95split(), find_file_in_directories(), full_graph_of_calls(), generate_a_directory_menu(), generate_hpf_remapping_file(), get_new_tmp_file_name(), get_resource_file_name(), get_view_file(), gpips_display_graph_file_display(), gpips_display_plain_file(), gpips_file_view(), graph_of_calls(), handle_file_name(), handle_include_file(), hpfc_filter(), hpfc_generate_path_name_of_file_name(), hpfc_print_file(), initialize_and_verify_common_variable(), initialize_and_verify_local_variable(), initialize_tpips_history(), insert_check_alias_before_statement(), insert_flag_before_call_site(), insert_test_before_caller(), insert_test_before_statement(), load_meta_data(), notify_hpfc_file_view(), open_resource_file(), parse_instrumented_file(), pips_process_file(), print_code_with_comp_regions(), print_continuation_conditions(), process_user_file(), read_from_eole(), safe_unlink(), save_meta_data(), set_c_parser_current_input_file_name(), set_c_parser_current_user_input_file_name(), tpips_close(), used_before_set(), verify_used_before_set_expression(), verify_used_before_set_statement_flt(), wpips_display_graph_file_display(), wpips_display_plain_file(), wpips_display_WP65_file(), wpips_file_view(), write_an_attachment_file(), and write_to_eole().

◆ initialization_file

string initialization_file
static

Definition at line 164 of file used_before_set.c.

Referenced by initialize_and_verify_common_variable(), and used_before_set().

◆ l_initialized_commons

list l_initialized_commons = NIL
static

Definition at line 166 of file used_before_set.c.

Referenced by initialize_and_verify_common_variable().

◆ l_ubs_checks

list l_ubs_checks = NIL
static

Definition at line 165 of file used_before_set.c.

Referenced by used_before_set(), and verify_used_before_set_call().

◆ module_statement

statement module_statement = statement_undefined
static

Definition at line 155 of file used_before_set.c.

Referenced by used_before_set(), and verify_used_before_set_statement().

◆ number_of_added_verifications

int number_of_added_verifications = 0
static

◆ number_of_may_uninitialized_array_variables

int number_of_may_uninitialized_array_variables = 0
static

Definition at line 157 of file used_before_set.c.

Referenced by display_used_before_set_statistics(), and insert_initialization().

◆ number_of_may_uninitialized_scalar_variables

int number_of_may_uninitialized_scalar_variables = 0
static

Definition at line 156 of file used_before_set.c.

Referenced by display_used_before_set_statistics(), and insert_initialization().

◆ number_of_processed_modules

int number_of_processed_modules = 0
static

Definition at line 162 of file used_before_set.c.

Referenced by display_used_before_set_statistics(), and used_before_set().

◆ number_of_uninitialized_array_variables

int number_of_uninitialized_array_variables = 0
static

◆ number_of_uninitialized_scalar_variables

int number_of_uninitialized_scalar_variables = 0
static

◆ out

◆ out2