public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Olivier Hainque <hainque@adacore.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Cc: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Subject: Re: [PATCH] Improve sequence logic in cxx_init_decl_processing
Date: Mon, 10 Jan 2022 14:02:10 -0500	[thread overview]
Message-ID: <e0ef8106-5898-87e1-58d6-61c4d6e7e58c@redhat.com> (raw)
In-Reply-To: <5A7D4F1E-B0ED-48F0-B94B-6A355C46730E@adacore.com>

On 1/6/22 03:26, Olivier Hainque wrote:
> Hello,
> 
> commit aa2c978400f3b3ca6e9f2d18598a379589e77ba0, introduced per
> 
>    https://gcc.gnu.org/pipermail/gcc-patches/2020-May/545552.html
> 
> makes references to __cxa_pure_virtual weak and this is causing
> issues on some VxWorks configurations, where weak symbols are only
> supported for one of the two major operating modes, and not on all
> versions.
> 
> While trying to circumvent that, I noticed that the current
> code in cxx_init_decl_processing does something like:
> 
>    if (flag_weak)
>      /* If no definition is available, resolve references to NULL.  */
>      declare_weak (abort_fndecl);
>    ...
>    if (! supports_one_only ())
>      flag_weak = 0;
> 
> 
> The code possibly resetting flag_weak should presumlably execute
> before the test checking the flag, or we'd need a comment explaining
> why this surprising order is on purpose.
> 
> The attached patch just moves the reset above the test.
> 
> It bootstraps/regtests fine on x86_64-linux and allows better control
> on vxWorks. I'm not yet clear on some of the ramifications there (tigthening
> the definitions of SUPPORTS_ONE_ONLY and TARGET_SUPPORTS_WEAK yields lots of
> dg test failures) but that's another story.
> 
> Ok to commit?

OK.

> Thanks in advance!
> 
> 2021-12-30  Olivier Hainque  <hainque@adacore.com>
> 
> gcc/
> 	* cp/decl.c (cxx_init_decl_processing): Move code possibly
> 	altering flag_weak before code testing it.
> 
> Olivier
> 
> 
> 
> 
> 


  reply	other threads:[~2022-01-10 19:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06  8:26 Olivier Hainque
2022-01-10 19:02 ` Jason Merrill [this message]
2022-01-10 20:57   ` Olivier Hainque

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0ef8106-5898-87e1-58d6-61c4d6e7e58c@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hainque@adacore.com \
    --cc=rv@rasmusvillemoes.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).