Status: New
Owner: ----

New issue 383 by avassalotti: Clarify precedence of operations involving &  
(BITWISE AND) in assembler/x64
http://code.google.com/p/v8/issues/detail?id=383

GCC 4.3.3 founds three bugs in the x64 assembler code where the author
wrongly assumed the & (BITWISE AND) operator has higher precedence than ==,
!= or | (BITWISE OR).

I have a patch; but, I don't know whether the changes are correct. However,
I do know that the shell sample crashes [see gdb backtrace below].

BTW, is there a way to run the test suite without rebuilding against
libc-32? I tried running "tools/test.py --arch=x64
cctest/test-assembler-x64" but it still want to use the 32-bits libraries.
In addition, all the build flags are duplicated. Anyway, that probably
should be discussed in another bug report.

[gdb backtrace]

a...@helios:v8-edge$ gdb ./shell_g
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later  
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(gdb) r
Starting program: /home/alex/src/googlecode.com/v8-edge/shell_g
[Thread debugging using libthread_db enabled]


#
# Fatal error in src/objects-inl.h, line 1395
# CHECK(object->IsJSObject()) failed
#

[New Thread 0x7f4dc1c21700 (LWP 12257)]

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7f4dc1c21700 (LWP 12257)]
0x00007f4dc0d12fb5 in raise () from /lib/libc.so.6
(gdb) bt
#0  0x00007f4dc0d12fb5 in raise () from /lib/libc.so.6
#1  0x00007f4dc0d14bc3 in abort () from /lib/libc.so.6
#2  0x000000000049d325 in v8::internal::OS::Abort ()
     at src/platform-linux.cc:177
#3  0x0000000000424241 in V8_Fatal (file=0x54be1f "src/objects-inl.h",
     line=1395, format=0x54bbf6 "CHECK(%s) failed") at src/checks.cc:56
#4  0x000000000040465d in CheckHelper (file=0x54be1f "src/objects-inl.h",
     line=1395, source=0x54beb8 "object->IsJSObject()", condition=false)
     at src/checks.h:62
#5  0x000000000041234e in v8::internal::JSObject::cast  
(object=0x7f4dc06700d9)
     at src/objects-inl.h:1395
#6  0x0000000000432bb8 in v8::internal::Context::function_cache (
     this=0x7f4dbf000ce9) at src/contexts.h:288
#7  0x0000000000431f9e in v8::internal::Execution::InstantiateFunction  
(data=
       {location_ = 0x1aa2c68}, exc=0x7fffc9c3798f) at src/execution.cc:492
#8  0x0000000000432144 in v8::internal::Execution::InstantiateObject (data=
       {location_ = 0x1aa2c38}, exc=0x7fffc9c3798f) at src/execution.cc:514
#9  0x0000000000418ed6 in v8::internal::Genesis::ConfigureApiObject (
     this=0x7fffc9c37b10, object={location_ = 0x1aa2c58}, object_template=
       {location_ = 0x1aa2c38}) at src/bootstrapper.cc:1363
#10 0x0000000000418ff0 in v8::internal::Genesis::ConfigureGlobalObjects (
     this=0x7fffc9c37b10, global_proxy_template={val_ = 0x1aa2c38})
     at src/bootstrapper.cc:1338
#11 0x000000000041ca97 in Genesis (this=0x7fffc9c37b10, global_object=
       {location_ = 0x0}, global_template={val_ = 0x1aa2c38}, extensions=0x0)
     at src/bootstrapper.cc:1575
#12 0x000000000041cb4c in v8::internal::Bootstrapper::CreateEnvironment (
     global_object={location_ = 0x0}, global_template={val_ = 0x1aa2c38},
     extensions=0x0) at src/bootstrapper.cc:352
#13 0x000000000040bc08 in v8::Context::New (extensions=0x0, global_template=
       {val_ = 0x1aa2bd0}, global_object={val_ = 0x0}) at src/api.cc:2557
#14 0x0000000000403b31 in RunMain (argc=1, argv=0x7fffc9c38008)
     at samples/shell.cc:66
#15 0x0000000000403e65 in main (argc=1, argv=0x7fffc9c38008)
     at samples/shell.cc:107


[test build error]
a...@helios:v8-edge$ tools/test.py --arch=x64 cctest/test-assembler-x64
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o obj/test/release/cctest.o -c -Wall -Werror -W -Wno-unused-parameter
-pedantic -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections
-ansi -m32 -m32 -fno-rtti -fno-exceptions -Wall -Werror -W
-Wno-unused-parameter -pedantic -O3 -fomit-frame-pointer -fdata-sections
-ffunction-sections -ansi -m32 -m32 -DV8_TARGET_ARCH_IA32
-DENABLE_LOGGING_AND_PROFILING -Isrc -Isrc test/cctest/cctest.cc
In file included from /usr/include/features.h:354,
                  from /usr/include/stdio.h:28,
                  from src/../include/v8.h:41,
                  from src/v8.h:60,
                  from test/cctest/cctest.cc:28:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or  
directory
scons: *** [obj/test/release/cctest.o] Error 1
scons: building terminated because of errors.


Attachments:
        add-parentheses-bitwise-and-ops.diff  1.3 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to