public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/58259] ARM, PowerPC: Atomic flag test and set generates NULL pointer read and write
[not found] <bug-58259-4@http.gcc.gnu.org/bugzilla/>
@ 2013-08-28 12:31 ` sebastian.huber@embedded-brains.de
2013-08-28 15:12 ` sebastian.huber@embedded-brains.de
1 sibling, 0 replies; 2+ messages in thread
From: sebastian.huber@embedded-brains.de @ 2013-08-28 12:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58259
Sebastian Huber <sebastian.huber@embedded-brains.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|powerpc-eabi |powerpc-eabi, arm-eabi
Summary|PowerPC: Atomic flag test |ARM, PowerPC: Atomic flag
|and set generates NULL |test and set generates NULL
|pointer read and write |pointer read and write
--- Comment #1 from Sebastian Huber <sebastian.huber@embedded-brains.de> ---
Sorry, also the ARMv7 has the NULL pointer read and write problem:
arm-eabi-gcc -march=armv7-a -std=c11 -Wall -Wextra -O2 -S test.c && cat test.s
.arch armv7-a
.fpu softvfp
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 1
.eabi_attribute 30, 2
.eabi_attribute 34, 1
.eabi_attribute 18, 4
.file "test.c"
.text
.align 2
.global test_and_set
.type test_and_set, %function
test_and_set:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 0, uses_anonymous_args = 0
@ link register save eliminated.
mov r3, #0
mov r1, #1
ldrb r2, [r3] @ zero_extendqisi2 <-- NULL POINTER READ
.L2:
ldrexb r3, [r0]
cmp r3, r2
bne .L3
strexb ip, r1, [r0]
cmp ip, #0
bne .L2
.L3:
mov r2, #0
dmb sy
moveq r0, #1
strb r3, [r2] <-- NULL POINTER WRITE
movne r0, r2
bx lr
.size test_and_set, .-test_and_set
.ident "GCC: (GNU) 4.9.0 20130828 (experimental) [master revision
022fc2d:bffd767:fd457cef14f3bc6673e90a2de80005feea743ab7]"
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug target/58259] ARM, PowerPC: Atomic flag test and set generates NULL pointer read and write
[not found] <bug-58259-4@http.gcc.gnu.org/bugzilla/>
2013-08-28 12:31 ` [Bug target/58259] ARM, PowerPC: Atomic flag test and set generates NULL pointer read and write sebastian.huber@embedded-brains.de
@ 2013-08-28 15:12 ` sebastian.huber@embedded-brains.de
1 sibling, 0 replies; 2+ messages in thread
From: sebastian.huber@embedded-brains.de @ 2013-08-28 15:12 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58259
Sebastian Huber <sebastian.huber@embedded-brains.de> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Sebastian Huber <sebastian.huber@embedded-brains.de> ---
Sorry for the noise, this was due to a broken FreeBSD <stdatomic.h> header
file.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-28 15:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-58259-4@http.gcc.gnu.org/bugzilla/>
2013-08-28 12:31 ` [Bug target/58259] ARM, PowerPC: Atomic flag test and set generates NULL pointer read and write sebastian.huber@embedded-brains.de
2013-08-28 15:12 ` sebastian.huber@embedded-brains.de
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).