This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/33386] Fortran SELECT statement miscompiles
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Sep 2007 10:48:56 -0000
- Subject: [Bug libfortran/33386] Fortran SELECT statement miscompiles
- References: <bug-33386-11807@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from fxcoudert at gcc dot gnu dot org 2007-09-11 10:48 -------
> Adding a default case gets rid of the problems, also for my real application
> code.
If you're in a position to build the compiler yourself, could you try the
following patch? I think it should fix the problem (thanks Andrew for spotting
the initialized variable).
Index: libgfortran/runtime/select.c
===================================================================
--- libgfortran/runtime/select.c (revision 127830)
+++ libgfortran/runtime/select.c (working copy)
@@ -53,7 +53,7 @@ select_string (select_struct *table, int
{
select_struct *t;
int i, low, high, mid;
- int default_jump;
+ int default_jump = -1;
if (table_len == 0)
return -1;
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33386