public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@linaro.org>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: Ville Voutilainen <ville.voutilainen@gmail.com>,
	"libstdc++" <libstdc++@gcc.gnu.org>,
		"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [v3 PATCH] PR libstdc++/77288 and the newest proposed resolution for LWG 2756
Date: Thu, 22 Sep 2016 19:10:00 -0000	[thread overview]
Message-ID: <CAKdteOaBtOq7LxyqkTsPGVa=S5O9sv9-vs7v1oV4ZOW62tyOSQ@mail.gmail.com> (raw)
In-Reply-To: <20160922132502.GF17376@redhat.com>

On 22 September 2016 at 15:25, Jonathan Wakely <jwakely@redhat.com> wrote:
> On 22/09/16 12:15 +0100, Jonathan Wakely wrote:
>>
>> On 22/09/16 11:16 +0100, Jonathan Wakely wrote:
>>>
>>> (Somebody should fix PR58938 so exception_ptr is portable).
>>
>>
>> Christophe, would you be able to test this patch?
>>
>> It uses a single global mutex for exception_ptr objects, which doesn't
>> scale well but that probably isn't a problem for processors without
>> lock-free atomics for single words.
>>
>> This also solves the problem of mismatched -march options, where the
>> header is compiled for a CPU that supports the atomics but
>> libstdc++.so was built for an older CPU that doesn't support them, and
>> linking fails (as in https://gcc.gnu.org/PR58938#c13).
>
>
> We'd also need something like this extra piece, to ensure we don't
> leak exceptions. Currently __gxx_exception_cleanup assumes that if
> ATOMIC_INT_LOCK_FREE < 2 the referenceCount can never be greater than
> 1, because there are not exception_ptr objects that could increase it.
>
> If we enable exception_ptr unconditionally then that assumption
> doesn't hold. This patch uses the exception_ptr code to do the
> cleanup, under the same mutex as any other increments and decrements
> of the reference count.
>
> It's a bit of a hack though.
>
Should I have applied this one on top of the other?

I ran a validation with it alone, and
arm-none-eabi with default mode, cpu, and fpu does not build:
In file included from
/tmp/9260164_29.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/libsupc++/eh_throw.cc:27:0:
/tmp/9260164_29.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/libsupc++/exception_ptr.h:43:4:
error: #error This platform does
not support exception propagation.
 #  error This platform does not support exception propagation.
    ^~~~~
make[4]: *** [eh_throw.lo] Error 1


In addition, on arm-none-eabi --with-mode=thumb --with-cpu=cortex-a9,
I've noticed a regression in c++
  - PASS now FAIL             [PASS => FAIL]:

  g++.dg/opt/pr36449.C  -std=gnu++11 execution test
  g++.dg/opt/pr36449.C  -std=gnu++14 execution test
  g++.dg/opt/pr36449.C  -std=gnu++98 execution test

My logs show:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

The validation of the other patch is still running: I had to re-run it
because the
patch didn't apply because of the ChangeLog entry.

  reply	other threads:[~2016-09-22 18:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 14:17 Ville Voutilainen
2016-09-06  7:05 ` Ville Voutilainen
2016-09-21  9:43   ` Jonathan Wakely
2016-09-21 19:51     ` Ville Voutilainen
2016-09-22  9:01       ` Christophe Lyon
2016-09-22  9:21         ` Ville Voutilainen
2016-09-22  9:43           ` Christophe Lyon
2016-09-22 10:03             ` Ville Voutilainen
2016-09-22 10:36               ` Jonathan Wakely
2016-09-22 11:38                 ` Jonathan Wakely
2016-09-22 13:32                   ` Jonathan Wakely
2016-09-22 19:10                     ` Christophe Lyon [this message]
2016-09-23 10:48                       ` Jonathan Wakely
2016-09-27  0:22                         ` Christophe Lyon
2016-09-22 20:32                   ` Christophe Lyon

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='CAKdteOaBtOq7LxyqkTsPGVa=S5O9sv9-vs7v1oV4ZOW62tyOSQ@mail.gmail.com' \
    --to=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=ville.voutilainen@gmail.com \
    /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).