This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Segfault Question
- From: Nathan Sidwell <nathan at acm dot org>
- To: nick <xerofoify at gmail dot com>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 17 Dec 2018 09:55:19 -0500
- Subject: Re: Segfault Question
- References: <65fff803-340b-bf49-2188-74739ae375dd@gmail.com>
On 12/14/18 10:55 AM, nick wrote:
Greetings All,
I was attempting to fix this bug:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88395#add_comment
and managed to track it down to expand_concept in constraint.cc.
Seems that we are hitting this case in tsubst_expr for the NULL_TREE:
if (t == NULL_TREE || t == error_mark_node)
return t
and we only check result for error_mark_node. Is error_mark_node
equal to a NULL_TREE or is it something else?
error_mark_node is a non-null pointer to a tree_node with ERROR_MARK as
its tree code. (if you build with CXXFLAGS=-g3 you'll get macros
available so gdb's 'p error_mark_node' will work)
If not than it seems
that we should change our check to:
if (result == error_mark_node || result == NULL_TREE)
and it seems that this is also not checked it the other callers so it
should be fixed.
Swapping the || arguments is not the fix -- it'll make no difference (in
a well-formed program).
Let me known if I am missing something,
If the optimizers have removed the 't == NULL_TREE' check, that's
because they've determined that 't' cannot be null at that point.
Something earlier has convinced them otherwise -- usually a dereference
will do that.
nathan
--
Nathan Sidwell