Commit 884efbd5 by Iain Buclaw Committed by Iain Buclaw

d: Fix internal compiler error: in add_expr, at tree.c:7794

gcc/d/ChangeLog:

	PR d/91238
	* d-codegen.cc (build_address): If taking the address of a CALL_EXPR,
	wrap it in a TARGET_EXPR.

gcc/testsuite/ChangeLog:

	PR d/91238
	* gdc.dg/pr91238.d: New test.

From-SVN: r274253
parent 77eb117f
2019-08-10 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/91238
* d-codegen.cc (build_address): If taking the address of a CALL_EXPR,
wrap it in a TARGET_EXPR.
2019-08-10 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/90893
* runtime.cc (enum libcall_type): Rename to...
(enum d_libcall_type): ...this.
......
......@@ -651,9 +651,11 @@ build_address (tree exp)
if (TREE_CODE (exp) == CONST_DECL)
exp = DECL_INITIAL (exp);
/* Some expression lowering may request an address of a compile-time constant.
Make sure it is assigned to a location we can reference. */
if (CONSTANT_CLASS_P (exp) && TREE_CODE (exp) != STRING_CST)
/* Some expression lowering may request an address of a compile-time constant,
or other non-lvalue expression. Make sure it is assigned to a location we
can reference. */
if ((CONSTANT_CLASS_P (exp) && TREE_CODE (exp) != STRING_CST)
|| TREE_CODE (exp) == CALL_EXPR)
exp = force_target_expr (exp);
d_mark_addressable (exp);
......
2019-08-10 Iain Buclaw <ibuclaw@gdcproject.org>
PR d/91238
* gdc.dg/pr91238.d: New test.
2019-08-10 Jakub Jelinek <jakub@redhat.com>
* c-c++-common/gomp/declare-target-2.c: Don't expect error for
......
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91238
// { dg-do compile }
alias T = const(char)*;
T name()
{
return "";
}
void collect(ref T)
{
}
void configure(T[T] targets)
{
collect(targets[name]);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment