public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Diagnostics from GCC_DRIVER_HOST_INITIALIZATION
@ 2012-07-19 21:14 Ryan Mansfield
  2012-07-19 22:06 ` Gabriel Dos Reis
  0 siblings, 1 reply; 6+ messages in thread
From: Ryan Mansfield @ 2012-07-19 21:14 UTC (permalink / raw)
  To: gcc-patches

GCC_DRIVER_HOST_INITIALIZATION happens before diagnostic_initialize, 
this can cause crashes if it call diagnostics such as warning, or 
fatal_error are used in the macro. One example would be in 
darwin-driver.c where darwin_find_version_from_kernel can call 
warning(). Another example is in xm-djgpp.h where it calls fatal (this 
appears to have bit-rotted with the fatal -> fatal_error switch)

Would moving the GCC_DRIVER_HOST_INITIALIZATION after 
diagnostic_initialize be OK?

Index: gcc.c
===================================================================
--- gcc.c	(revision 189681)
+++ gcc.c	(working copy)
@@ -6189,17 +6189,18 @@
  				   CL_DRIVER,
  				   &decoded_options, &decoded_options_count);

-#ifdef GCC_DRIVER_HOST_INITIALIZATION
-  /* Perform host dependent initialization when needed.  */
-  GCC_DRIVER_HOST_INITIALIZATION;
-#endif
-
    /* Unlock the stdio streams.  */
    unlock_std_streams ();

    gcc_init_libintl ();

    diagnostic_initialize (global_dc, 0);
+
+#ifdef GCC_DRIVER_HOST_INITIALIZATION
+  /* Perform host dependent initialization when needed.  */
+  GCC_DRIVER_HOST_INITIALIZATION;
+#endif
+
    if (atexit (delete_temp_files) != 0)
      fatal_error ("atexit failed");


Regards,

Ryan Mansfield

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Diagnostics from GCC_DRIVER_HOST_INITIALIZATION
  2012-07-19 21:14 Diagnostics from GCC_DRIVER_HOST_INITIALIZATION Ryan Mansfield
@ 2012-07-19 22:06 ` Gabriel Dos Reis
  2012-07-20 11:55   ` Ryan Mansfield
  0 siblings, 1 reply; 6+ messages in thread
From: Gabriel Dos Reis @ 2012-07-19 22:06 UTC (permalink / raw)
  To: Ryan Mansfield; +Cc: gcc-patches

On Thu, Jul 19, 2012 at 4:13 PM, Ryan Mansfield <rmansfield@qnx.com> wrote:
> GCC_DRIVER_HOST_INITIALIZATION happens before diagnostic_initialize, this
> can cause crashes if it call diagnostics such as warning, or fatal_error are
> used in the macro. One example would be in darwin-driver.c where
> darwin_find_version_from_kernel can call warning(). Another example is in
> xm-djgpp.h where it calls fatal (this appears to have bit-rotted with the
> fatal -> fatal_error switch)
>
> Would moving the GCC_DRIVER_HOST_INITIALIZATION after diagnostic_initialize
> be OK?

yes, I think so.

>
> Index: gcc.c
> ===================================================================
> --- gcc.c       (revision 189681)
> +++ gcc.c       (working copy)
> @@ -6189,17 +6189,18 @@
>                                    CL_DRIVER,
>                                    &decoded_options,
> &decoded_options_count);
>
> -#ifdef GCC_DRIVER_HOST_INITIALIZATION
> -  /* Perform host dependent initialization when needed.  */
> -  GCC_DRIVER_HOST_INITIALIZATION;
> -#endif
> -
>    /* Unlock the stdio streams.  */
>    unlock_std_streams ();
>
>    gcc_init_libintl ();
>
>    diagnostic_initialize (global_dc, 0);
> +
> +#ifdef GCC_DRIVER_HOST_INITIALIZATION
> +  /* Perform host dependent initialization when needed.  */
> +  GCC_DRIVER_HOST_INITIALIZATION;
> +#endif
> +
>    if (atexit (delete_temp_files) != 0)
>      fatal_error ("atexit failed");
>
>
> Regards,
>
> Ryan Mansfield

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Diagnostics from GCC_DRIVER_HOST_INITIALIZATION
  2012-07-19 22:06 ` Gabriel Dos Reis
