This is the mail archive of the
mailing list for the GCC project.
Re: [RFC] Change order of Fortran BLOCK_VARS (PR fortran/71687, take 2)
- From: Mikael Morin <morin-mikael at orange dot fr>
- To: Jakub Jelinek <jakub at redhat dot com>, fortran at gcc dot gnu dot org, Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>, Jerry DeLisle <jvdelisle at charter dot net>, Tobias Burnus <burnus at net-b dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 1 Jul 2016 19:59:22 +0200
- Subject: Re: [RFC] Change order of Fortran BLOCK_VARS (PR fortran/71687, take 2)
- Authentication-results: sourceware.org; auth=none
- References: <20160630180654 dot GR7387 at tucnak dot redhat dot com> <20160701145811 dot GV7387 at tucnak dot redhat dot com>
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
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
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.