From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83004 invoked by alias); 8 Jul 2015 19:01:27 -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 82972 invoked by uid 89); 8 Jul 2015 19:01:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.98.7 on sourceware.org X-Virus-Found: No X-HELO: mail-yk0-f178.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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=yHbGCJUT/J3asAfmgvxAE72WZsEB4y20qtzZO7cybTo=; b=hWgGUq88GoH109F4UunadTevscU8dUM/QfVfig4EMUHDw+yEhB+bae6WHG9XlbEtHV yH0ZXxlxpw4lrIvdmCfTtmwLMF3oPST1cmkfasKZJmPR77H0uBM887iJ9JxYHfo67Qg2 gOrD+kAn0lyQVgAkbX0Xuf/hbXW5I0RUO+F9ZXxYkbVKQKjSY06fAjYeKcFazzql4TPI 4kHK+CN1ny66h++GV9n3hOUDW2uFv4ZvpR45F6dREZq30s0iRPOT/jhIptaMV6h+GylI oZAtXvCfNasZdfxe48kI+uH7R8WJMNUM2dSjC5mKl0JXfw1BEuqjqQ51imbclkAV9iB9 CHbQ== X-Gm-Message-State: ALoCoQmpN225JNaJAb0n/ADbXPKdqZt0FZ12VFVgFojPn3czfg1v+g0d045Di+0cA7+o659UBTP3 MIME-Version: 1.0 X-Received: by 10.13.212.199 with SMTP id w190mr13088543ywd.57.1436382081932; Wed, 08 Jul 2015 12:01:21 -0700 (PDT) In-Reply-To: <1436377619.24803.97.camel@surprise> References: <1436365266.24803.65.camel@surprise> <1436367926.24803.71.camel@surprise> <1436369443.24803.75.camel@surprise> <1436377619.24803.97.camel@surprise> Date: Thu, 01 Jan 2015 00:00:00 -0000 Message-ID: Subject: Re: Filed PR jit/66812 for the code generation issue From: Dibyendu Majumdar To: David Malcolm Cc: jit@gcc.gnu.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-q3/txt/msg00036.txt.bz2 On 8 July 2015 at 18:46, David Malcolm wrote: > Dibyendu: what Lua code generated the reproducer? What is the code > meant to be doing? > Hi Dave - the Lua test is this: function x() local IX if ((10 or true) and false) then IX = true end; return ((10 or true) and false) end assert(x() == false) In the original test IX is an upvalue - i.e. a variable in outer scope. This is my standalone version of the test. The original test is generated as part of the Lua test suite - its purpose is to test various permutations of boolean operators. The original test compares IX and the function return. The issue is that this test should return false - if you see the return statement. However when -O2 or -O3 is enabled it returns true. The if statement is indeed redundant in this cut down version as IX is a local variable. But the return statement is not redundant. Regards Dibyendu