@ 2012-07-20 11:55   ` Ryan Mansfield
  2012-07-27  8:58     ` Dodji Seketeli
  0 siblings, 1 reply; 6+ messages in thread
From: Ryan Mansfield @ 2012-07-20 11:55 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 913 bytes --]

On 12-07-19 06:06 PM, Gabriel Dos Reis wrote:
> On Thu, Jul 19, 2012 at 4:13 PM, Ryan Mansfield <rmansfield@qnx.com> wrote:
>> GCC_DRIVER_HOST_INITIALIZATION happens before diagnostic_initialize, this
>> can cause crashes if it call diagnostics such as warning, or fatal_error are
>> used in the macro. One example would be in darwin-driver.c where
>> darwin_find_version_from_kernel can call warning(). Another example is in
>> xm-djgpp.h where it calls fatal (this appears to have bit-rotted with the
>> fatal -> fatal_error switch)
>>
>> Would moving the GCC_DRIVER_HOST_INITIALIZATION after diagnostic_initialize
>> be OK?
>
> yes, I think so.

OK, then here's a changelog entry for the diff.

2012-07-20  Ryan Mansfield  <rmansfield@qnx.com>

         * gcc.c (main): Move GCC_DRIVER_HOST_INITIALIZATION after
         diagnostic_initialize.

Could someone please apply the change?

Regards,

Ryan Mansfield

[-- Attachment #2: gcc.c.diff --]
[-- Type: text/x-patch, Size: 731 bytes --]

Index: gcc.c
===================================================================
--- gcc.c	(revision 189716)
+++ gcc.c	(working copy)
@@ -6189,17 +6189,18 @@
 				   CL_DRIVER,
 				   &decoded_options, &decoded_options_count);
 
-#ifdef GCC_DRIVER_HOST_INITIALIZATION
-  /* Perform host dependent initialization when needed.  */
-  GCC_DRIVER_HOST_INITIALIZATION;
-#endif
-
   /* Unlock the stdio streams.  */
   unlock_std_streams ();
 
   gcc_init_libintl ();
 
   diagnostic_initialize (global_dc, 0);
+
+#ifdef GCC_DRIVER_HOST_INITIALIZATION
+  /* Perform host dependent initialization when needed.  */
+  GCC_DRIVER_HOST_INITIALIZATION;
+#endif
+
   if (atexit (delete_temp_files) != 0)
     fatal_error ("atexit failed");
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Diagnostics from GCC_DRIVER_HOST_INITIALIZATION
  2012-07-20 11:55   ` Ryan Mansfield
@ 2012-07-27  8:58     ` Dodji Seketeli
  2012-07-27 13:40       ` Ryan Mansfield
       [not found]       ` <CAAiZkiCzXeRzXj-F8b=_kNggoM7V8tYbhb8rkY94JN2afn0pUg@mail.gmail.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Dodji Seketeli @ 2012-07-27  8:58 UTC (permalink / raw)
  To: Ryan Mansfield; +Cc: Gabriel Dos Reis, gcc-patches

Hello,

Ryan Mansfield <rmansfield@qnx.com> a écrit:

> On 12-07-19 06:06 PM, Gabriel Dos Reis wrote:

[...]

>>> Would moving the GCC_DRIVER_HOST_INITIALIZATION after diagnostic_initialize
>>> be OK?
>>
>> yes, I think so.
>
> OK, then here's a changelog entry for the diff.
>
> 2012-07-20  Ryan Mansfield  <rmansfield@qnx.com>
>
>         * gcc.c (main): Move GCC_DRIVER_HOST_INITIALIZATION after
>         diagnostic_initialize.
>
> Could someone please apply the change?

The change seems small and obvious enough to not require copyright
assignment on file, but, just to be sure, Ryan, do you have copyright
assignment to the FSF on file (sorry if my question is stupid)?

