+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
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
--- /dev/null
+// 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]);
+}