public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR libgcc/92988
@ 2019-12-30 20:26 John David Anglin
  2020-01-01 17:23 ` John David Anglin
  2020-01-15 21:40 ` Jeff Law
  0 siblings, 2 replies; 5+ messages in thread
From: John David Anglin @ 2019-12-30 20:26 UTC (permalink / raw)
  To: GCC Patches

Tested on hppa64-hp-hpux11.11.

Okay?

Dave

2019-12-30  John David Anglin  <danglin@gcc.gnu.org>

	PR libgcc/92988
	* crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if
	DEFAULT_USE_CXA_ATEXIT is true.

Index: crtstuff.c
===================================================================
--- crtstuff.c	(revision 279736)
+++ crtstuff.c	(working copy)
@@ -382,10 +382,12 @@
   if (__builtin_expect (completed, 0))
     return;

+#if DEFAULT_USE_CXA_ATEXIT
 #ifdef CRTSTUFFS_O
   if (__cxa_finalize)
     __cxa_finalize (__dso_handle);
 #endif
+#endif

 #ifdef FINI_ARRAY_SECTION_ASM_OP
   /* If we are using .fini_array then destructors will be run via that

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

* Re: [PATCH] Fix PR libgcc/92988
  2019-12-30 20:26 [PATCH] Fix PR libgcc/92988 John David Anglin
@ 2020-01-01 17:23 ` John David Anglin
  2020-01-15 21:40 ` Jeff Law
  1 sibling, 0 replies; 5+ messages in thread
From: John David Anglin @ 2020-01-01 17:23 UTC (permalink / raw)
  To: GCC Patches; +Cc: Jeff Law

This bug was introduced by the following change:
https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00766.html

On 2019-12-30 2:23 p.m., John David Anglin wrote:
> Tested on hppa64-hp-hpux11.11.
>
> Okay?
>
> Dave
>
> 2019-12-30  John David Anglin  <danglin@gcc.gnu.org>
>
> 	PR libgcc/92988
> 	* crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if
> 	DEFAULT_USE_CXA_ATEXIT is true.
>
> Index: crtstuff.c
> ===================================================================
> --- crtstuff.c	(revision 279736)
> +++ crtstuff.c	(working copy)
> @@ -382,10 +382,12 @@
>    if (__builtin_expect (completed, 0))
>      return;
>
> +#if DEFAULT_USE_CXA_ATEXIT
>  #ifdef CRTSTUFFS_O
>    if (__cxa_finalize)
>      __cxa_finalize (__dso_handle);
>  #endif
> +#endif
>
>  #ifdef FINI_ARRAY_SECTION_ASM_OP
>    /* If we are using .fini_array then destructors will be run via that
>


-- 
John David Anglin  dave.anglin@bell.net

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

* Re: [PATCH] Fix PR libgcc/92988
  2019-12-30 20:26 [PATCH] Fix PR libgcc/92988 John David Anglin
  2020-01-01 17:23 ` John David Anglin
@ 2020-01-15 21:40 ` Jeff Law
  2020-01-15 23:17   ` John David Anglin
  1 sibling, 1 reply; 5+ messages in thread
From: Jeff Law @ 2020-01-15 21:40 UTC (permalink / raw)
  To: John David Anglin, GCC Patches

On Mon, 2019-12-30 at 14:23 -0500, John David Anglin wrote:
> Tested on hppa64-hp-hpux11.11.
> 
> Okay?
> 
> Dave
> 
> 2019-12-30  John David Anglin  <danglin@gcc.gnu.org>
> 
> 	PR libgcc/92988
> 	* crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if
> 	DEFAULT_USE_CXA_ATEXIT is true.
Who is supposed to define DEFAULT_USE_CXA_ATEXIT?  I can't seem to find
any references to it within GCC itself.

I don't doubt there's a problem, I'm just not sure we've got the right
#ifdef around the code in question.

Jeff

> 

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

* Re: [PATCH] Fix PR libgcc/92988
  2020-01-15 21:40 ` Jeff Law
@ 2020-01-15 23:17   ` John David Anglin
  2020-01-15 23:51     ` Jeff Law
  0 siblings, 1 reply; 5+ messages in thread
From: John David Anglin @ 2020-01-15 23:17 UTC (permalink / raw)
  To: law, GCC Patches

On 2020-01-15 3:45 p.m., Jeff Law wrote:
> On Mon, 2019-12-30 at 14:23 -0500, John David Anglin wrote:
>> Tested on hppa64-hp-hpux11.11.
>>
>> Okay?
>>
>> Dave
>>
>> 2019-12-30  John David Anglin  <danglin@gcc.gnu.org>
>>
>> 	PR libgcc/92988
>> 	* crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if
>> 	DEFAULT_USE_CXA_ATEXIT is true.
> Who is supposed to define DEFAULT_USE_CXA_ATEXIT?  I can't seem to find
> any references to it within GCC itself.
>
> I don't doubt there's a problem, I'm just not sure we've got the right
> #ifdef around the code in question.
It is defined by configure.  In gcc/defaults.h:

/* Determine whether __cxa_atexit, rather than atexit, is used to
   register C++ destructors for local statics and global objects.  */
#ifndef DEFAULT_USE_CXA_ATEXIT
#define DEFAULT_USE_CXA_ATEXIT 0
#endif

Dave

-- 
John David Anglin  dave.anglin@bell.net

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

* Re: [PATCH] Fix PR libgcc/92988
  2020-01-15 23:17   ` John David Anglin
@ 2020-01-15 23:51     ` Jeff Law
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Law @ 2020-01-15 23:51 UTC (permalink / raw)
  To: John David Anglin, GCC Patches

On Wed, 2020-01-15 at 17:27 -0500, John David Anglin wrote:
> On 2020-01-15 3:45 p.m., Jeff Law wrote:
> > On Mon, 2019-12-30 at 14:23 -0500, John David Anglin wrote:
> > > Tested on hppa64-hp-hpux11.11.
> > > 
> > > Okay?
> > > 
> > > Dave
> > > 
> > > 2019-12-30  John David Anglin  <danglin@gcc.gnu.org>
> > > 
> > > 	PR libgcc/92988
> > > 	* crtstuff.c (__do_global_dtors_aux): Only call __cxa_finalize if
> > > 	DEFAULT_USE_CXA_ATEXIT is true.
> > Who is supposed to define DEFAULT_USE_CXA_ATEXIT?  I can't seem to find
> > any references to it within GCC itself.
> > 
> > I don't doubt there's a problem, I'm just not sure we've got the right
> > #ifdef around the code in question.
> It is defined by configure.  In gcc/defaults.h:
> 
> /* Determine whether __cxa_atexit, rather than atexit, is used to
>    register C++ destructors for local statics and global objects.  */
> #ifndef DEFAULT_USE_CXA_ATEXIT
> #define DEFAULT_USE_CXA_ATEXIT 0
> #endif
Uber-weird. I grepped for it more than once and didn't see anything.  

Thanks.  OK for the trunk.
jeff

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

end of thread, other threads:[~2020-01-15 22:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-30 20:26 [PATCH] Fix PR libgcc/92988 John David Anglin
2020-01-01 17:23 ` John David Anglin
2020-01-15 21:40 ` Jeff Law
2020-01-15 23:17   ` John David Anglin
2020-01-15 23:51     ` Jeff Law

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