Re: [PATCH] C++: target attribute - local decl

2021-03-16 Thread Jason Merrill via Gcc-patches
On 3/8/21 4:33 AM, Martin Liška wrote: On 3/4/21 9:54 PM, Jason Merrill wrote: On 3/4/21 10:52 AM, Martin Liška wrote: On 3/4/21 4:45 PM, Jason Merrill wrote: Sure, I guess you do need to set that flag for the local decls, but that should be all. Jason Doing that also fails :/ This time

Re: [PATCH] C++: target attribute - local decl

2021-03-08 Thread Martin Liška
On 3/4/21 9:54 PM, Jason Merrill wrote: On 3/4/21 10:52 AM, Martin Liška wrote: On 3/4/21 4:45 PM, Jason Merrill wrote: Sure, I guess you do need to set that flag for the local decls, but that should  be all. Jason Doing that also fails :/ This time likely due to how we set RECORD argument

Re: [PATCH] C++: target attribute - local decl

2021-03-04 Thread Jason Merrill via Gcc-patches
On 3/4/21 10:52 AM, Martin Liška wrote: On 3/4/21 4:45 PM, Jason Merrill wrote: Sure, I guess you do need to set that flag for the local decls, but that should be all. Jason Doing that also fails :/ This time likely due to how we set RECORD argument of maybe_version_functions function:

Re: [PATCH] C++: target attribute - local decl

2021-03-04 Thread Martin Liška
On 3/4/21 4:45 PM, Jason Merrill wrote: Sure, I guess you do need to set that flag for the local decls, but that should  be all. Jason Doing that also fails :/ This time likely due to how we set RECORD argument of maybe_version_functions function: gcc/cp/decl.c:&&

Re: [PATCH] C++: target attribute - local decl

2021-03-04 Thread Jason Merrill via Gcc-patches
On 3/4/21 10:39 AM, Martin Liška wrote: On 3/4/21 4:03 PM, Jason Merrill wrote: Do you really need to register all these pairs?  I was expecting that you'd just look through DECL_LOCAL_DECL_ALIAS and then register the pair you end up with.  Local decls shouldn't need a cgraph node. Well,

Re: [PATCH] C++: target attribute - local decl

2021-03-04 Thread Martin Liška
On 3/4/21 4:03 PM, Jason Merrill wrote: Do you really need to register all these pairs?  I was expecting that you'd just look through DECL_LOCAL_DECL_ALIAS and then register the pair you end up  with.  Local decls shouldn't need a cgraph node. Well, doing that: commit

Re: [PATCH] C++: target attribute - local decl

2021-03-04 Thread Jason Merrill via Gcc-patches
On 3/4/21 3:19 AM, Martin Liška wrote: On 3/2/21 6:57 PM, Jason Merrill wrote: On 3/2/21 5:34 AM, Martin Liška wrote: On 3/1/21 8:58 PM, Jason Merrill wrote: On 3/1/21 11:59 AM, Martin Liška wrote: On 3/1/21 5:36 PM, Jason Merrill wrote: On 3/1/21 7:43 AM, Martin Liška wrote: On 2/22/21

Re: [PATCH] C++: target attribute - local decl

2021-03-04 Thread Martin Liška
On 3/2/21 6:57 PM, Jason Merrill wrote: On 3/2/21 5:34 AM, Martin Liška wrote: On 3/1/21 8:58 PM, Jason Merrill wrote: On 3/1/21 11:59 AM, Martin Liška wrote: On 3/1/21 5:36 PM, Jason Merrill wrote: On 3/1/21 7:43 AM, Martin Liška wrote: On 2/22/21 11:53 PM, Jason Merrill wrote: The

Re: [PATCH] C++: target attribute - local decl

2021-03-02 Thread Jason Merrill via Gcc-patches
On 3/2/21 5:34 AM, Martin Liška wrote: On 3/1/21 8:58 PM, Jason Merrill wrote: On 3/1/21 11:59 AM, Martin Liška wrote: On 3/1/21 5:36 PM, Jason Merrill wrote: On 3/1/21 7:43 AM, Martin Liška wrote: On 2/22/21 11:53 PM, Jason Merrill wrote: The problem seems to be with the handling of local

Re: [PATCH] C++: target attribute - local decl

2021-03-02 Thread Martin Liška
On 3/1/21 8:58 PM, Jason Merrill wrote: On 3/1/21 11:59 AM, Martin Liška wrote: On 3/1/21 5:36 PM, Jason Merrill wrote: On 3/1/21 7:43 AM, Martin Liška wrote: On 2/22/21 11:53 PM, Jason Merrill wrote: The problem seems to be with the handling of local decls.  If DECL_LOCAL_DECL_P, you need

Re: [PATCH] C++: target attribute - local decl

2021-03-01 Thread Jason Merrill via Gcc-patches
On 3/1/21 11:59 AM, Martin Liška wrote: On 3/1/21 5:36 PM, Jason Merrill wrote: On 3/1/21 7:43 AM, Martin Liška wrote: On 2/22/21 11:53 PM, Jason Merrill wrote: The problem seems to be with the handling of local decls.  If DECL_LOCAL_DECL_P, you need to look at DECL_LOCAL_DECL_ALIAS to find

Re: [PATCH] C++: target attribute - local decl

2021-03-01 Thread Martin Liška
On 3/1/21 5:36 PM, Jason Merrill wrote: On 3/1/21 7:43 AM, Martin Liška wrote: On 2/22/21 11:53 PM, Jason Merrill wrote: The problem seems to be with the handling of local decls.  If DECL_LOCAL_DECL_P, you need to look at DECL_LOCAL_DECL_ALIAS to find the namespace-scope decl.  But then if

Re: [PATCH] C++: target attribute - local decl

2021-03-01 Thread Jason Merrill via Gcc-patches
On 3/1/21 7:43 AM, Martin Liška wrote: On 2/22/21 11:53 PM, Jason Merrill wrote: The problem seems to be with the handling of local decls.  If DECL_LOCAL_DECL_P, you need to look at DECL_LOCAL_DECL_ALIAS to find the namespace-scope decl.  But then if there is no preceding namespace-scope

Re: [PATCH] C++: target attribute - local decl

2021-03-01 Thread Martin Liška
On 2/22/21 11:53 PM, Jason Merrill wrote: The problem seems to be with the handling of local decls.  If DECL_LOCAL_DECL_P, you need to look at DECL_LOCAL_DECL_ALIAS to find the namespace-scope decl.  But then if there is no preceding namespace-scope declaration, the new decl created by

Re: [PATCH] C++: target attribute - local decl

2021-02-22 Thread Jason Merrill via Gcc-patches
On 2/18/21 7:15 AM, Martin Liška wrote: We crash when target attribute get_function_versions_dispatcher is called for a function that is not registered in call graph. This fixes that by emitting a new error. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be

[PATCH] C++: target attribute - local decl

2021-02-18 Thread Martin Liška
We crash when target attribute get_function_versions_dispatcher is called for a function that is not registered in call graph. This fixes that by emitting a new error. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/cp/ChangeLog: