public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/59904] New: [ARM] tls-reload-1.c fails
@ 2014-01-22 12:01 christophe.lyon at st dot com
2014-02-07 9:06 ` [Bug target/59904] " ramana at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: christophe.lyon at st dot com @ 2014-01-22 12:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59904
Bug ID: 59904
Summary: [ARM] tls-reload-1.c fails
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: christophe.lyon at st dot com
Since commit 206897 (LRA fix PR rtl-optimization/59858)
I have noticed that:
gcc.dg/torture/tls/tls-reload-1.c -Os -pie -fPIE execution test
gcc.dg/torture/tls/tls-reload-1.c -Os -pie -fpie execution test
the compiler used to ICE, but after the LRA fix the generated code is not
functional.
I have tested with qemu-arm, target arm-none-linux-gnueabi, --with-mode=thumb
--with-cpu=cortex-a9, using RUNTESTFLAGS=-march=armv5t
gcc.log contains:
qemu: uncaught target signal 6 (Aborted) - core dumped
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/59904] [ARM] tls-reload-1.c fails
2014-01-22 12:01 [Bug target/59904] New: [ARM] tls-reload-1.c fails christophe.lyon at st dot com
@ 2014-02-07 9:06 ` ramana at gcc dot gnu.org
2014-05-09 6:45 ` tony.wang at arm dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-02-07 9:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59904
Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ramana at gcc dot gnu.org
--- Comment #1 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
So, this is failing for TLS with Thumb1, PIE and armv5t.
Needs further investigation.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/59904] [ARM] tls-reload-1.c fails
2014-01-22 12:01 [Bug target/59904] New: [ARM] tls-reload-1.c fails christophe.lyon at st dot com
2014-02-07 9:06 ` [Bug target/59904] " ramana at gcc dot gnu.org
@ 2014-05-09 6:45 ` tony.wang at arm dot com
2014-05-12 11:25 ` christophe.lyon at st dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tony.wang at arm dot com @ 2014-05-09 6:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59904
wangzheyu <tony.wang at arm dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tony.wang at arm dot com
--- Comment #2 from wangzheyu <tony.wang at arm dot com> ---
Hi, I'm trying to reproduce this bug on the panda board(cortex-a9). With the
same configuration, the case does meet some execution failure, but in order to
clarify what happened on earth, could you please provide your own elf?
(In reply to christophe.lyon from comment #0)
> Since commit 206897 (LRA fix PR rtl-optimization/59858)
> I have noticed that:
> gcc.dg/torture/tls/tls-reload-1.c -Os -pie -fPIE execution test
> gcc.dg/torture/tls/tls-reload-1.c -Os -pie -fpie execution test
>
> the compiler used to ICE, but after the LRA fix the generated code is not
> functional.
>
> I have tested with qemu-arm, target arm-none-linux-gnueabi,
> --with-mode=thumb --with-cpu=cortex-a9, using RUNTESTFLAGS=-march=armv5t
>
> gcc.log contains:
> qemu: uncaught target signal 6 (Aborted) - core dumped
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/59904] [ARM] tls-reload-1.c fails
2014-01-22 12:01 [Bug target/59904] New: [ARM] tls-reload-1.c fails christophe.lyon at st dot com
2014-02-07 9:06 ` [Bug target/59904] " ramana at gcc dot gnu.org
2014-05-09 6:45 ` tony.wang at arm dot com
@ 2014-05-12 11:25 ` christophe.lyon at st dot com
2014-05-14 10:28 ` tony.wang at arm dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: christophe.lyon at st dot com @ 2014-05-12 11:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59904
--- Comment #3 from christophe.lyon at st dot com ---
Sorry I no longer have the elf file available.
I've just looked at the current trunk status and I have a failure at link time
for these tests:
ld: gcc_tg.o: relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be
used when making a shared object; recompile with -fPIC
gcc_tg.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
compiler exited with status 1
Not sure if it's a problem with the binutils I use (linaro-2.24-2013.12) or a
known problem with the GCC test?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/59904] [ARM] tls-reload-1.c fails
2014-01-22 12:01 [Bug target/59904] New: [ARM] tls-reload-1.c fails christophe.lyon at st dot com
` (2 preceding siblings ...)
2014-05-12 11:25 ` christophe.lyon at st dot com
@ 2014-05-14 10:28 ` tony.wang at arm dot com
2014-05-16 13:26 ` christophe.lyon at st dot com
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tony.wang at arm dot com @ 2014-05-14 10:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59904
--- Comment #4 from wangzheyu <tony.wang at arm dot com> ---
Hi christophe,
It's ok from my side, the link time is ok. I'm not sure if it's related to your
tool chain version, but would you please provide detailed information of your
toolchain, the cmd you run for the test case, and where you get this version
binutils?
(In reply to christophe.lyon from comment #3)
> Sorry I no longer have the elf file available.
> I've just looked at the current trunk status and I have a failure at link
> time for these tests:
> ld: gcc_tg.o: relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not
> be used when making a shared object; recompile with -fPIC
> gcc_tg.o: error adding symbols: Bad value
> collect2: error: ld returned 1 exit status
> compiler exited with status 1
>
> Not sure if it's a problem with the binutils I use (linaro-2.24-2013.12) or
> a known problem with the GCC test?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/59904] [ARM] tls-reload-1.c fails
2014-01-22 12:01 [Bug target/59904] New: [ARM] tls-reload-1.c fails christophe.lyon at st dot com
` (3 preceding siblings ...)
2014-05-14 10:28 ` tony.wang at arm dot com
@ 2014-05-16 13:26 ` christophe.lyon at st dot com
2014-05-22 7:38 ` tony.wang at arm dot com
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: christophe.lyon at st dot com @ 2014-05-16 13:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59904
--- Comment #5 from christophe.lyon at st dot com ---
Created attachment 32806
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32806&action=edit
ELF binary file
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/59904] [ARM] tls-reload-1.c fails
2014-01-22 12:01 [Bug target/59904] New: [ARM] tls-reload-1.c fails christophe.lyon at st dot com
` (4 preceding siblings ...)
2014-05-16 13:26 ` christophe.lyon at st dot com
@ 2014-05-22 7:38 ` tony.wang at arm dot com
2014-05-27 1:36 ` tony.wang at arm dot com
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: tony.wang at arm dot com @ 2014-05-22 7:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59904
--- Comment #7 from wangzheyu <tony.wang at arm dot com> ---
After a close analysis of your elf, it will fail due to bad code in first call
to function checktls23. The corresponding C code is:
if (!y || *y++ != &tls23 || *y++ != &tls23_array[3]) return 0;
The code to get address of variable tls23 is wrongly fixed up. Here is the
assembly code with analysis embedded:
checktls23:
push {r4, lr}
mov r3, r0
sub r2, r0, #0
beq .L136
ldr r2, .L140 << get offset of variable tls23
ldr r1, [r0]
bl __aeabi_read_tp @ load_tp_soft << get thread point and save it
to r0
add r0, r0, r2 << thread point plus offset equals address of
variable tls23
mov r2, #0
cmp r1, r0
bne .L136
ldr r4, .L140+4
bl __aeabi_read_tp @ load_tp_soft
ldr r1, [r3, #4]
add r0, r0, r4
cmp r1, r0
bne .L136
add r3, r3, #8
mov r2, r3
.L136:
mov r0, r2
@ sp needed
pop {r4, pc}
.L141:
.align 2
.L140:
.word .LANCHOR2(tpoff)+124 << offset of tls23 is correctly
generated. but never get correctly fixed up.
.word .LANCHOR3(tpoff)+12
So my advice is to use a newer version of binutils to test it again.
(In reply to christophe.lyon from comment #6)
> I have re-run the tests with trunk@210140 and older binutils (Sept 2013).
>
> The test fails at compilation with target arm-none-linux-gnueabi, and
> CFLAGS=-Os -pie -fpie or -Os -pie -fPIE in the following configurations:
> --with-mode=arm --with-cpu=cortex-a9
> --with-mode=arm --with-cpu=cortex-a9 RUNTESTFLAGS=-mthumb
> --with-mode=thumb --with-cpu=cortex-a9
> --with-mode=thumb --with-cpu=cortex-a9 RUNTESTFLAGS=-marm
>
> The test compiles OK and fails at execution with
> --with-mode=thumb --with-cpu=cortex-a9 RUNTESTFLAGS=-march=armv5t
> (this is the ELF file I have attached)
>
> The compiles and runs OK with
> --with-mode=arm --with-cpu=cortex-a9 RUNTESTFLAGS=-march=armv5t
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/59904] [ARM] tls-reload-1.c fails
2014-01-22 12:01 [Bug target/59904] New: [ARM] tls-reload-1.c fails christophe.lyon at st dot com
` (5 preceding siblings ...)
2014-05-22 7:38 ` tony.wang at arm dot com
@ 2014-05-27 1:36 ` tony.wang at arm dot com
2014-05-27 9:49 ` christophe.lyon at st dot com
2014-05-27 10:25 ` christophe.lyon at st dot com
8 siblings, 0 replies; 10+ messages in thread
From: tony.wang at arm dot com @ 2014-05-27 1:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59904
--- Comment #9 from wangzheyu <tony.wang at arm dot com> ---
Hi, would please provide your elf file with the new binutils, so that we can
verify that whether it's the same issue as your former elf. If it is, it can be
verified as a bug because you're using the latest binutils-linaro. We will
investigate this issue further. Thanks a lot.
(In reply to christophe.lyon from comment #8)
> Using GCC trunk @210861, binutils-linaro-2.24-2014.03, I can see that
> tls-reload-1.c all PASS with:
> --target arm-none-linux-gnueabi --with-mode=arm --with-cpu=cortex-a9
> --with-fpu=neon and target_board set to -march=armv5t.
>
> When changing to --with-mode=thumb, I can see 10 failures at execution time,
> with "-pie -fpie" and -pie -fPIE" combined with -O1, -O2, -O3
> -fomit-frame-pointer, -O3 -g, and -Os.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/59904] [ARM] tls-reload-1.c fails
2014-01-22 12:01 [Bug target/59904] New: [ARM] tls-reload-1.c fails christophe.lyon at st dot com
` (6 preceding siblings ...)
2014-05-27 1:36 ` tony.wang at arm dot com
@ 2014-05-27 9:49 ` christophe.lyon at st dot com
2014-05-27 10:25 ` christophe.lyon at st dot com
8 siblings, 0 replies; 10+ messages in thread
From: christophe.lyon at st dot com @ 2014-05-27 9:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59904
--- Comment #10 from christophe.lyon at st dot com ---
Created attachment 32863
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32863&action=edit
ELF binary file #2
Compiled with arm-none-linux-gnueabi-gcc -O1 -pie -fpie -mthumb -march=armv5t
tls-reload-1.c -o tls-reload-1.exe
Binutils Linaro 2014.03
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/59904] [ARM] tls-reload-1.c fails
2014-01-22 12:01 [Bug target/59904] New: [ARM] tls-reload-1.c fails christophe.lyon at st dot com
` (7 preceding siblings ...)
2014-05-27 9:49 ` christophe.lyon at st dot com
@ 2014-05-27 10:25 ` christophe.lyon at st dot com
8 siblings, 0 replies; 10+ messages in thread
From: christophe.lyon at st dot com @ 2014-05-27 10:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59904
--- Comment #12 from christophe.lyon at st dot com ---
Created attachment 32864
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32864&action=edit
ELF binary file #3
Compiled with -Os -g3 -pie -fpie -march=armv5t -mthumb
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-05-27 10:25 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-22 12:01 [Bug target/59904] New: [ARM] tls-reload-1.c fails christophe.lyon at st dot com
2014-02-07 9:06 ` [Bug target/59904] " ramana at gcc dot gnu.org
2014-05-09 6:45 ` tony.wang at arm dot com
2014-05-12 11:25 ` christophe.lyon at st dot com
2014-05-14 10:28 ` tony.wang at arm dot com
2014-05-16 13:26 ` christophe.lyon at st dot com
2014-05-22 7:38 ` tony.wang at arm dot com
2014-05-27 1:36 ` tony.wang at arm dot com
2014-05-27 9:49 ` christophe.lyon at st dot com
2014-05-27 10:25 ` christophe.lyon at st dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).