The deadlocks related to barriers are one kind of the major factors that cause OpenMP programs to malfunction. Static detection of these hazards can help enhance the correctness of OpenMP programs before they are executed. For convenience of detection, this kind of deadlocks is classified into two categories. By searching and data flow analysis, the first and the second category of deadlocks are detected according to the existence rule and nonuniformity rule respectively. Traditional control flow graph is extended to represent OpenMP programs. For each detected deadlock, backtracking is used to record the related paths in the control flow graph, and static branch prediction is employed to quantify its severity. Based on these ideas, a tool, called C-Checker, to statically detect deadlocks in OpenMP Fortran programs is implemented. Experiments show the C-Checker can effectively detect the deadlocks concerned.