PATCH: Fix xgcc error exit code & problem building Java

Caroline Tice ctice@apple.com
Wed Apr 7 17:00:00 GMT 2004


The following patch fixes the bug introduced by my previous driver 
patch, where the gcc driver was
returning an exit code of 0 even when cc1 was exiting with an error.  
This should also fix the problem
with building Java.

I have tested this on an Apple G4 running apple-darwin.  I have 
verified that xgcc now exits with a value
of 1 when cc1 exits with a 1.  I have successfully built the java 
compiler.  I am in the process of bootstrapping
(for c, c++, objc, and java).  Assuming the bootstrap passes, may I 
commit this to the mainline?  Do I need
to wait for the bootstrap to finish?

-- Caroline Tice
ctice@apple.com

2004-04-07  Caroline Tice  <ctice@apple.com>

         *gcc.c (main):  Move 'break' in main loops (on an error) to 
wait until error processing has occurred.


Index: gcc/gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.413
diff -u -3 -p -r1.413 gcc.c
--- gcc/gcc.c   5 Apr 2004 19:22:42 -0000       1.413
+++ gcc/gcc.c   7 Apr 2004 16:21:35 -0000
@@ -6425,10 +6425,7 @@ main (int argc, const char **argv)
                                                        
infiles[i].language);

                   if (value < 0)
-                   {
-                     this_file_error = 1;
-                     break;
-                   }
+                   this_file_error = 1;
                 }
             }

@@ -6436,6 +6433,7 @@ main (int argc, const char **argv)
             {
               delete_failure_queue ();
               error_count++;
+             break;
             }
           clear_failure_queue ();
         }
@@ -6482,10 +6480,7 @@ main (int argc, const char **argv)
               value = do_spec (input_file_compiler->spec);
               infiles[i].compiled = true;
               if (value < 0)
-               {
-                 this_file_error = 1;
-                 break;
-               }
+               this_file_error = 1;
             }
         }

@@ -6502,6 +6497,7 @@ main (int argc, const char **argv)
         {
           delete_failure_queue ();
           error_count++;
+         break;
         }
        /* If this compilation succeeded, don't delete those files 
later.  */
        clear_failure_queue ();



More information about the Gcc-patches mailing list