[Bug libfortran/33386] Fortran SELECT statement miscompiles

fxcoudert at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Sep 11 10:49:00 GMT 2007



------- 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



More information about the Gcc-bugs mailing list