This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to add a testcase (PR tree-optimization/83482)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 19 Dec 2017 12:05:29 +0100
- Subject: Re: PATCH to add a testcase (PR tree-optimization/83482)
- Authentication-results: sourceware.org; auth=none
- References: <20171219110117.GN2605@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Dec 19, 2017 at 12:01:17PM +0100, Marek Polacek wrote:
> This PR was a dup of PR82264, but the testcases differ, because this one
> crashes with -O2, and it's C++.
>
> Tested on x86_64-linux, ok for trunk?
>
> 2017-12-19 Marek Polacek <polacek@redhat.com>
>
> PR tree-optimization/83482
> * g++.dg/torture/pr83482.C: New test.
>
> --- gcc/testsuite/g++.dg/torture/pr83482.C
> +++ gcc/testsuite/g++.dg/torture/pr83482.C
> @@ -0,0 +1,18 @@
> +// PR tree-optimization/83482
> +// { dg-do compile }
> +
> +void _setjmp(int);
Can you declare _setjmp to something closer to what is actually used?
Say
int _setjmp (void **);
and pass it a global void *buf[64]; or similar (if it still reproduces)?
> +void a();
> +class b {
> +public:
Perhaps just struct b {
instead?
> + virtual long c() { return 0L; }
> + void m_fn2() { c(); }
> +} d;
> +void e() {
> + d.m_fn2();
> + try {
> + a();
> + _setjmp(0);
> + } catch (...) {
> + }
> +}
Ok with those changes.
Jakub