[ACTIVITY] 6-10 June 2016

2016-06-10 Thread Diana Picus
== Progress ==

* Remove exit-on-error flag from CodeGen tests [TCWG-604] [4/10]
  - This is a follow-up of TCWG-592: when changing the diag handler,
some of the tests started to fail, so we had to add an exit-on-error
flag to preserve the old behaviour until we can fix the tests.
  - Patch fixing the MIR tests (PR27770) - committed upstream
  - Submitted a patch fixing one of the AMDGPU tests (PR27761) - in
upstream review
  - Submitted a patch fixing the ARM test (PR27765) - in upstream review

* Use git worktree in llvm helper scripts [TCWG-587] [1/10]
  - Minor fixes during the review, hopefully we can wrap it up soon

* ARM: Do not test for CPUs, use SubtargetFeatures [TCWG-623] [3/10]
  - Investigated uses of isCortexA*, isSwift etc in the ARM backend
  - Started extracting subtarget features for the easy ones

* LLVM ARM 3.8.1 [TCWG-642] [1/10]
  - Ran the ARM tests for the LLVM 3.8.1 release

* Investigate clang-cmake-thumbv7-a15-full-sh failure [TCWG-635] [1/10]
  - Found patch that was causing problems, started discussion about it
on the mailing list

== Plan ==
* Remove exit-on-error flag from CodeGen tests [TCWG-604]
  - Address any code review comments
  - After committing the 2 remaining patches, we should be able to
remove the flag and wrap this up

* ARM: Do not test for CPUs, use SubtargetFeatures [TCWG-623]
  - Extract more subtarget features

* OOO on Monday
___
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-toolchain


Re: Linaro GCC vs Valgrind

2016-06-10 Thread William Mills


