This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/68449] [5/6 Regression] ICE in cxx_eval_constant_expression on atomic_load in C++
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 01 Dec 2015 11:50:27 +0000
- Subject: [Bug c++/68449] [5/6 Regression] ICE in cxx_eval_constant_expression on atomic_load in C++
- Auto-submitted: auto-generated
- References: <bug-68449-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68449
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Slightly improved testcase:
// PR c++/68449
// { dg-do compile }
// { dg-options "-Wsign-compare" }
int
foo (int a)
{
return __extension__ ({ int b; b; }) < 0;
}
It seems that if the ctx->values hash table has a record for certain variable,
but it is uninitialized, it has NULL_TREE in there.
Some spots that call ctx->values->get do check for NULL, but others don't.
This particular case is:
3195 if (VAR_P (r))
3196 if (tree *p = ctx->values->get (r))
3197 r = *p;
I wonder if for !*p we just shouldn't keep r the VAR_DECL as is and let the few
lines before complain if needed. So that would be
if (VAR_P (r))
if (tree *p = ctx->values->get (r))
if (*p)
r = *p;
or so.