-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gcc -O1 causes Memory fault #7
Comments
it seems after optimization "-O1" the variables
we can see this in
after "-O1"
|
@arcbbb Using gcc flag |
Fantastic compiler flag! learned a great lesson. |
@arcbbb Yes, gcc consists of the collection of the magic. |
It seems like inline assembly in L4_Ipc doesn't work after gcc optimization. volatile int __USER_TEXT L4_Ipc(
l4_thread_t to, l4_thread_t from,
uint32_t timeouts, uint32_t *high_mrs)
{
800c010: b084 sub sp, #16
800c012: 9301 str r3, [sp, #4]
800c014: e92d 0ff0 stmdb sp!, {r4, r5, r6, r7, r8, r9, sl, fp}
800c018: f8dd c004 ldr.w ip, [sp, #4]
800c01c: e89c 0ff0 ldmia.w ip, {r4, r5, r6, r7, r8, r9, sl, fp}
800c020: df06 svc 6
800c022: e8bd 0ff0 ldmia.w sp!, {r4, r5, r6, r7, r8, r9, sl, fp}
800c026: 9003 str r0, [sp, #12] original inline assembly: __asm__ __volatile__ ("push {r4-r11}\n"
"ldr r12, %1\n"
"ldm r12, {r4-r11}\n"
"svc #6\n"
"pop {r4-r11}\n"
"str r0, %[output]\n"
: [output] "=m" (result)
: "m"(high_mrs)); |
gcc -O1 flag seems ok after this patch. |
Verified and merged. Thanks! |
F9 Microkernel is known to crash if being built with gcc -O1 (or higher order):
commit 551b9f0 disables optimization as workaround.
The text was updated successfully, but these errors were encountered: