My last change (commit r3709) introduced a bug where ErrMsg could
possibly be called in the backend without Set_Error_Descriptor having
been called first, causing ErrMsg to crash.

This crash showed up in some tests where an error message is produced
by the cg, like the GCC regression test
gcc.c-torture/compile/pr23237.c.

The fix is to always call Set_Error_Descriptor early in the backend
driver, at the same time the rest of the error initialization takes
place.  Could a gatekeeper please review the patch below?  Thanks,

-David Coakley / AMD Open Source Compiler Engineering


Index: osprey/be/be/driver.cxx
===================================================================
--- osprey/be/be/driver.cxx     (revision 3714)
+++ osprey/be/be/driver.cxx     (working copy)
@@ -3,7 +3,7 @@
  */

 /*
- * Copyright (C) 2008-2010 Advanced Micro Devices, Inc.  All Rights Reserved.
+ * Copyright (C) 2008-2011 Advanced Micro Devices, Inc.  All Rights Reserved.
  */

 /*
@@ -502,7 +502,6 @@
       Get_Phase_Args (PHASE_IPL, &phase_argc, &phase_argv);
       load_so ("ipl.so", Ipl_Path, Show_Progress);
       ipl_main (phase_argc, phase_argv);
-      Set_Error_Descriptor (EP_BE, EDESC_BE);
     }

     if (Run_lno || Run_autopar) {
@@ -2171,6 +2170,8 @@
   Set_Error_Line ( ERROR_LINE_UNKNOWN );
   Set_Error_File ( NULL );
   Set_Error_Phase ( "Back End Driver" );
+  Set_Error_Descriptor (EP_BE, EDESC_BE);
+  Set_Error_Descriptor (EP_CG, EDESC_CG);

   Preconfigure ();
   Process_Command_Line (argc, argv);
@@ -2318,12 +2319,6 @@

   Phase_Init ();

-  if (Run_preopt || Run_wopt || Run_lno || Run_Distr_Array || Run_autopar
-       || Run_cg) {
-    Set_Error_Descriptor (EP_BE, EDESC_BE);
-    Set_Error_Descriptor (EP_CG, EDESC_CG);
-  }
-
   if (Tlog_File)
     Print_Tlog_Header(argc, argv);

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to