This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/40206] [gfortran] Incorrect warning with -Wuninitialized
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 May 2009 14:32:06 -0000
- Subject: [Bug fortran/40206] [gfortran] Incorrect warning with -Wuninitialized
- References: <bug-40206-2736@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from jakub at gcc dot gnu dot org 2009-05-20 14:32 -------
For all involved strings being non-array CHAR with length 1 I fail to see why
normal SWITCH_EXPR isn't used instead (though that would just be an
optimization).
The middle-end can't know the _gfortran_select_string function will never
return numbers bigger than the size of the jump table it is called with, so the
Fortran FE should help it. If the table contains a default label, it should
use a default: case label instead of corresponding number, and if there is no
case label, but all possible strings are covered, it can pick a random case
label as the default.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40206