This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Assert DECL_ABSTRACT_ORIGIN is different from the decl itself
- From: Martin Jambor <mjambor at suse dot cz>
- To: Jeff Law <law at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 1 Dec 2016 17:10:44 +0100
- Subject: Re: [RFC] Assert DECL_ABSTRACT_ORIGIN is different from the decl itself
- Authentication-results: sourceware.org; auth=none
- References: <20161128142720.fjw72dtpd2mekftv@virgil.suse.cz> <9ac68ea2-8b91-76a5-01c2-e2fcdf482f1b@redhat.com> <20161128172813.zkf57hxrtvaxqitk@virgil.suse.cz> <CAFiYyc1EiXeLV_vhXLN0Uo-dYDGAAELKBh5p+uaPLTaQuqbEOw@mail.gmail.com> <040f66b4-e86c-1ab3-964d-0a5cba95fab5@redhat.com> <20161130130918.n4e2rcvqnvzdwo2x@virgil.suse.cz>
Hello,
On Wed, Nov 30, 2016 at 02:09:19PM +0100, Martin Jambor wrote:
> On Tue, Nov 29, 2016 at 10:17:02AM -0700, Jeff Law wrote:
> >
> > ...
> >
> > So it seems that rather than an assert that we should just not walk down a
> > self-referencing DECL_ABSTRACT_ORIGIN.
> >
>
> ...
>
> So I wonder what the options are... perhaps it seems that we can call
> dump_function_name which starts with code handling
> !DECL_LANG_SPECIFIC(t) cases, even instead of the weird <built-in>
> thing?
The following patch does that, it works as expected on my small
testcases, brings g++ in line with what gcc does with clones when it
comes to OpenMP outline functions and obviously prevents the infinite
recursion.
It passes bootstrap and testing on x86_64-linux. OK for trunk?
Thanks,
2016-11-30 Martin Jambor <mjambor@suse.cz>
PR c++/78589
* error.c (dump_decl): Use dump_function_name to dump
!DECL_LANG_SPECIFIC function decls with no or self-referencing
abstract origin.
---
gcc/cp/error.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 7bf07c3..5f8fb2a 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1216,10 +1216,11 @@ dump_decl (cxx_pretty_printer *pp, tree t, int flags)
case FUNCTION_DECL:
if (! DECL_LANG_SPECIFIC (t))
{
- if (DECL_ABSTRACT_ORIGIN (t))
+ if (DECL_ABSTRACT_ORIGIN (t)
+ && DECL_ABSTRACT_ORIGIN (t) != t)
dump_decl (pp, DECL_ABSTRACT_ORIGIN (t), flags);
else
- pp_string (pp, M_("<built-in>"));
+ dump_function_name (pp, t, flags);
}
else if (DECL_GLOBAL_CTOR_P (t) || DECL_GLOBAL_DTOR_P (t))
dump_global_iord (pp, t);
--
2.10.2