This patch adds support for num_gangs, num_workers and vector_length inside nested functions. This fixes an ICE that I hit inside a nested fortran subroutine that was using a num_gangs clause on an acc parallel construct.
I applied this patch to gomp-4_0-branch. Cesar