Bug 40410 - Avoid increasing required alignment of target type warning on ARM
Summary: Avoid increasing required alignment of target type warning on ARM
Status: RESOLVED DUPLICATE of bug 38045
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P3 Minor
Assignee: Gabor Loki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-10 02:17 PDT by Gabor Loki
Modified: 2010-07-15 05:58 PDT (History)
0 users

See Also:


Attachments
Avoid increasing required alignment of target type warning on ARM (part 1) (2.83 KB, patch)
2010-06-10 02:45 PDT, Gabor Loki
no flags Details | Formatted Diff | Diff
Avoid increasing required alignment of target type warning on ARM (part 2) (2.74 KB, patch)
2010-06-10 03:53 PDT, Gabor Loki
no flags Details | Formatted Diff | Diff
Avoid increasing required alignment of target type warning on ARM (part 3) (7.66 KB, patch)
2010-06-10 04:31 PDT, Gabor Loki
no flags Details | Formatted Diff | Diff
Avoid increasing required alignment of target type warning on ARM (part 4) (2.04 KB, patch)
2010-06-10 05:11 PDT, Gabor Loki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Loki 2010-06-10 02:17:41 PDT
The reinterpret_cast<Type1*>([pointer to Type2]) expressions - where sizeof(Type1) > sizeof(Type2) - cause the following warning on ARM: increases required alignment of target type warnings. An extra static_cast<void*> cast can mute the compiler, eg.: reinterpret_cast<Type1*>(static_cast<void*>([pointer to Type2])).

I am going to upload several patches to fix these warnings.
Comment 1 Gabor Loki 2010-06-10 02:45:52 PDT
Created attachment 58346 [details]
Avoid increasing required alignment of target type warning on ARM (part 1)

Each MacroAssembler back-end knows well if a natural alignment is required or not. So, leave them to handle the alignment.

An extra ASSERT for alignment check can cause a false positive error on those architectures where an unaligned data access is available. For example on x86: ASSERT(!(static_cast<unsigned int>(&m_buffer[m_size]) % WTF_ALIGN_OF(int64_t))).
Comment 2 Gabor Loki 2010-06-10 03:53:39 PDT
Created attachment 58357 [details]
Avoid increasing required alignment of target type warning on ARM (part 2)

Fix the increasing required alignment of target type warnings in ARMAssembler.
Comment 3 Gabor Loki 2010-06-10 04:31:25 PDT
Created attachment 58362 [details]
Avoid increasing required alignment of target type warning on ARM (part 3)

All static_cast can be safely done. Each data is aligned to target type.
Comment 4 Gabor Loki 2010-06-10 05:11:53 PDT
Created attachment 58365 [details]
Avoid increasing required alignment of target type warning on ARM (part 4)

Qt specific fix for the alignment problem.
Comment 5 Gabor Loki 2010-07-15 05:58:20 PDT

*** This bug has been marked as a duplicate of bug 38045 ***