From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97382 invoked by alias); 7 Jul 2015 00:41:34 -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 97369 invoked by uid 89); 7 Jul 2015 00:41:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.98.7 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Message-ID: <1436229223.24803.51.camel@surprise> Subject: PR jit/66783 (Re: A possible code generation issue) From: David Malcolm To: Dibyendu Majumdar Cc: jit@gcc.gnu.org Date: Thu, 01 Jan 2015 00:00:00 -0000 In-Reply-To: References: <1436046085.24803.35.camel@surprise> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-SW-Source: 2015-q3/txt/msg00023.txt.bz2 On Mon, 2015-07-06 at 22:40 +0100, Dibyendu Majumdar wrote: > On 6 July 2015 at 22:29, Dibyendu Majumdar wrote: > > BTW the dump of types is problematic in many ways: > > 1) types are in wrong order > > 2) function types are incorrectly output > > 3) array types are incorrectly output > > 4) in one case as least a pointer was missing. > > Apologies the last point (4) was actually due to a bug in my code - > but here is what happened. > > t->lua_longjumpT = gcc_jit_context_new_opaque_struct(ravi->context, NULL, > "ravi_lua_longjmp"); > t->plua_longjumpT = gcc_jit_struct_as_type(t->lua_longjumpT); > > The plua_longjmpT was meant to be a pointer to the struct. > > Surprisingly I was able to use the incomplete type in another struct! Ouch. Good catch; thanks. I've filed this specific issue as: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66783 and added it to the tracker bug (PR jit/66627). > I think this just goes to show that you need to have some form of > run-time type assertion to detect such issues. I have a fix for this and the segfault (PR jit/66779) in the works; I anticipate committing them to trunk tomorrow. I hope to review the other issues you've raised tomorrow (sorry for not getting to them today). Dave