From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25467 invoked by alias); 14 Jun 2015 20:00:29 -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 25434 invoked by uid 89); 14 Jun 2015 20:00:24 -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=-0.6 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-Spam-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW 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: mail-yk0-f182.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=Z+a7mRiCHxsS5C5LHNcF1yQO+N+I55iY8CANi0cr1eQ=; b=e3AXAhy1CMpetOzGEjV2P6Hj3qlm9BXC+pn8yp61NqoC1IMKrnHB6ehAebujaNSE8k P4pSaX3iXN6Fi17C+luv1YFl14mtaw4LbSO2rKMw98Z0cNadL30ANABqlnZ9ff7PwNvA chFhTy1gGQ/IUg6jbd4eRHWNoGvZHluWrVzhYRg9lmvQAIMWNKhJq9wvXyaFvrRND3Ul 7BYIdop4C/PYsZ2ZG0c/QfRgwwvryJmpyTGq2vil64VdjHb5v9+Stlrykzad+1atfy6H XcJXkf0Rgo6mcfJmKNCckVKQ79Pj6zeoLhqnrExdj0HtK5So5gA9MVNB3XwUrYV0TuFB F/FQ== X-Gm-Message-State: ALoCoQnsCKu7fPUyB/6iFHi/BOz9Fx6VXM7OF9WAyM7Y4h2KmDLJ3pdqfyWnyTbHo0JgQo7Xf2aw MIME-Version: 1.0 X-Received: by 10.129.39.21 with SMTP id n21mr15008202ywn.55.1434312021969; Sun, 14 Jun 2015 13:00:21 -0700 (PDT) Date: Thu, 01 Jan 2015 00:00:00 -0000 Message-ID: Subject: Hit a showstopper issue From: Dibyendu Majumdar To: jit@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-q2/txt/msg00057.txt.bz2 I have hit an issue that is a show stopper for me. In Lua, redundant bytecodes are emitted that end up being unreachable blocks in the generated code. In LLVM these unreachable blocks are simply eliminated during optimization. But libgccjit is failing with an error. Here is a minimal Lua function. x=function() return; end The generated Lua bytecode is this: function (2 instructions at 0xad4840) 0 params, 2 slots, 0 upvalues, 0 locals, 0 constants, 0 functions 1 [1] RETURN 0 1 2 [1] RETURN 0 1 constants (0) for 0xad4840: locals (0) for 0xad4840: upvalues (0) for 0xad4840: As you can see there is a redundant RETURN bytecode. The code I generate is this: static int ravif1 (struct ravi_lua_State * L) { struct ravi_TValue * base; entry: base = L->ci->u.l.base; base = L->ci->u.l.base; L->top = &base[(int)0]; if ((struct ravi_LClosure *)L->ci->func->p->sizep > (int)0) goto ; else goto ; : (void)luaF_close (L, base); goto ; : (void)luaD_poscall (L, &base[(int)0]); return (int)1; : base = L->ci->u.l.base; L->top = &base[(int)0]; if ((struct ravi_LClosure *)L->ci->func->p->sizep > (int)0) goto ; else goto ; : (void)luaF_close (L, base); goto ; : (void)luaD_poscall (L, &base[(int)0]); return (int)1; } When this is compiled the following errors occur: libgccjit.so: error: unreachable block: libgccjit.so: error: unreachable block: libgccjit.so: error: unreachable block: