On 06/10/2016 01:13 PM, Jakub Jelinek wrote:
Hi!
As can be seen on the following (IMNSHO valid) testcase, we need to walk
ops of GIMPLE_GOTO, except when it has (non-local) LABEL_DECL in it.
There is code to do this, but it was setting *handled_ops_p to true and
thus not actually walking those (therefore tweaks of wi->* were useless).
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?
2016-06-10 Jakub Jelinek <ja...@redhat.com>
PR middle-end/71494
* tree-nested.c (convert_nonlocal_reference_stmt): For GIMPLE_GOTO
without LABEL_DECL, set *handled_ops_p to false instead of true.
* gcc.c-torture/execute/pr71494.c: New test.
OK.
Note the following from the labels as values section of the manual:
--
You may not use this mechanism to jump to code in a different function.
If you do that, totally unpredictable things happen. The best way to
avoid this is to store the label address only in automatic variables and
never pass it as an argument.
--
Which I think says pretty explicitly that the original testcase is invalid.
jeff