leaningtech-dev team mailing list archive
-
leaningtech-dev team
-
Mailing list archive
-
Message #00118
[Bug 1302695] Re: range based for produces JS syntax error with -O2
Should be fixed by https://github.com/leaningtech/duetto-
llvm/commit/c5ffef9d30acbaedd47f38a34b4e7f27fc3a1c56
** Changed in: duetto
Status: New => Fix Committed
--
You received this bug notification because you are a member of
Leaningtech Team, which is subscribed to Duetto.
https://bugs.launchpad.net/bugs/1302695
Title:
range based for produces JS syntax error with -O2
Status in Duetto: C++ for the Web:
Fix Committed
Bug description:
As per summary.
I don't know the exact cause of this bug, It seems to happen only with -O2 (atl east not with -O0)
Testcase attached.
This is the relevant LLVM code output:
%struct._ZSt5arrayIiLj2EE = type { [2 x i32] }
@arr = global %struct._ZSt5arrayIiLj2EE { [2 x i32] [i32 1, i32 2] },
align 1
; Function Attrs: nounwind
define i32 @main() #0 {
br i1 icmp eq (i32* getelementptr inbounds (%struct._ZSt5arrayIiLj2EE* @arr, i32 0, i32 0, i32 0), i32* getelementptr (%struct._ZSt5arrayIiLj2EE* @arr, i32 0, i32 0, i32 2)), label %._crit_edge, label %.lr.ph
;...
The branch gets translated to
if () {
which is a JS syntax error.
To manage notifications about this bug go to:
https://bugs.launchpad.net/duetto/+bug/1302695/+subscriptions
References