On Fri, Feb 01, 2019 at 11:36:27PM +0100, Jakub Jelinek wrote: > > As mentioned in the PR, the following testcases FAIL, because a VAR_DECL > for a PARAMETER inside of a BLOCK is not added to the BIND_EXPR vars and > thus the middle-end doesn't consider it defined. > > The problem is in the following test, which passes for all the PR67885 > tests, but doesn't really test whether this is a parameter in a BLOCK > namespace. It actually tests whether the parent namespace (usually > function/subroutine body, but could be another BLOCK) has EXEC_BLOCK as > the first executable statement in it. > As I said in the PR, we could walk the linked list from sym->ns->parent->code > through ->next pointers and look for EXEC_BLOCK which has sym->ns as the > attached namespace, but that could be compile time expensive (consider > a function with a million of blocks in it and in each of them one or more > referenced parameters - that would be O(n^2) compile time). > The following patch instead checks the bit flag set only in EXEC_BLOCK > namespaces. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? >
OK. Thanks for fixing my previous attempt to make this work. -- Steve