Commit 953e520d by David Malcolm Committed by David Malcolm

jit: fix segfault with autovectorization (PR tree-optimization/46805)

libgccjit ran into its own version of PR tree-optimization/46805 (seen
with the Go frontend); this patch fixes it in the same way.

gcc/jit/ChangeLog:
	PR tree-optimization/46805
	* dummy-frontend.c (jit_langhook_parse_file): Handle vector types.

gcc/testsuite/ChangeLog:
	PR tree-optimization/46805
	* jit.dg/all-non-failing-tests.h: Add test-autovectorize.c.
	* jit.dg/test-autovectorize.c: New test case.

From-SVN: r251192
parent 519d0798
2017-08-18 David Malcolm <dmalcolm@redhat.com>
PR tree-optimization/46805
* dummy-frontend.c (jit_langhook_parse_file): Handle vector types.
2017-08-18 David Malcolm <dmalcolm@redhat.com>
* jit-recording.c (class gcc::jit::reproducer): Rename field
"m_identifiers" to "m_map_memento_to_identifier". Add field
"m_set_identifiers" and struct hash_traits for it.
......
......@@ -165,6 +165,17 @@ jit_langhook_parse_file (void)
static tree
jit_langhook_type_for_mode (machine_mode mode, int unsignedp)
{
/* Build any vector types here (see PR 46805). */
if (VECTOR_MODE_P (mode))
{
tree inner;
inner = jit_langhook_type_for_mode (GET_MODE_INNER (mode), unsignedp);
if (inner != NULL_TREE)
return build_vector_type_for_mode (inner, mode);
return NULL_TREE;
}
if (mode == TYPE_MODE (float_type_node))
return float_type_node;
......
2017-08-18 David Malcolm <dmalcolm@redhat.com>
PR tree-optimization/46805
* jit.dg/all-non-failing-tests.h: Add test-autovectorize.c.
* jit.dg/test-autovectorize.c: New test case.
2017-08-18 Peter Bergner <bergner@vnet.ibm.com>
PR target/80210
......
......@@ -50,6 +50,13 @@
#undef create_code
#undef verify_code
/* test-autovectorize.c */
#define create_code create_code_autovectorize
#define verify_code verify_code_autovectorize
#include "test-autovectorize.c"
#undef create_code
#undef verify_code
/* test-calling-external-function.c */
#define create_code create_code_calling_external_function
#define verify_code verify_code_calling_external_function
......@@ -267,6 +274,9 @@ const struct testcase testcases[] = {
{"arrays",
create_code_arrays,
verify_code_arrays},
{"autovectorize",
create_code_autovectorize,
verify_code_autovectorize},
{"calling_external_function",
create_code_calling_external_function,
verify_code_calling_external_function},
......
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