On 06/09/2016 09:07 PM, Charles Baylis wrote:
> This looks like a valgrind bug to me.
> 
> I can reproduce the problem with this simple program, which shows the
> issue at any optimisation level.
> 
> int main ()
> {
>  asm volatile ("" : : : "r4", "r5");
>  return 0;
> }
> 
> [on my raspberry pi, with the system gcc]
> $ gcc test.c -mtune=cortex-a15 -marm
> $ valgrind ./a.out
> ==15850== Memcheck, a memory error detector
> ==15850== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
> ==15850== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
> ==15850== Command: ./a.out
> ==15850==
> ==15850== Invalid write of size 4
> ==15850==at 0x103E8: main (in /home/cgb23/a.out)
> ==15850==  Address 0xbdcf34a4 is just below the stack ptr.  To
> suppress, use: --workaround-gcc296-bugs=yes
> ...
> 
> 000103e8 :
>103e8:   e16d40fcstrdr4, [sp, #-12]!
>103ec:   e58db008str fp, [sp, #8]
>103f0:   e28db008add fp, sp, #8
>103f4:   e3a03000mov r3, #0
>103f8:   e1a3mov r0, r3
>103fc:   e24bd008sub sp, fp, #8
>10400:   e1cd40d0ldrdr4, [sp]
>10404:   e59db008ldr fp, [sp, #8]
>10408:   e28dd00cadd sp, sp, #12
>1040c:   e12fff1ebx  lr
> 
> Without looking at the valgrind sources, I'd guess that valgrind isn't
> handling the strd instruction correctly. 

Yes, this was my conclusion as well.

> "size 4" obviously isn't
> correct for the strd, and it also may not be accounting for the
> writeback of the stack pointer correctly. Looking at google, I found
> this bug report to the valgrind mailing list:
> https://sourceforge.net/p/valgrind/mailman/message/34632852/. It seems
> to relate to the same issue, but did not attract any attention. A
> brief look at the attached patch suggests that the problem is related
> to the way valgrind handles writes to the stack with negative offsets
> and writeback.
> 

Thanks for the patch pointer. I looked at the patch.  The special casing
of -8 in the original code looks like a hack to me.  The patch looks
right to me.  It just removes the special casing of -8 and does the same
for all negative values.  The comment is wrong.  The logic is handling
the [SP, #-k]! form (Note the -> ! <-).  Negative values w/o the SP
update would still generate an error.

Will the compiler ever generate:
strd Rd, [SP, Rm]!
or  strd Rd, [SP, Rm, LSL #k]!

where Rm is negative (or at all?)

Valgrind would currently not handle these cases at all.


> The suggested --workaround-gcc296-bugs=yes option does seem to
> suppress the error. Alternatively, since the compiler will only use
> STRD/LDRD in the prologue and epilogue when compiling for cores with
> an out-of-order microarchitecture, you can workaround the problem by
> compiling with -mcpu=cortex-a7, in which case it will use PUSH and POP
> instead
> 
> 
> 
> On 9 June 2016 at 22:22, William Mills  wrote:
>> Hello,
>>
>> We have been using Linaro GCC 5.x[1] and valgrind.
>>
>> When the optimizer is turned on valgrind complains about writes beyond
>> the current stack pointer.  With the optimizer off, the problem report
>> goes away.
>>
>> I have my own conclusion about what is going on but I won't bias you
>> with it.  Here are the facts:
>>
>> All files and logs attached as 10K tar.gz if it survives this maillist.
>>
>> test.c:
>> #include 
>>
>> int  main(int argc,char** argv)
>> {
>> int i;
>>
>> for (i = 1; i < argc; i++) {
>> printf("argument is %s\n", argv[i]);
>>}
>>
>>return 0;
>> }
>>
>> $ arm-linux-gnueabihf-gcc -march=armv7ve -marm -mfpu=neon  \
>>   -mfloat-abi=hard -mcpu=cortex-a15 -O2 -g \
>>   -o test-fail test.c
>>
>>
>> $ valgrind --leak-resolution=high --track-origins=yes \
>> --trace-children=yes --leak-check=full --error-limit=no \
>>  ./test-fail arg1 arg2 arg3
>>
>> ==20011== Memcheck, a memory error detector
>> ==20011== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
>> ==20011== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
>> ==20011== Command: ./test-fail arg1 arg2 arg3
>> ==20011==
>> ==20011== Invalid write of size 4
>> ==20011==at 0x10300: main (test.c:4)
>> ==20011==  Address 0xbdbfcb58 is on thread 1's stack
>> ==20011==  24 bytes below stack pointer
>> ==20011==
>>
>> 000102f8 :
>>102f8:   e351cmp r0, #1
>>102fc:   da14ble 10354 
>>10300:   e16d41f8strdr4, [sp, #-24]! ; 0xffe8
>>   Complaint is here
>>
>>10304:   e1a05001mov r5, r1
>>10308:   e3a04001mov r4, #1
>>1030c:   e1cd60f8strdr6, [sp, #8]
>>10310:   e300748cmovwr7, #1164   ; 0x48c
>>10314:   e1a06000mov r6, r0
>>10318:   e3407001movtr7, #1
>> 

[ACTIVITY] 6-10 June 2016

2016-06-10 Thread Peter Smith
== Progress ==
TCWG-607 Initial ARM port for LLD committed upstream. Hello World on
an ARM with an ARM only gcc libc is possible, but not much else.

TCWG-611 Initial Thumb support sent for upstream review. Interworking
is possible at the BLX level but full interworking support
(veneers/thunks) isn't there yet. With this patch it will be possible
to do Hello World with a recent Linaro gcc release.

TCWG-634 llvm-mc putting out R_ARM_THM_PC24 for B.W instead of
R_ARM_THM_PC19. Simple fix now committed upstream.

== Plans ==
Interworking thunks for lld. The existing thunk design is very simple
and only supports one type of thunk per target. For interworking we
need at least two (ARM to Thumb) and (Thumb to ARM).

I think it might be possible to fit a basic implementation just good
enough for ARMv7a to be correct into the existing mechanism, however
just one more thunk type will need a more sophisticated design.

Current thought is to try and implement the basic design to learn a
bit more about the mechanism as it will hopefully not take too long.
___
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-toolchain


[ACTIVITY] 6-10 June 2016

2016-06-10 Thread Christophe Lyon
== Progress ==
* Validation
  - disk full on one builder caused problem during the validation of
the long series of backports. We'll have to refine the cleanup policy.
  - switch to docker on-hold until the builders are upgraded

* ABE
  - looked a bit at the gdb/gdbserver issue

* Backports
  - used a script to process the spreadsheet and submitted all the
backports that backflip was able to complete in batch mode (a lot!)
  - fsf-5-branch merge review

* GCC
  - regression reports on trunk, chasing problems that occur in corner
case configurations
  - One of the Neon intrinsics tests I committed recently wrongly
executed v8 Neon code on v7 HW: I didn't catch this earlier because of
a bug in qemu, promptly fixed by Peter Maydell
  - neon-testgen.ml removal delayed because other cleanup is desirable
before (fixing neon* effective-target tests on-going)
  - started looking at PR 67591 (ARM v8 Thumb IT blocks deprecated)

* Support
  - started looking at bug 2315

* Misc (conf-calls, meetings, emails, ...)

== Next ==
* Validation:
  - patch reviews
  - look at disk management/cleanup
* Backports
  - check validation results
* GCC
  - monitor trunk regressions
  - fix "check_vect" guard in gcc.dg/vect tests
  - fix neon* effective-target
  - hopefully test-neongen.ml removal
  - pr 67591
  - advsimd tests
___
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-toolchain