GCC 10 Inlining behavior breaks RT test 12-7 Topic is solved
-
- Posts: 8
- Joined: Sun Oct 11, 2020 4:57 am
- Location: Michigan, USA
- Has thanked: 1 time
- Been thanked: 1 time
Re: GCC 10 Inlining behavior breaks RT test 12-7
Hi Giovanni, thanks for finding the bug, wish I could have been of more help but I didn't have time to learn what I'd need to know to investigate it myself.
- Giovanni
- Site Admin
- Posts: 14704
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1146 times
- Been thanked: 960 times
Re: GCC 10 Inlining behavior breaks RT test 12-7
Hi,
Don't worry, I am just evaluating various ways to fix/workaround that problem.
Giovanni
Don't worry, I am just evaluating various ways to fix/workaround that problem.
Giovanni
- Giovanni
- Site Admin
- Posts: 14704
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1146 times
- Been thanked: 960 times
Re: GCC 10 Inlining behavior breaks RT test 12-7
Hi,
Update, this has been reported as bug #1138.
I committed an initial fix on trunk and it appears to work correctly however:
1) The list (threads and virtual timers) handling in RT has been reorganized to avoid aliasing problems, this affected a lot of code in RT and OSLIB.
2) It has not yet been tested under all possible conditions, I know there are configuration options that do not compile correctly yet.
3) Quality procedures need to be performed again because the extensive changes.
On the other hand:
1) Lists-related code is more elegant now, the number for pointer casts has been reduced dramatically which is generally a good thing.
2) Gave me an opportunity to re-look at code not touched for many years.
I only tested on the STM32G4 but the test suite succeeds now. Please report any problem you may find.
After trunk is stable again the change will be back-ported on 19.x and 20.x (and it is a lot of work).
Giovanni
Update, this has been reported as bug #1138.
I committed an initial fix on trunk and it appears to work correctly however:
1) The list (threads and virtual timers) handling in RT has been reorganized to avoid aliasing problems, this affected a lot of code in RT and OSLIB.
2) It has not yet been tested under all possible conditions, I know there are configuration options that do not compile correctly yet.
3) Quality procedures need to be performed again because the extensive changes.
On the other hand:
1) Lists-related code is more elegant now, the number for pointer casts has been reduced dramatically which is generally a good thing.
2) Gave me an opportunity to re-look at code not touched for many years.
I only tested on the STM32G4 but the test suite succeeds now. Please report any problem you may find.
After trunk is stable again the change will be back-ported on 19.x and 20.x (and it is a lot of work).
Giovanni
- FXCoder
- Posts: 398
- Joined: Sun Jun 12, 2016 4:10 am
- Location: Sydney, Australia
- Has thanked: 186 times
- Been thanked: 133 times
Re: GCC 10 Inlining behavior breaks RT test 12-7
Hi Giovanni,
Moved the latest trunk into a project quickly this morning to do some checking.
Found the following...
#1 chvt.c casts for delta list manipulations
#2 Binary semaphore compile fails
This is likely one of the options that do not compile correctly that you referred to.
Didn't have time to dig into it.
--
Bob
Moved the latest trunk into a project quickly this morning to do some checking.
Found the following...
#1 chvt.c casts for delta list manipulations
Code: Select all
Index: chvt.c
===================================================================
--- chvt.c (revision 13960)
+++ chvt.c (working copy)
@@ -380,10 +380,10 @@
virtual_timer_t *vtp;
vtfunc_t fn;
- vtp = vtlp->dlist.next;
+ vtp = (virtual_timer_t *)vtlp->dlist.next;
fn = vtp->func;
vtp->func = NULL;
- vtp->dlist.next->prev = (virtual_timer_t *)vtlp;
+ vtp->dlist.next->prev = (delta_list_t *)vtlp;
vtlp->dlist.next = vtp->dlist.next;
chSysUnlockFromISR();
fn(vtp->par);
#2 Binary semaphore compile fails
This is likely one of the options that do not compile correctly that you referred to.
Didn't have time to dig into it.
Code: Select all
os/oslib/include/chbsem.h:92:4: warning: implicit declaration of function '_SEMAPHORE_DATA'; did you mean 'SEMAPHORE_DECL'? [-Wimplicit-function-declaration]
92 | {_SEMAPHORE_DATA(name.sem, ((taken) ? 0 : 1))}
| ^~~~~~~~~~~~~~~
--
Bob
- Giovanni
- Site Admin
- Posts: 14704
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1146 times
- Been thanked: 960 times
Re: GCC 10 Inlining behavior breaks RT test 12-7
Hi Bob,
I meant exactly those kind of errors, things hidden by configuration switches, fixed.
Giovanni
I meant exactly those kind of errors, things hidden by configuration switches, fixed.
Giovanni
- FXCoder
- Posts: 398
- Joined: Sun Jun 12, 2016 4:10 am
- Location: Sydney, Australia
- Has thanked: 186 times
- Been thanked: 133 times
Re: GCC 10 Inlining behavior breaks RT test 12-7
Hi,
Here is another...
Set CH_CFG_OPTIMIZE_SPEED FALSE
...to reveal a few more compile problems in chschd.c & chmtx.c (plus a type change in syscalls.c).
--
Bob
Here is another...
Set CH_CFG_OPTIMIZE_SPEED FALSE
...to reveal a few more compile problems in chschd.c & chmtx.c (plus a type change in syscalls.c).
--
Bob
- Giovanni
- Site Admin
- Posts: 14704
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1146 times
- Been thanked: 960 times
Re: GCC 10 Inlining behavior breaks RT test 12-7
Fixed thanks, committed more queues reorganization, there is no reason to hold back changes at this point.
Giovanni
Giovanni
- Giovanni
- Site Admin
- Posts: 14704
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1146 times
- Been thanked: 960 times
Re: GCC 10 Inlining behavior breaks RT test 12-7
Hi,
Fixed as bug bug #1138 in trunk, 20.x and 19.x.
Giovanni
Fixed as bug bug #1138 in trunk, 20.x and 19.x.
Giovanni
Who is online
Users browsing this forum: No registered users and 122 guests