Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Issue 14317008: PNaCl: Enable ExpandByVal pass for expanding out passing structs by value (Closed)

Created:
7 years, 8 months ago by Mark Seaborn
Modified:
7 years, 8 months ago
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

PNaCl: Enable ExpandByVal pass for expanding out passing structs by value We have to disable two calling conventions tests which test __attribute__((aligned)) structs. pnacl-clang does not align these properly when they are function arguments: it omits the LLVM "align" argument attribute, but since it generates aligned memory accesses, these become "movaps" on x86 and they fault. I think these tests were passing by luck before, because the stack location happened to be 16-byte-aligned. This change will require a change to the PNaCl PPAPI shims when the PNaCl toolchain is rolled into Chromium. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3400 BUG=https://code.google.com/p/nativeclient/issues/detail?id=3403 TEST=PNaCl toolchain trybots + GCC torture tests + LLVM test suite + Spec2k Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=11232

Patch Set 1 #

Patch Set 2 : Cleanup #

Patch Set 3 : Fix #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -2 lines) Patch
M pnacl/driver/pnacl-ld.py View 1 1 chunk +1 line, -0 lines 3 comments Download
M tests/callingconv_case_by_case/for_each_type.h View 1 2 2 chunks +12 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Mark Seaborn
7 years, 8 months ago (2013-04-24 18:59:13 UTC) #1
jvoung (off chromium)
https://codereview.chromium.org/14317008/diff/17001/pnacl/driver/pnacl-ld.py File pnacl/driver/pnacl-ld.py (right): https://codereview.chromium.org/14317008/diff/17001/pnacl/driver/pnacl-ld.py#newcode361 pnacl/driver/pnacl-ld.py:361: '-expand-byval', When you did the byval -> reference pass ...
7 years, 8 months ago (2013-04-24 19:59:12 UTC) #2
Mark Seaborn
https://codereview.chromium.org/14317008/diff/17001/pnacl/driver/pnacl-ld.py File pnacl/driver/pnacl-ld.py (right): https://codereview.chromium.org/14317008/diff/17001/pnacl/driver/pnacl-ld.py#newcode361 pnacl/driver/pnacl-ld.py:361: '-expand-byval', On 2013/04/24 19:59:12, jvoung (cr) wrote: > When ...
7 years, 8 months ago (2013-04-24 20:36:42 UTC) #3
Mark Seaborn
BTW, I tried disabling those tests by doing: #if !defined(__clang__) DO_FOR_TYPE(I32_CHAR_ALIGN32) #endif (so that they ...
7 years, 8 months ago (2013-04-24 20:44:07 UTC) #4
jvoung (off chromium)
lgtm https://codereview.chromium.org/14317008/diff/17001/pnacl/driver/pnacl-ld.py File pnacl/driver/pnacl-ld.py (right): https://codereview.chromium.org/14317008/diff/17001/pnacl/driver/pnacl-ld.py#newcode361 pnacl/driver/pnacl-ld.py:361: '-expand-byval', On 2013/04/24 20:36:42, Mark Seaborn wrote: > ...
7 years, 8 months ago (2013-04-24 21:43:09 UTC) #5
jvoung (off chromium)
On 2013/04/24 20:44:07, Mark Seaborn wrote: > BTW, I tried disabling those tests by doing: ...
7 years, 8 months ago (2013-04-24 21:46:57 UTC) #6
Mark Seaborn
Committed patchset #3 manually as r11232 (presubmit successful).
7 years, 8 months ago (2013-04-25 18:16:39 UTC) #7
Mark Seaborn
On 24 April 2013 14:43, <jvoung@chromium.org> wrote: > > I ask because the ArgumentPromotionPass (which ...
7 years, 8 months ago (2013-04-25 18:39:51 UTC) #8
Mark Seaborn
7 years, 8 months ago (2013-04-25 18:41:05 UTC) #9
On 24 April 2013 14:46, <jvoung@chromium.org> wrote:

> On 2013/04/24 20:44:07, Mark Seaborn wrote:
>
>> BTW, I tried disabling those tests by doing:
>>
>
>  #if !defined(__clang__)
>> DO_FOR_TYPE(I32_CHAR_ALIGN32)
>> #endif
>>
>
>  (so that they would still run with gcc)
>>
>
>  But "./scons run_call_structs_test platform=arm" gave the error:
>>
>>
>>
scons-out/nacl-arm-pnacl-clang/obj/tests/callingconv_case_by_case/call_structs.2.o:
>>
> error: undefined reference to 'mod3_I32_CHAR_ALIGN32(I32_**CHAR_ALIGN32)'
>>
>
>  I can't explain that failure, but debugging it didn't seem very
>> worthwhile, so I
>>
> disabled the two tests unconditionally.
>>
>
> There's a case where all the files are built by gcc, or all clang, and
> there's a
> case where half of the .o files are built by gcc and the other half are
> built by
> clang, so it probably won't work to just check !defined(__clang__).
>

Ah yes, of course.   That is the purpose of the calling conventions tests,
so I should have thought of that. :-)

Mark

-- 
You received this message because you are subscribed to the Google Groups
"Native-Client-Reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to native-client-reviews+unsubscribe@googlegroups.com.
To post to this group, send email to native-client-reviews@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-reviews?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Powered by Google App Engine
This is Rietveld 408576698