This is the mail archive of the
mailing list for the GCC project.
Re: [gfortran,patch] Improve handling of character SELECT
- From: "Janne Blomqvist" <blomqvist dot janne at gmail dot com>
- To: "FX Coudert" <fxcoudert at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, "gcc-patches List" <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 15 Jul 2007 10:44:07 +0300
- Subject: Re: [gfortran,patch] Improve handling of character SELECT
- References: <CB4787F2-5363-4128-A34A-CDAE896499FC@gmail.com>
On 7/12/07, FX Coudert <email@example.com> wrote:
The patch attached is a partial rewrite of the translation of SELECT
for character types. Currently, we generate a blocks of code for each
case, along with a label and a list of the cases; a library function
is called and it returns the address of the label that we will jump
to. This use of jumps (GOTO_EXPR) is apparently hard on the middle-
end (probably causing missed-optimizations, and at least preventing
it to correctly understand what variables are initialized: see PR
32035). Andrew Pinski suggested that we can use a SWITCH_EXPR instead
(thanks Andrew for the analysis!). This is what my patch does, by
assiging an integer value to each case, making the library function
return an integer value and using a switch to select the appropriate
code block to execute.
Bootstrapped and regtested on x86_64-linux, OK for mainline?
Please also put a note to PR 32720 that although your patch fixes the
regression, the underlying middle-end bug is still there.