This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH to add a testcase (PR tree-optimization/83482)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]