/* GCT Definitions File */ /* DO NOT EDIT THIS FILE - it is generated by a program. */ /* * Permission is granted to use this file for any purpose whatsoever. * There are no restrictions on distribution, use, or modification. In * particular, inclusion of this file in any instrumented program is * freely permitted, and you may distribute that program to third parties * under any terms. * * This file is distributed WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. */ #include "gct-ps-defs.h" #include "gct-defs.h" /* * The RS/6000 AIX C compiler has a bug causing it to mis-compile loop * tests in some cases. Under #ifdef GCT_AIX_BUG, instrumentation is an * increment of the counter variable and a call to this function. This * function is not in ifdefs to avoid dragging config.h into this file. * It's in this routine because it has to go somewhere where it'll be * compiled into the executable as an extern function. */ long gct_aix_bug_looptest(counter_ptr, test_value, table, first_index) int *counter_ptr; /* Number of times through loop */ int test_value; /* Loop test value this time around. */ GCT_CONDITION_TYPE table[]; /* Table loop is recorded in */ int first_index; /* First loop value in table. */ { /* This code is a slavish transcription of that in add_loop_test */ #define not_taken (first_index) #define at_least_once (first_index+1) #define exactly_once (first_index+2) #define at_least_twice (first_index+3) #define test1 (*counter_ptr == 1 && !test_value) #define action1 (table[not_taken]++) #define test2 (*counter_ptr == 1 && test_value) #define action2 (table[at_least_once]=1) #define test3 (*counter_ptr == 2 && !test_value) #define action3 (table[at_least_once]=0, table[exactly_once]++) #define test4 (*counter_ptr == 2 && test_value) #define action4 (table[at_least_once]=0, table[at_least_twice]++) (*counter_ptr)++; if (test1) action1; else if (test2) action2; else if (test3) action3; else if test4 action4; return test_value; } /* See gct-defs.h for commentary. */ GCT_CONDITION_TYPE Gct_table[GCT_NUM_CONDITIONS+1]; long Gct_table_size = GCT_NUM_CONDITIONS * sizeof(GCT_CONDITION_TYPE); long Gct_num_conditions = GCT_NUM_CONDITIONS; long Gct_current_index; #if GCT_NUM_RACE_GROUPS > 0 long Gct_group_table[GCT_NUM_RACE_GROUPS]; #else long Gct_group_table[1]; /* Fake it, to avoid pervasive #ifs */ #endif