Gaby, can I go ahead and apply this?

Thanks.

[...]

> Index: gcc.c
> ===================================================================
> --- gcc.c	(revision 189716)
> +++ gcc.c	(working copy)
> @@ -6189,17 +6189,18 @@
>  				   CL_DRIVER,
>  				   &decoded_options, &decoded_options_count);
>  
> -#ifdef GCC_DRIVER_HOST_INITIALIZATION
> -  /* Perform host dependent initialization when needed.  */
> -  GCC_DRIVER_HOST_INITIALIZATION;
> -#endif
> -
>    /* Unlock the stdio streams.  */
>    unlock_std_streams ();
>  
>    gcc_init_libintl ();
>  
>    diagnostic_initialize (global_dc, 0);
> +
> +#ifdef GCC_DRIVER_HOST_INITIALIZATION
> +  /* Perform host dependent initialization when needed.  */
> +  GCC_DRIVER_HOST_INITIALIZATION;
> +#endif
> +
>    if (atexit (delete_temp_files) != 0)
>      fatal_error ("atexit failed");
>  

-- 
		Dodji

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Diagnostics from GCC_DRIVER_HOST_INITIALIZATION
  2012-07-27  8:58     ` Dodji Seketeli
@ 2012-07-27 13:40       ` Ryan Mansfield
       [not found]       ` <CAAiZkiCzXeRzXj-F8b=_kNggoM7V8tYbhb8rkY94JN2afn0pUg@mail.gmail.com>
  1 sibling, 0 replies; 6+ messages in thread
From: Ryan Mansfield @ 2012-07-27 13:40 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: Gabriel Dos Reis, gcc-patches

On 12-07-27 03:41 AM, Dodji Seketeli wrote:
>> 2012-07-20  Ryan Mansfield  <rmansfield@qnx.com>
>>
>>          * gcc.c (main): Move GCC_DRIVER_HOST_INITIALIZATION after
>>          diagnostic_initialize.
>>
>> Could someone please apply the change?
>
> The change seems small and obvious enough to not require copyright
> assignment on file, but, just to be sure, Ryan, do you have copyright
> assignment to the FSF on file (sorry if my question is stupid)?

Yes, I do.

Regards,

Ryan Mansfield

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Diagnostics from GCC_DRIVER_HOST_INITIALIZATION
       [not found]       ` <CAAiZkiCzXeRzXj-F8b=_kNggoM7V8tYbhb8rkY94JN2afn0pUg@mail.gmail.com>
@ 2012-07-27 18:36         ` Dodji Seketeli
  0 siblings, 0 replies; 6+ messages in thread
From: Dodji Seketeli @ 2012-07-27 18:36 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: Ryan Mansfield, gcc-patches

Gabriel Dos Reis <gdr@integrable-solutions.net> a écrit:

>> > 2012-07-20  Ryan Mansfield  <rmansfield@qnx.com <javascript:;>>
>> >
>> >         * gcc.c (main): Move GCC_DRIVER_HOST_INITIALIZATION after
>> >         diagnostic_initialize.
>> >
>> > Could someone please apply the change?
>>
>> The change seems small and obvious enough to not require copyright
>> assignment on file, but, just to be sure, Ryan, do you have copyright
>> assignment to the FSF on file (sorry if my question is stupid)?
>>
>> Gaby, can I go ahead and apply this?
>>
>>
> yes, thank you!

Committed at revision r189918.

Thanks.

-- 
		Dodji

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-07-27 18:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19 21:14 Diagnostics from GCC_DRIVER_HOST_INITIALIZATION Ryan Mansfield
2012-07-19 22:06 ` Gabriel Dos Reis
2012-07-20 11:55   ` Ryan Mansfield
2012-07-27  8:58     ` Dodji Seketeli
2012-07-27 13:40       ` Ryan Mansfield
     [not found]       ` <CAAiZkiCzXeRzXj-F8b=_kNggoM7V8tYbhb8rkY94JN2afn0pUg@mail.gmail.com>
2012-07-27 18:36         ` Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).