Bug 135906

Summary: [JSC] Build error on ARM64 with gcc: JSC::ARM64Assembler::RegisterID coerced into 5-bit bit field
Product: WebKit Reporter: Akos Kiss <akiss>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, msaboff, ossy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 108645    
Attachments:
Description Flags
Proposed patch. none

Description Akos Kiss 2014-08-13 14:57:20 PDT
When compilig JSC for arm64 with gcc, the following error is raised:

Source/JavaScriptCore/assembler/ARM64Assembler.h:629:48: error: 'JSC::ARM64Assembler::LinkRecord::<anonymous union>::RealTypes::m_compareRegister' is too small to hold all values of 'JSC::ARM64Assembler::RegisterID {aka enum JSC::ARM64Registers::RegisterID}' [-Werror]
                 RegisterID m_compareRegister : 5;

This is because zr = 0x3f in RegisterID, so at least 6 bits are needed, but we only have 5.

CopyTypes, sharing an enum with RealTypes, is 3 x 64 bits, so increasing the size of the RealTypes::m_compareRegister bit field seems to be a valid solution.
Comment 1 Akos Kiss 2014-08-13 15:06:41 PDT
Created attachment 236554 [details]
Proposed patch.
Comment 2 WebKit Commit Bot 2014-08-13 15:07:36 PDT
Attachment 236554 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/assembler/ARM64Assembler.h:628:  Please declare enum bitfields as unsigned integral types.  [runtime/enum_bitfields] [5]
ERROR: Source/JavaScriptCore/assembler/ARM64Assembler.h:629:  Please declare enum bitfields as unsigned integral types.  [runtime/enum_bitfields] [5]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Michael Saboff 2014-08-13 22:31:21 PDT
Comment on attachment 236554 [details]
Proposed patch.

r=me
Comment 4 WebKit Commit Bot 2014-08-14 01:50:01 PDT
Comment on attachment 236554 [details]
Proposed patch.

Clearing flags on attachment: 236554

Committed r172578: <http://trac.webkit.org/changeset/172578>
Comment 5 WebKit Commit Bot 2014-08-14 01:50:04 PDT
All reviewed patches have been landed.  Closing bug.