aboutsummaryrefslogtreecommitdiff
path: root/gcc/jit
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2017-08-18 23:56:28 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2017-08-18 23:56:28 +0000
commit953e520dbe6794655602cdecec878d0393404731 (patch)
treeeb47f2e1d254187a795c286b9fd44521f93318c4 /gcc/jit
parent519d0798689cc68bfb27658c6f91ac3e07c04517 (diff)
downloadgcc-953e520dbe6794655602cdecec878d0393404731.zip
gcc-953e520dbe6794655602cdecec878d0393404731.tar.gz
gcc-953e520dbe6794655602cdecec878d0393404731.tar.bz2
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
Diffstat (limited to 'gcc/jit')
-rw-r--r--gcc/jit/ChangeLog5
-rw-r--r--gcc/jit/dummy-frontend.c11
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/jit/ChangeLog b/gcc/jit/ChangeLog
index 824a4a5..d06722c 100644
--- a/gcc/jit/ChangeLog
+++ b/gcc/jit/ChangeLog
@@ -1,5 +1,10 @@
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.
diff --git a/gcc/jit/dummy-frontend.c b/gcc/jit/dummy-frontend.c
index d7d2172..b217290 100644
--- a/gcc/jit/dummy-frontend.c
+++ b/gcc/jit/dummy-frontend.c
@@ -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;