Le 01/07/2016 16:58, Jakub Jelinek a écrit :
On Thu, Jun 30, 2016 at 08:06:54PM +0200, Jakub Jelinek wrote:
So, is it intentional that pushdecl / getdecls acts like a LIFO?
Though, it seems user vars are pushdecled in the reverse order of
declarations, but gfc_add_decl_to_function is called in the user declared
order, so perhaps for the following patch we'd also need to
decl = nreverse (saved_function_decls);
in gfc_generate_function_code and similarly in gfc_process_block_locals
decl = nreverse (saved_local_decls);

Here is an updated patch with the above mentioned two calls to nreverse
added.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Hello,

I'm a bit surprised that it has worked so well so far.
We should probably switch at some point to using a vec to collect decls without headache. In the mean time, the patch is OK. Thanks.

Mikael

Reply via email to