diff --git a/demos/ARM7-AT91SAM7X-GCC/Makefile b/demos/ARM7-AT91SAM7X-GCC/Makefile index 5e1211efa..ea39d57e2 100644 --- a/demos/ARM7-AT91SAM7X-GCC/Makefile +++ b/demos/ARM7-AT91SAM7X-GCC/Makefile @@ -101,7 +101,7 @@ TOPT = -mthumb -D THUMB # chconf.h. # NOTE: -falign-functions=16 may improve the performance, not always, but # increases the code size. -OPT = -O2 -ggdb -fomit-frame-pointer -fno-strict-aliasing +OPT = -O2 -ggdb -fomit-frame-pointer #OPT += -ffixed-r7 #OPT += -falign-functions=16 diff --git a/demos/ARM7-AT91SAM7X-GCC/Makefile.thumb b/demos/ARM7-AT91SAM7X-GCC/Makefile.thumb index 64d348ad5..50883c63f 100644 --- a/demos/ARM7-AT91SAM7X-GCC/Makefile.thumb +++ b/demos/ARM7-AT91SAM7X-GCC/Makefile.thumb @@ -101,7 +101,7 @@ TOPT = -mthumb -D THUMB # chconf.h. # NOTE: -falign-functions=16 may improve the performance, not always, but # increases the code size. -OPT = -Os -ggdb -fomit-frame-pointer -fno-strict-aliasing +OPT = -Os -ggdb -fomit-frame-pointer #OPT += -ffixed-r7 #OPT += -falign-functions=16 diff --git a/demos/ARM7-LPC214x-GCC-minimal/Makefile b/demos/ARM7-LPC214x-GCC-minimal/Makefile index d8ed9ed9b..7d7e8874c 100644 --- a/demos/ARM7-LPC214x-GCC-minimal/Makefile +++ b/demos/ARM7-LPC214x-GCC-minimal/Makefile @@ -99,7 +99,7 @@ TOPT = -mthumb -D THUMB # chconf.h. # NOTE: -falign-functions=16 may improve the performance, not always, but # increases the code size. -OPT = -O2 -ggdb -fomit-frame-pointer -fno-strict-aliasing +OPT = -O2 -ggdb -fomit-frame-pointer #OPT += -ffixed-r7 OPT += -falign-functions=16 diff --git a/demos/ARM7-LPC214x-GCC-minimal/Makefile.thumb b/demos/ARM7-LPC214x-GCC-minimal/Makefile.thumb index 621e71853..0df66f2d3 100644 --- a/demos/ARM7-LPC214x-GCC-minimal/Makefile.thumb +++ b/demos/ARM7-LPC214x-GCC-minimal/Makefile.thumb @@ -99,7 +99,7 @@ TOPT = -mthumb -D THUMB # chconf.h. # NOTE: -falign-functions=16 may improve the performance, not always, but # increases the code size. -OPT = -Os -ggdb -fomit-frame-pointer -fno-strict-aliasing +OPT = -Os -ggdb -fomit-frame-pointer #OPT += -ffixed-r7 OPT += -falign-functions=16 diff --git a/demos/ARM7-LPC214x-GCC/Makefile b/demos/ARM7-LPC214x-GCC/Makefile index 5168f764a..32f08943e 100644 --- a/demos/ARM7-LPC214x-GCC/Makefile +++ b/demos/ARM7-LPC214x-GCC/Makefile @@ -102,7 +102,7 @@ TOPT = -mthumb -D THUMB # chconf.h. # NOTE: -falign-functions=16 may improve the performance, not always, but # increases the code size. -OPT = -O2 -ggdb -fomit-frame-pointer -fno-strict-aliasing +OPT = -O2 -ggdb -fomit-frame-pointer #OPT += -ffixed-r7 OPT += -falign-functions=16 diff --git a/demos/AVR-AT90CANx-GCC/Makefile b/demos/AVR-AT90CANx-GCC/Makefile index 106c3c390..37c56acf9 100644 --- a/demos/AVR-AT90CANx-GCC/Makefile +++ b/demos/AVR-AT90CANx-GCC/Makefile @@ -161,7 +161,7 @@ CFLAGS += -funsigned-char CFLAGS += -funsigned-bitfields CFLAGS += -fpack-struct CFLAGS += -fshort-enums -CFLAGS += -fno-strict-aliasing +#CFLAGS += -fno-strict-aliasing CFLAGS += -Wall CFLAGS += -Wstrict-prototypes #CFLAGS += -mshort-calls diff --git a/demos/AVR-ATmega128-GCC/Makefile b/demos/AVR-ATmega128-GCC/Makefile index 34c228691..3be566c19 100644 --- a/demos/AVR-ATmega128-GCC/Makefile +++ b/demos/AVR-ATmega128-GCC/Makefile @@ -161,7 +161,7 @@ CFLAGS += -funsigned-char CFLAGS += -funsigned-bitfields CFLAGS += -fpack-struct CFLAGS += -fshort-enums -CFLAGS += -fno-strict-aliasing +#CFLAGS += -fno-strict-aliasing CFLAGS += -Wall CFLAGS += -Wstrict-prototypes #CFLAGS += -mshort-calls diff --git a/demos/Win32-MinGW/Makefile b/demos/Win32-MinGW/Makefile index 8d4edec7e..ea206b0d0 100644 --- a/demos/Win32-MinGW/Makefile +++ b/demos/Win32-MinGW/Makefile @@ -76,7 +76,7 @@ ULIBDIR = ULIBS = # Define optimisation level here -OPT = -Os -fomit-frame-pointer -fno-strict-aliasing +OPT = -Os -fomit-frame-pointer # # End of user defines diff --git a/readme.txt b/readme.txt index c5dc49096..601a3f6e8 100644 --- a/readme.txt +++ b/readme.txt @@ -66,6 +66,9 @@ AVR-AT90CANx-GCC - Port on AVR AT90CAN128, not tested on hardware yet. - Nice scheduler speed improvement obtained by removing the 2nd parameter to the chSchReadyI() API and manually assigning the message value only where is really needed (very few points in the code). +- Huge space saving and speed improvement obtained by removing the + -fno-strict-aliasing option from the makefiles, now the kernel compiles + without any warning without this option. - Removed the -falign-functions=16 option from the AT91SAM7X demo makefiles, the Atmel chip does not require it, the option is still present on the LPC21xx demos. This saves significant ROM space. diff --git a/src/chdelta.c b/src/chdelta.c index ef4493b79..41f4490d0 100644 --- a/src/chdelta.c +++ b/src/chdelta.c @@ -32,7 +32,7 @@ DeltaList dlist; */ void chVTInit(void) { - dlist.dl_next = dlist.dl_prev = (VirtualTimer *)&dlist; + dlist.dl_next = dlist.dl_prev = (void *)&dlist; dlist.dl_dtime = (systime_t)-1; } @@ -64,7 +64,7 @@ void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par) { vtp->vt_prev = (vtp->vt_next = p)->vt_prev; vtp->vt_prev->vt_next = p->vt_prev = vtp; vtp->vt_dtime = time; - if (p != (VirtualTimer *)&dlist) + if (p != (void *)&dlist) p->vt_dtime -= time; } else @@ -79,7 +79,7 @@ void chVTSetI(VirtualTimer *vtp, systime_t time, vtfunc_t vtfunc, void *par) { */ void chVTResetI(VirtualTimer *vtp) { - if (vtp->vt_next != (VirtualTimer *)&dlist) + if (vtp->vt_next != (void *)&dlist) vtp->vt_next->vt_dtime += vtp->vt_dtime; vtp->vt_prev->vt_next = vtp->vt_next; vtp->vt_next->vt_prev = vtp->vt_prev; diff --git a/src/include/delta.h b/src/include/delta.h index 1f7a584f0..4e0f32b0f 100644 --- a/src/include/delta.h +++ b/src/include/delta.h @@ -76,7 +76,7 @@ extern DeltaList dlist; while (!(vtp = dlist.dl_next)->vt_dtime) { \ vtfunc_t fn = vtp->vt_func; \ vtp->vt_func = 0; \ - (vtp->vt_next->vt_prev = (VirtualTimer *)&dlist)->vt_next = vtp->vt_next; \ + (vtp->vt_next->vt_prev = (void *)&dlist)->vt_next = vtp->vt_next; \ fn(vtp->vt_par); \ } \ } diff --git a/src/include/events.h b/src/include/events.h index 8cfb0109f..5bcb70e84 100644 --- a/src/include/events.h +++ b/src/include/events.h @@ -61,7 +61,7 @@ typedef struct EventSource { * @note Can be called with interrupts disabled or enabled. */ #define chEvtInit(esp) \ - ((esp)->es_next = (EventListener *)(esp)) + ((esp)->es_next = (void *)(esp)) /** * Verifies if there is at least one \p EventListener registered on the @@ -70,7 +70,7 @@ typedef struct EventSource { * @note Can be called with interrupts disabled or enabled. */ #define chEvtIsListening(esp) \ - ((esp) != (EventSource *)(esp)->es_next) + ((esp) != (void *)(esp)->es_next) /** Event Handler callback function.*/