From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64394 invoked by alias); 19 Aug 2017 00:01:07 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 36819 invoked by uid 89); 19 Aug 2017 00:00:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Takes X-Spam-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 19 Aug 2017 00:00:33 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 022C6461DB; Sat, 19 Aug 2017 00:00:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 022C6461DB Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dmalcolm@redhat.com Received: from c64.redhat.com (ovpn-112-20.phx2.redhat.com [10.3.112.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 650615D961; Sat, 19 Aug 2017 00:00:19 +0000 (UTC) From: David Malcolm To: gcc-patches@gcc.gnu.org, jit@gcc.gnu.org, Michael Cree Cc: David Malcolm Subject: [committed] jit: fix segfault with autovectorization (PR tree-optimization/46805) Date: Sun, 01 Jan 2017 00:00:00 -0000 Message-Id: <1503102932-50981-1-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1502985078.3741.26.camel@redhat.com> References: <1502985078.3741.26.camel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sat, 19 Aug 2017 00:00:21 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00013.txt.bz2 On Thu, 2017-08-17 at 11:51 -0400, David Malcolm wrote: > On Thu, 2017-08-17 at 09:15 +1200, Michael Cree wrote: > > On Wed, Aug 16, 2017 at 10:01:57AM -0400, David Malcolm wrote: > > > On Wed, 2017-08-16 at 21:58 +1200, Michael Cree wrote: > > > > > > > > But I have hit a problem which I suspect is a bug in the gcc > > > > optimiser. > > > > > > > > In the vein of your example above, but working on uint8_t pixel > > > > data > > > > and adding saturation, the jit compiler segfaults in the > > > > optimiser. I > > > > provide below the gimple produced by the function that causes > > > > the > > > > problem (I presume that is more useful than the code calling > > > > the > > > > gcc_jit routines), > > > > > > There's actually a handy entrypoint for generating minimal > > > reproducers > > > for such crashes: > > > gcc_jit_context_dump_reproducer_to_file > > > > > > https://gcc.gnu.org/onlinedocs/jit/topics/contexts.html#gcc_jit_c > > > on > > > text_dump_reproducer_to_file > > > > > > Can you add a call to that to your code (after the context is > > > fully > > > populated), and see if the resulting .c file leads to the crash > > > when > > > run? If so, can you post the .c file here please (or attach it > > > to > > > bugzilla), and hopefully I can then reproduce it at my end. > > > > Attached. > > > > Cheers > > Michael. > > Thanks. I'm able to reproduce the crash using that; am > investigating. > > Dave libgccjit ran into its own version of PR tree-optimization/46805 (seen with the Go frontend); this patch fixes it in the same way. Successfully bootstrapped®rtested on x86_64-pc-linux-gnu. Takes jit.sum from 9759 passes to 9769. Committed to trunk as r251192. 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. --- gcc/jit/dummy-frontend.c | 11 + gcc/testsuite/jit.dg/all-non-failing-tests.h | 10 + gcc/testsuite/jit.dg/test-autovectorize.c | 375 +++++++++++++++++++++++++++ 3 files changed, 396 insertions(+) create mode 100644 gcc/testsuite/jit.dg/test-autovectorize.c 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; diff --git a/gcc/testsuite/jit.dg/all-non-failing-tests.h b/gcc/testsuite/jit.dg/all-non-failing-tests.h index 4af704a..acfcc40 100644 --- a/gcc/testsuite/jit.dg/all-non-failing-tests.h +++ b/gcc/testsuite/jit.dg/all-non-failing-tests.h @@ -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}, diff --git a/gcc/testsuite/jit.dg/test-autovectorize.c b/gcc/testsuite/jit.dg/test-autovectorize.c new file mode 100644 index 0000000..9cfd0b2 --- /dev/null +++ b/gcc/testsuite/jit.dg/test-autovectorize.c @@ -0,0 +1,375 @@ +#include +#include "harness.h" + +void +create_code (gcc_jit_context *ctxt, void * user_data) +{ + gcc_jit_type *type_void = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_VOID); + gcc_jit_type *type_int = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_INT); + gcc_jit_type *type_unsigned_char = gcc_jit_context_get_type (ctxt, GCC_JIT_TYPE_UNSIGNED_CHAR); + gcc_jit_type *type_void_ptr = + gcc_jit_type_get_pointer (type_void); + gcc_jit_type *type_void_ptr_ptr = + gcc_jit_type_get_pointer (type_void_ptr); + gcc_jit_type *type_unsigned_char__ = + gcc_jit_type_get_pointer (type_unsigned_char); + gcc_jit_field *field_x = + gcc_jit_context_new_field (ctxt, + NULL, /* gcc_jit_location *loc */ + type_int, /* gcc_jit_type *type, */ + "x"); /* const char *name */ + gcc_jit_field *field_y = + gcc_jit_context_new_field (ctxt, + NULL, /* gcc_jit_location *loc */ + type_int, /* gcc_jit_type *type, */ + "y"); /* const char *name */ + gcc_jit_struct *struct_struct_ip_coord = + gcc_jit_context_new_opaque_struct (ctxt, + NULL, /* gcc_jit_location *loc */ + "ip_coord"); /* const char *name */ + gcc_jit_field *fields_fields_0x18dc9d0[2] = { + field_x, + field_y, + }; + gcc_jit_struct_set_fields (struct_struct_ip_coord, /* gcc_jit_struct *struct_type */ + NULL, /* gcc_jit_location *loc */ + 2, /* int num_fields */ + fields_fields_0x18dc9d0); /* gcc_jit_field **fields */ + gcc_jit_field *field_size = + gcc_jit_context_new_field (ctxt, + NULL, /* gcc_jit_location *loc */ + gcc_jit_struct_as_type (struct_struct_ip_coord), /* gcc_jit_type *type, */ + "size"); /* const char *name */ + gcc_jit_field *field_imrow = + gcc_jit_context_new_field (ctxt, + NULL, /* gcc_jit_location *loc */ + type_void_ptr_ptr, /* gcc_jit_type *type, */ + "imrow"); /* const char *name */ + gcc_jit_struct *struct_struct_ip_image = + gcc_jit_context_new_opaque_struct (ctxt, + NULL, /* gcc_jit_location *loc */ + "ip_image"); /* const char *name */ + gcc_jit_field *fields_fields_0x18dd310[] = { + field_size, + field_imrow + }; + gcc_jit_struct_set_fields (struct_struct_ip_image, /* gcc_jit_struct *struct_type */ + NULL, /* gcc_jit_location *loc */ + 2, /* int num_fields */ + fields_fields_0x18dd310); /* gcc_jit_field **fields */ + gcc_jit_type *type_struct_ip_image__ = + gcc_jit_type_get_pointer (gcc_jit_struct_as_type (struct_struct_ip_image)); + gcc_jit_param *param_dest = + gcc_jit_context_new_param (ctxt, + NULL, /* gcc_jit_location *loc */ + type_struct_ip_image__, /*gcc_jit_type *type */ + "dest"); /* const char *name */ + gcc_jit_param *param_src = + gcc_jit_context_new_param (ctxt, + NULL, /* gcc_jit_location *loc */ + type_struct_ip_image__, /*gcc_jit_type *type */ + "src"); /* const char *name */ + gcc_jit_param *params_for_func_ip_jit_im_add_clip_UBYTE[2] = { + param_dest, + param_src, + }; + gcc_jit_function *func_ip_jit_im_add_clip_UBYTE = + gcc_jit_context_new_function (ctxt, /* gcc_jit_context *ctxt */ + NULL, /* gcc_jit_location *loc */ + GCC_JIT_FUNCTION_EXPORTED, /* enum gcc_jit_function_kind kind */ + type_void, /* gcc_jit_type *return_type */ + "ip_jit_im_add_clip_UBYTE", /* const char *name */ + 2, /* int num_params */ + params_for_func_ip_jit_im_add_clip_UBYTE, /* gcc_jit_param **params */ + 0); /* int is_variadic */ + gcc_jit_lvalue *local_rowlen = + gcc_jit_function_new_local (func_ip_jit_im_add_clip_UBYTE, /* gcc_jit_function *func */ + NULL, /* gcc_jit_location *loc */ + type_int, /* gcc_jit_type *type */ + "rowlen"); /* const char *name */ + gcc_jit_lvalue *local_numrows = + gcc_jit_function_new_local (func_ip_jit_im_add_clip_UBYTE, /* gcc_jit_function *func */ + NULL, /* gcc_jit_location *loc */ + type_int, /* gcc_jit_type *type */ + "numrows"); /* const char *name */ + gcc_jit_lvalue *local_j = + gcc_jit_function_new_local (func_ip_jit_im_add_clip_UBYTE, /* gcc_jit_function *func */ + NULL, /* gcc_jit_location *loc */ + type_int, /* gcc_jit_type *type */ + "j"); /* const char *name */ + gcc_jit_lvalue *local_dptr = + gcc_jit_function_new_local (func_ip_jit_im_add_clip_UBYTE, /* gcc_jit_function *func */ + NULL, /* gcc_jit_location *loc */ + type_unsigned_char__, /* gcc_jit_type *type */ + "dptr"); /* const char *name */ + gcc_jit_lvalue *local_sptr = + gcc_jit_function_new_local (func_ip_jit_im_add_clip_UBYTE, /* gcc_jit_function *func */ + NULL, /* gcc_jit_location *loc */ + type_unsigned_char__, /* gcc_jit_type *type */ + "sptr"); /* const char *name */ + gcc_jit_lvalue *local_i = + gcc_jit_function_new_local (func_ip_jit_im_add_clip_UBYTE, /* gcc_jit_function *func */ + NULL, /* gcc_jit_location *loc */ + type_int, /* gcc_jit_type *type */ + "i"); /* const char *name */ + gcc_jit_block *block_F1 = + gcc_jit_function_new_block (func_ip_jit_im_add_clip_UBYTE, "F1"); + gcc_jit_block *block_C1 = + gcc_jit_function_new_block (func_ip_jit_im_add_clip_UBYTE, "C1"); + gcc_jit_block *block_L1 = + gcc_jit_function_new_block (func_ip_jit_im_add_clip_UBYTE, "L1"); + gcc_jit_block *block_C2 = + gcc_jit_function_new_block (func_ip_jit_im_add_clip_UBYTE, "C2"); + gcc_jit_block *block_L2 = + gcc_jit_function_new_block (func_ip_jit_im_add_clip_UBYTE, "L2"); + gcc_jit_block *block_A2 = + gcc_jit_function_new_block (func_ip_jit_im_add_clip_UBYTE, "A2"); + gcc_jit_block *block_A1 = + gcc_jit_function_new_block (func_ip_jit_im_add_clip_UBYTE, "A1"); + gcc_jit_lvalue *lvalue_dest__size= + gcc_jit_rvalue_dereference_field (gcc_jit_param_as_rvalue (param_dest), /* gcc_jit_rvalue *ptr */ + NULL, /* gcc_jit_location *loc */ + field_size); /* gcc_jit_field *field */ + gcc_jit_rvalue *rvalue_dest__size_x = + gcc_jit_rvalue_access_field (gcc_jit_lvalue_as_rvalue (lvalue_dest__size), /*gcc_jit_rvalue *struct_or_union */ + NULL, /*gcc_jit_location *loc */ + field_x); + gcc_jit_block_add_assignment (block_F1, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_rowlen, /* gcc_jit_lvalue *lvalue */ + rvalue_dest__size_x); /* gcc_jit_rvalue *rvalue */ + gcc_jit_rvalue *rvalue_dest__size_y = + gcc_jit_rvalue_access_field (gcc_jit_lvalue_as_rvalue (lvalue_dest__size), /*gcc_jit_rvalue *struct_or_union */ + NULL, /*gcc_jit_location *loc */ + field_y); + gcc_jit_block_add_assignment (block_F1, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_numrows, /* gcc_jit_lvalue *lvalue */ + rvalue_dest__size_y); /* gcc_jit_rvalue *rvalue */ + gcc_jit_rvalue *rvalue__int_0 = + gcc_jit_context_new_rvalue_from_int (ctxt, /* gcc_jit_context *ctxt */ + type_int, /* gcc_jit_type *numeric_type */ + 0); /* int value */ + gcc_jit_block_add_assignment (block_F1, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_j, /* gcc_jit_lvalue *lvalue */ + rvalue__int_0); /* gcc_jit_rvalue *rvalue */ + gcc_jit_block_end_with_jump (block_F1, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + block_C1); /* gcc_jit_block *target */ + gcc_jit_rvalue *rvalue_j___numrows = + gcc_jit_context_new_comparison (ctxt, + NULL, /* gcc_jit_location *loc */ + GCC_JIT_COMPARISON_LT, /* enum gcc_jit_comparison op */ + gcc_jit_lvalue_as_rvalue (local_j), /* gcc_jit_rvalue *a */ + gcc_jit_lvalue_as_rvalue (local_numrows)); /* gcc_jit_rvalue *b */ + gcc_jit_block_end_with_conditional (block_C1, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + rvalue_j___numrows, /* gcc_jit_rvalue *boolval */ + block_L1, /* gcc_jit_block *on_true */ + block_A1); /* gcc_jit_block *on_false */ + gcc_jit_lvalue *lvalue_dest__imrow= + gcc_jit_rvalue_dereference_field (gcc_jit_param_as_rvalue (param_dest), /* gcc_jit_rvalue *ptr */ + NULL, /* gcc_jit_location *loc */ + field_imrow); /* gcc_jit_field *field */ + gcc_jit_lvalue *lvalue_dest__imrow_j_ = + gcc_jit_context_new_array_access (ctxt, /* gcc_jit_context *ctxt */ + NULL, /*gcc_jit_location *loc */ + gcc_jit_lvalue_as_rvalue (lvalue_dest__imrow), /* gcc_jit_rvalue *ptr */ + gcc_jit_lvalue_as_rvalue (local_j)); /* gcc_jit_rvalue *index */ + gcc_jit_rvalue *rvalue__unsigned_char___dest__imrow_j_ = + gcc_jit_context_new_cast (ctxt, + NULL, /* gcc_jit_location *loc */ + gcc_jit_lvalue_as_rvalue (lvalue_dest__imrow_j_), /* gcc_jit_rvalue *rvalue */ + type_unsigned_char__); /* gcc_jit_type *type */ + gcc_jit_block_add_assignment (block_L1, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_dptr, /* gcc_jit_lvalue *lvalue */ + rvalue__unsigned_char___dest__imrow_j_); /* gcc_jit_rvalue *rvalue */ + gcc_jit_lvalue *lvalue_src__imrow= + gcc_jit_rvalue_dereference_field (gcc_jit_param_as_rvalue (param_src), /* gcc_jit_rvalue *ptr */ + NULL, /* gcc_jit_location *loc */ + field_imrow); /* gcc_jit_field *field */ + gcc_jit_lvalue *lvalue_src__imrow_j_ = + gcc_jit_context_new_array_access (ctxt, /* gcc_jit_context *ctxt */ + NULL, /*gcc_jit_location *loc */ + gcc_jit_lvalue_as_rvalue (lvalue_src__imrow), /* gcc_jit_rvalue *ptr */ + gcc_jit_lvalue_as_rvalue (local_j)); /* gcc_jit_rvalue *index */ + gcc_jit_rvalue *rvalue__unsigned_char___src__imrow_j_ = + gcc_jit_context_new_cast (ctxt, + NULL, /* gcc_jit_location *loc */ + gcc_jit_lvalue_as_rvalue (lvalue_src__imrow_j_), /* gcc_jit_rvalue *rvalue */ + type_unsigned_char__); /* gcc_jit_type *type */ + gcc_jit_block_add_assignment (block_L1, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_sptr, /* gcc_jit_lvalue *lvalue */ + rvalue__unsigned_char___src__imrow_j_); /* gcc_jit_rvalue *rvalue */ + gcc_jit_rvalue *rvalue__int_0_0x18dd890 = + gcc_jit_context_new_rvalue_from_int (ctxt, /* gcc_jit_context *ctxt */ + type_int, /* gcc_jit_type *numeric_type */ + 0); /* int value */ + gcc_jit_block_add_assignment (block_L1, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_i, /* gcc_jit_lvalue *lvalue */ + rvalue__int_0_0x18dd890); /* gcc_jit_rvalue *rvalue */ + gcc_jit_block_end_with_jump (block_L1, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + block_C2); /* gcc_jit_block *target */ + gcc_jit_rvalue *rvalue_i___rowlen = + gcc_jit_context_new_comparison (ctxt, + NULL, /* gcc_jit_location *loc */ + GCC_JIT_COMPARISON_LT, /* enum gcc_jit_comparison op */ + gcc_jit_lvalue_as_rvalue (local_i), /* gcc_jit_rvalue *a */ + gcc_jit_lvalue_as_rvalue (local_rowlen)); /* gcc_jit_rvalue *b */ + gcc_jit_block_end_with_conditional (block_C2, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + rvalue_i___rowlen, /* gcc_jit_rvalue *boolval */ + block_L2, /* gcc_jit_block *on_true */ + block_A2); /* gcc_jit_block *on_false */ + gcc_jit_lvalue *dereference__dptr = + gcc_jit_rvalue_dereference (gcc_jit_lvalue_as_rvalue (local_dptr), /* gcc_jit_rvalue *rvalue */ + NULL); /* gcc_jit_location *loc */ + gcc_jit_lvalue *dereference__sptr = + gcc_jit_rvalue_dereference (gcc_jit_lvalue_as_rvalue (local_sptr), /* gcc_jit_rvalue *rvalue */ + NULL); /* gcc_jit_location *loc */ + gcc_jit_block *block_p_C1_true = + gcc_jit_function_new_block (func_ip_jit_im_add_clip_UBYTE, "p_C1_true"); + gcc_jit_block *block_p_C1_end = + gcc_jit_function_new_block (func_ip_jit_im_add_clip_UBYTE, "p_C1_end"); + gcc_jit_lvalue *local_ival = + gcc_jit_function_new_local (func_ip_jit_im_add_clip_UBYTE, /* gcc_jit_function *func */ + NULL, /* gcc_jit_location *loc */ + type_int, /* gcc_jit_type *type */ + "ival"); /* const char *name */ + gcc_jit_rvalue *rvalue__int__dptr = + gcc_jit_context_new_cast (ctxt, + NULL, /* gcc_jit_location *loc */ + gcc_jit_lvalue_as_rvalue (dereference__dptr), /* gcc_jit_rvalue *rvalue */ + type_int); /* gcc_jit_type *type */ + gcc_jit_rvalue *rvalue__int__sptr = + gcc_jit_context_new_cast (ctxt, + NULL, /* gcc_jit_location *loc */ + gcc_jit_lvalue_as_rvalue (dereference__sptr), /* gcc_jit_rvalue *rvalue */ + type_int); /* gcc_jit_type *type */ + gcc_jit_rvalue *rvalue__int__dptr____int__sptr = + gcc_jit_context_new_binary_op (ctxt, + NULL, /* gcc_jit_location *loc */ + GCC_JIT_BINARY_OP_PLUS, /* enum gcc_jit_binary_op op */ + type_int, /* gcc_jit_type *result_type */ + rvalue__int__dptr, /* gcc_jit_rvalue *a */ + rvalue__int__sptr); /* gcc_jit_rvalue *b */ + gcc_jit_block_add_assignment (block_L2, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_ival, /* gcc_jit_lvalue *lvalue */ + rvalue__int__dptr____int__sptr); /* gcc_jit_rvalue *rvalue */ + gcc_jit_rvalue *rvalue__int_255 = + gcc_jit_context_new_rvalue_from_int (ctxt, /* gcc_jit_context *ctxt */ + type_int, /* gcc_jit_type *numeric_type */ + 255); /* int value */ + gcc_jit_rvalue *rvalue_ival____int_255 = + gcc_jit_context_new_comparison (ctxt, + NULL, /* gcc_jit_location *loc */ + GCC_JIT_COMPARISON_GT, /* enum gcc_jit_comparison op */ + gcc_jit_lvalue_as_rvalue (local_ival), /* gcc_jit_rvalue *a */ + rvalue__int_255); /* gcc_jit_rvalue *b */ + gcc_jit_block_end_with_conditional (block_L2, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + rvalue_ival____int_255, /* gcc_jit_rvalue *boolval */ + block_p_C1_true, /* gcc_jit_block *on_true */ + block_p_C1_end); /* gcc_jit_block *on_false */ + gcc_jit_block_add_assignment (block_p_C1_true, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_ival, /* gcc_jit_lvalue *lvalue */ + rvalue__int_255); /* gcc_jit_rvalue *rvalue */ + gcc_jit_block_end_with_jump (block_p_C1_true, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + block_p_C1_end); /* gcc_jit_block *target */ + gcc_jit_rvalue *rvalue__unsigned_char_ival = + gcc_jit_context_new_cast (ctxt, + NULL, /* gcc_jit_location *loc */ + gcc_jit_lvalue_as_rvalue (local_ival), /* gcc_jit_rvalue *rvalue */ + type_unsigned_char); /* gcc_jit_type *type */ + gcc_jit_lvalue *dereference__dptr_0x18df2e0 = + gcc_jit_rvalue_dereference (gcc_jit_lvalue_as_rvalue (local_dptr), /* gcc_jit_rvalue *rvalue */ + NULL); /* gcc_jit_location *loc */ + gcc_jit_block_add_assignment (block_p_C1_end, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + dereference__dptr_0x18df2e0, /* gcc_jit_lvalue *lvalue */ + rvalue__unsigned_char_ival); /* gcc_jit_rvalue *rvalue */ + gcc_jit_rvalue *rvalue__int_1 = + gcc_jit_context_new_rvalue_from_int (ctxt, /* gcc_jit_context *ctxt */ + type_int, /* gcc_jit_type *numeric_type */ + 1); /* int value */ + gcc_jit_lvalue *lvalue_dptr__int_1_ = + gcc_jit_context_new_array_access (ctxt, /* gcc_jit_context *ctxt */ + NULL, /*gcc_jit_location *loc */ + gcc_jit_lvalue_as_rvalue (local_dptr), /* gcc_jit_rvalue *ptr */ + rvalue__int_1); /* gcc_jit_rvalue *index */ + gcc_jit_rvalue *address_of__dptr__int_1_ = + gcc_jit_lvalue_get_address (lvalue_dptr__int_1_, /* gcc_jit_lvalue *lvalue */ + NULL); /* gcc_jit_location *loc */ + gcc_jit_block_add_assignment (block_p_C1_end, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_dptr, /* gcc_jit_lvalue *lvalue */ + address_of__dptr__int_1_); /* gcc_jit_rvalue *rvalue */ + gcc_jit_rvalue *rvalue__int_1_0x18df500 = + gcc_jit_context_new_rvalue_from_int (ctxt, /* gcc_jit_context *ctxt */ + type_int, /* gcc_jit_type *numeric_type */ + 1); /* int value */ + gcc_jit_lvalue *lvalue_sptr__int_1_ = + gcc_jit_context_new_array_access (ctxt, /* gcc_jit_context *ctxt */ + NULL, /*gcc_jit_location *loc */ + gcc_jit_lvalue_as_rvalue (local_sptr), /* gcc_jit_rvalue *ptr */ + rvalue__int_1_0x18df500); /* gcc_jit_rvalue *index */ + gcc_jit_rvalue *address_of__sptr__int_1_ = + gcc_jit_lvalue_get_address (lvalue_sptr__int_1_, /* gcc_jit_lvalue *lvalue */ + NULL); /* gcc_jit_location *loc */ + gcc_jit_block_add_assignment (block_p_C1_end, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_sptr, /* gcc_jit_lvalue *lvalue */ + address_of__sptr__int_1_); /* gcc_jit_rvalue *rvalue */ + gcc_jit_rvalue *rvalue__int_1_0x18df650 = + gcc_jit_context_new_rvalue_from_int (ctxt, /* gcc_jit_context *ctxt */ + type_int, /* gcc_jit_type *numeric_type */ + 1); /* int value */ + gcc_jit_rvalue *rvalue_i____int_1 = + gcc_jit_context_new_binary_op (ctxt, + NULL, /* gcc_jit_location *loc */ + GCC_JIT_BINARY_OP_PLUS, /* enum gcc_jit_binary_op op */ + type_int, /* gcc_jit_type *result_type */ + gcc_jit_lvalue_as_rvalue (local_i), /* gcc_jit_rvalue *a */ + rvalue__int_1_0x18df650); /* gcc_jit_rvalue *b */ + gcc_jit_block_add_assignment (block_p_C1_end, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_i, /* gcc_jit_lvalue *lvalue */ + rvalue_i____int_1); /* gcc_jit_rvalue *rvalue */ + gcc_jit_block_end_with_jump (block_p_C1_end, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + block_C2); /* gcc_jit_block *target */ + gcc_jit_rvalue *rvalue__int_1_0x18df7e0 = + gcc_jit_context_new_rvalue_from_int (ctxt, /* gcc_jit_context *ctxt */ + type_int, /* gcc_jit_type *numeric_type */ + 1); /* int value */ + gcc_jit_rvalue *rvalue_j____int_1 = + gcc_jit_context_new_binary_op (ctxt, + NULL, /* gcc_jit_location *loc */ + GCC_JIT_BINARY_OP_PLUS, /* enum gcc_jit_binary_op op */ + type_int, /* gcc_jit_type *result_type */ + gcc_jit_lvalue_as_rvalue (local_j), /* gcc_jit_rvalue *a */ + rvalue__int_1_0x18df7e0); /* gcc_jit_rvalue *b */ + gcc_jit_block_add_assignment (block_A2, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + local_j, /* gcc_jit_lvalue *lvalue */ + rvalue_j____int_1); /* gcc_jit_rvalue *rvalue */ + gcc_jit_block_end_with_jump (block_A2, /*gcc_jit_block *block */ + NULL, /* gcc_jit_location *loc */ + block_C1); /* gcc_jit_block *target */ + gcc_jit_block_end_with_void_return (block_A1, /*gcc_jit_block *block */ + NULL); /* gcc_jit_location *loc */ +} + +void +verify_code (gcc_jit_context *ctxt, gcc_jit_result *result) +{ + /* empty */ +} -- 1.8.5.3