JDK-7171223 : Building ExtensionSubtables.cpp should use -fno-strict-aliasing
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-05-23
  • Updated: 2012-06-12
  • Resolved: 2012-06-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u6Fixed 8 b43Fixed
Description
At present, the building of ExtensionSubtables.cpp produces a warning:

../../../src/share/native/sun/font/layout/ExtensionSubtables.cpp:57:31:
warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

due to this code:

// read a 32-bit value that might only be 16-bit-aligned in memory                                                              
#define READ_LONG(code) (le_uint32)((SWAPW(*(le_uint16*)&code) << 16) + SWAPW(*(((le_uint16*)&code) + 1)))

where code is a le_uint32.

This can be avoided by setting -fno-strict-aliasing, as done in this webrev:

Comments
EVALUATION Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7171223 Changeset: http://hg.openjdk.java.net/jdk8/2d/jdk/rev/c892ca15ca52 Review thread: http://mail.openjdk.java.net/pipermail/2d-dev/2012-May/002517.html
12-06-2012