Re: [gomp4] C++ OpenMP user defined reductions (take 2)

2013-10-09 Thread Jason Merrill
On 10/09/2013 01:43 PM, Jakub Jelinek wrote: Perhaps DECL_TEMPLATE_INFO check could also be less expensive to be done before calling decl_maybe_constant_var_p or undeduced_auto_decl ? Sure. + DECL_LOCAL_FUNCTION_P (fndecl) = 1; This should be set by pushdecl_maybe_friend_1, so I don

Re: [gomp4] C++ OpenMP user defined reductions (take 2)

2013-10-09 Thread Jakub Jelinek
On Wed, Oct 09, 2013 at 10:47:22AM -0400, Jason Merrill wrote: > On 10/07/2013 07:02 AM, Jakub Jelinek wrote: > >duplicates anywhere, but during error diagnostics. Without those two decl.c > >hunks (either of them), pushdecl will sometimes return a different decl from > >the original or error_mark

Re: [gomp4] C++ OpenMP user defined reductions (take 2)

2013-10-09 Thread Jason Merrill
On 10/07/2013 07:02 AM, Jakub Jelinek wrote: duplicates anywhere, but during error diagnostics. Without those two decl.c hunks (either of them), pushdecl will sometimes return a different decl from the original or error_mark_node, and the original fndecl passed to it has ggc_free called on it, t

Re: [gomp4] C++ OpenMP user defined reductions (take 2)

2013-10-07 Thread Jakub Jelinek
Hi! On Sat, Sep 21, 2013 at 07:45:03AM -0400, Jason Merrill wrote: So, for things that worked fine for me, I'm attaching two patches (W050b and W051a), do they look ok to you? The rest causes issues, all of them on gcc/testsuite/g++.dg/gomp/udr-3.C testcase, see below. > On 09/20/2013 12:25 PM,

Re: [gomp4] C++ OpenMP user defined reductions (take 2)

2013-09-21 Thread Jason Merrill
On 09/20/2013 12:25 PM, Jakub Jelinek wrote: In templates the UDRs are always FUNCTION_DECLs in classes or at function block scope, the above one liner was I believe for the latter, where without it duplicate_decls was returning incorrectly 0; the UDRs from mismatching templates would actually ne

Re: [gomp4] C++ OpenMP user defined reductions (take 2)

2013-09-20 Thread Jakub Jelinek
Hi! On Fri, Sep 20, 2013 at 12:00:41PM -0400, Jason Merrill wrote: Thanks for the review, I'll try to get to most of that next week. > On 09/12/2013 04:55 AM, Jakub Jelinek wrote: > >- if (t1 != t2) > >+ if (t1 != t2 && !DECL_OMP_DECLARE_REDUCTION_P (newdecl)) > > return 0; > > Wh

Re: [gomp4] C++ OpenMP user defined reductions (take 2)

2013-09-20 Thread Jason Merrill
On 09/12/2013 04:55 AM, Jakub Jelinek wrote: - if (t1 != t2) + if (t1 != t2 && !DECL_OMP_DECLARE_REDUCTION_P (newdecl)) return 0; What's the theory here? Why should decls_match return true for reductions with mismatching templates? + && ! (DECL_OMP_DECLARE_REDUCTI

Re: [gomp4] C++ OpenMP user defined reductions (take 2)

2013-09-12 Thread Jakub Jelinek
On Thu, Sep 12, 2013 at 10:55:44AM +0200, Jakub Jelinek wrote: > What is still missing is accessibility checking, in the attached udr5.C > I'd assume we should error on the dg-error marked lines (because one of the > UDRs is protected and another one is private). Not sure what I'm doing > wrong th