+2015-07-08 David Malcolm <dmalcolm@redhat.com>
+
+ PR jit/66783
+ * libgccjit.c (gcc_jit_context_new_field): Show name of field in
+ "unknown size" error message.
+ (gcc_jit_struct_set_fields): Show name of struct in error message.
+ (gcc_jit_context_new_global): Show name of global in
+ "unknown size" error message.
+ (gcc_jit_function_new_local): Likewise for local.
+
2015-07-07 Andrew MacLeod <amacleod@redhat.com>
* dummy-frontend.c: Adjust includes.
/* LOC can be NULL. */
RETURN_NULL_IF_FAIL (type, ctxt, loc, "NULL type");
RETURN_NULL_IF_FAIL (name, ctxt, loc, "NULL name");
- RETURN_NULL_IF_FAIL_PRINTF1 (
+ RETURN_NULL_IF_FAIL_PRINTF2 (
type->has_known_size (),
ctxt, loc,
- "type has unknown size (type: %s)",
+ "unknown size for field \"%s\" (type: %s)",
+ name,
type->get_debug_string ());
return (gcc_jit_field *)ctxt->new_field (loc, type, name);
RETURN_IF_FAIL (fields, ctxt, loc, "NULL fields ptr");
for (int i = 0; i < num_fields; i++)
{
- RETURN_IF_FAIL (fields[i], ctxt, loc, "NULL field ptr");
+ RETURN_IF_FAIL_PRINTF2 (
+ fields[i],
+ ctxt, loc,
+ "%s: NULL field ptr at index %i",
+ struct_type->get_debug_string (),
+ i);
RETURN_IF_FAIL_PRINTF2 (
NULL == fields[i]->get_container (),
ctxt, loc,
kind);
RETURN_NULL_IF_FAIL (type, ctxt, loc, "NULL type");
RETURN_NULL_IF_FAIL (name, ctxt, loc, "NULL name");
- RETURN_NULL_IF_FAIL_PRINTF1 (
+ RETURN_NULL_IF_FAIL_PRINTF2 (
type->has_known_size (),
ctxt, loc,
- "type has unknown size (type: %s)",
+ "unknown size for global \"%s\" (type: %s)",
+ name,
type->get_debug_string ());
return (gcc_jit_lvalue *)ctxt->new_global (loc, kind, type, name);
"Cannot add locals to an imported function");
RETURN_NULL_IF_FAIL (type, ctxt, loc, "NULL type");
RETURN_NULL_IF_FAIL (name, ctxt, loc, "NULL name");
- RETURN_NULL_IF_FAIL_PRINTF1 (
+ RETURN_NULL_IF_FAIL_PRINTF2 (
type->has_known_size (),
ctxt, loc,
- "type has unknown size (type: %s)",
+ "unknown size for local \"%s\" (type: %s)",
+ name,
type->get_debug_string ());
return (gcc_jit_lvalue *)func->new_local (loc, type, name);
+2015-07-08 David Malcolm <dmalcolm@redhat.com>
+
+ PR jit/66783
+ * jit.dg/test-error-gcc_jit_context_new_field-opaque-struct.c
+ (verify_code): Update expected error message.
+ * jit.dg/test-error-gcc_jit_context_new_global-opaque-struct.c
+ (verify_code): Likewise.
+ * jit.dg/test-error-gcc_jit_function_new_local-opaque-struct.c
+ (verify_code): Likewise.
+
2015-07-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/66793