This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch ARM] Improve guality tests - part 1 - pr36728-1.c


Hi,

I decided to spend some time looking at the large number of guality test failures on arm. I see a number of fails with gcc.dg/guality/pr36728-1.c as below. pr36728-2.c also fails in similar sort of ways. Before I go adjusting too many other tests I'd like to get some feedback regarding this from folks.

On ARM parameters are passed in r0 - r3 which maps to arg1 - arg4. The code generated appears to use r0 for the return value and as a temporary. r2 and r3 are used as temporaries to adjust the stack as those are the first temporaries used in the register allocaton order. Therefore it is understandeable that arg1, arg3 and arg4 end up being "optimized" out and there is no chance of reclaiming the information at line #16 or line #18 in the testcase linked. r1 gets used at O2 and therefore that starts failing at O2 and above.

Depending on optimization levels, registers used for arg1 - arg4 get reused at various optimization levels therefore we have no choice but to disable this lot.

Once you do that the only failures left are with the variable 'y' at optimization levels O2 and O3 which I'm going to leave as is until the time as I understand what's going on here. My initial thought is that this also appears to be a testism, but I'm not a 100% sure yet.

I pondered adding a testsuite keyword for this but it appears to be so special cased per target, that I don't see any easy way of handling this as each target appears to be special in the way in which it handles this - fundamentally would end up depending on the number of registers used as parameter registers and being caller saved registers and that varies from port to port.


FAIL: gcc.dg/guality/pr36728-1.c   -O1  line 16 arg3 == 3
FAIL: gcc.dg/guality/pr36728-1.c   -O1  line 16 arg4 == 4
FAIL: gcc.dg/guality/pr36728-1.c   -O1  line 18 arg1 == 1
FAIL: gcc.dg/guality/pr36728-1.c   -O1  line 18 arg3 == 3
FAIL: gcc.dg/guality/pr36728-1.c   -O1  line 18 arg4 == 4
FAIL: gcc.dg/guality/pr36728-1.c   -O2  line 18 arg2 == 2
FAIL: gcc.dg/guality/pr36728-1.c   -O2  line 18 arg3 == 3
FAIL: gcc.dg/guality/pr36728-1.c   -O2  line 18 arg4 == 4
FAIL: gcc.dg/guality/pr36728-1.c   -O2  line 18 y == 2
FAIL: gcc.dg/guality/pr36728-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none line 18 arg2 == 2 FAIL: gcc.dg/guality/pr36728-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none line 18 arg3 == 3 FAIL: gcc.dg/guality/pr36728-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none line 18 arg4 == 4 FAIL: gcc.dg/guality/pr36728-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none line 18 y == 2 FAIL: gcc.dg/guality/pr36728-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects line 18 arg1 == 1 FAIL: gcc.dg/guality/pr36728-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects line 18 arg2 == 2 FAIL: gcc.dg/guality/pr36728-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects line 18 arg3 == 3 FAIL: gcc.dg/guality/pr36728-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects line 18 arg4 == 4 FAIL: gcc.dg/guality/pr36728-1.c -O3 -fomit-frame-pointer line 18 arg2 == 2 FAIL: gcc.dg/guality/pr36728-1.c -O3 -fomit-frame-pointer line 18 arg3 == 3 FAIL: gcc.dg/guality/pr36728-1.c -O3 -fomit-frame-pointer line 18 arg4 == 4
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -fomit-frame-pointer  line 18 y == 2
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -g  line 18 arg2 == 2
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -g  line 18 arg3 == 3
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -g  line 18 arg4 == 4
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -g  line 18 y == 2

to

FAIL: gcc.dg/guality/pr36728-1.c   -O2  line 16 y == 2
FAIL: gcc.dg/guality/pr36728-1.c   -O2  line 18 y == 2
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -fomit-frame-pointer  line 16 y == 2
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -fomit-frame-pointer  line 18 y == 2
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -g  line 16 y == 2
FAIL: gcc.dg/guality/pr36728-1.c   -O3 -g  line 18 y == 2
FAIL: gcc.dg/guality/pr36728-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none line 16 y == 2 FAIL: gcc.dg/guality/pr36728-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none line 18 y == 2 FAIL: gcc.dg/guality/pr36728-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects line 16 y == 2


Changelog:

* gcc.dg/guality/pr36728-1.c: Skip some tests for arm.

Ok ? Thoughts ?

regards,
Ramana


P.S. I got caught out by the yama security module in the kernel preventing me from running some of the guality tests on the chromebook I was running this on. https://www.kernel.org/doc/Documentation/security/Yama.txt. JFTR it may be a good idea to do

 echo 0 > /proc/sys/kernel/yama/ptrace_scope


to get these things to work. Also I was using a trunk gdb to get these results.


Attachment: pr36728-1.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]