[Webkit-unassigned] [Bug 94779] To reduce cost of converting type during modulo for integers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 18 00:49:31 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=94779





--- Comment #21 from hojong.han at samsung.com  2012-09-18 00:50:00 PST ---
(In reply to comment #20)
> (In reply to comment #19)
> > (In reply to comment #18)
> > > (In reply to comment #17)
> > > > (In reply to comment #16)
> > > > I prefer a browser that doesn't crash over a browser that computes prime numbers quickly.
> > > 
> > > I totally agree with your thought. I'm appreciated for your comment.
> > 
> > I figured out why the crash didn't occur on my device. That's because of the compile optimization level.
> 
> I'm curious about this.  Can you share more details?
> 
> For me, here's what I see:
> 
> If I make it obvious to my compiler (clang+llvm) what the constants are in the modulo operation, like so:

Now I'm using gcc.

> 
> int a = -2147483647 - 1;
> int b = -1;
> return a % b; // a and b are known constants
> 
> Then I only crash when optimizations are disabled.  With optimizations, I do get a garbage result, however.
> 

It's same as yours without optimizations but with optimizations I can get the right result, zero.

> But if I make it non-obvious, such as in my test program that I attached, by virtue of the fact that the integers a and b are parsed from the command-line, then I do crash on (-2^31)%-1, regardless of optimization level.
> 

non-obvious case is same as yours. 

> Is there something different that is happening for you?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list