Hi, Originally, programmers add OpenMP's compiler directives into programs and then GCC will parse these OpenMP programs into the corresponding generic nodes. We want to automatically detect simple loop constructs from the generic forms. Then the loop constuct is replaced with the corresponding omp nodes. For some simple loop constructs,users will not add any OpenMP's directives and can use GCC to generate OpenMP programs.
We implemented our idea on GCC 4.3.6. Our approach is to add a new function, modified_walk(), in the function c_genericize(). We have successfully detected loop and replaced it to the corresponding omp node. The generic tree and gimple tree from our approach and original OpenMP program are identical. When the loop body contains one statement, our implementation executes and the result is correct. However, when the loop body contains more than one statements, our implementation will get the segmentation fault (fail in the function ei_container()). How can we fix this problem? Is there any parameters which we forget to modify them? Thank you very much for your reply. Peng-Sheng