diff options
author | David Malcolm <dmalcolm@redhat.com> | 2017-08-18 23:56:28 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2017-08-18 23:56:28 +0000 |
commit | 953e520dbe6794655602cdecec878d0393404731 (patch) | |
tree | eb47f2e1d254187a795c286b9fd44521f93318c4 /gcc/jit/dummy-frontend.c | |
parent | 519d0798689cc68bfb27658c6f91ac3e07c04517 (diff) | |
download | gcc-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/dummy-frontend.c')
-rw-r--r-- | gcc/jit/dummy-frontend.c | 11 |
1 files changed, 11 insertions, 0 deletions
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; |