public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/66547] New: arm-none-eabi-gcc - stack misaligned when calling va_arg function
@ 2015-06-15 23:54 matt at hpamotorsport dot com
  2015-06-16  0:00 ` [Bug target/66547] " matt at hpamotorsport dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: matt at hpamotorsport dot com @ 2015-06-15 23:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66547

            Bug ID: 66547
           Summary: arm-none-eabi-gcc - stack misaligned when calling
                    va_arg function
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: matt at hpamotorsport dot com
  Target Milestone: ---

Created attachment 35785
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35785&action=edit
File from project

I'm working on a project that uses ChibiOS
(https://github.com/ChibiOS/ChibiOS/tree/stable_2.6.x) where I have a function
that calls a va_arg function but the stack is not aligned after the calling
function allocates it's local resources. This causes 64-bit variables (long
long as well as double) to be incorrectly placed.

The assembly generated shows that the stack pointer is moved by 116 where it
should be moved by 120 to keep the alignment to 8-bytes.




arm-none-eabi-gcc -c -mcpu=cortex-m3 -Os -ggdb -fsingle-precision-constant
-mno-unaligned-access -mabi=aapcs -mtune=cortex-m3 -save-temps
-ffunction-sections -fdata-sections -fno-common  -Wall -Wextra
-Wstrict-prototypes -Wa,-alms=build/lst/performance.lst  -DCORTEX_USE_FPU=FALSE
-DBOARD_HALDEX_STM32_P105_A1=1 -DOSC_HAS_64BIT -DOSC_HAS_FLOAT
-DOSC_HAS_HEARTBEAT -DSLP_HAS_USB -D__BUILD_NUMBER=`cat build-number.txt`
-DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -MD -MP -MF
.dep/performance.o.d -mthumb -DTHUMB -I.
-I../ChibiOS_2.6.7/os/ports/common/ARMCMx/CMSIS/include
-I../ChibiOS_2.6.7/os/ports/common/ARMCMx
-I../ChibiOS_2.6.7/os/ports/GCC/ARMCMx
-I../ChibiOS_2.6.7/os/ports/GCC/ARMCMx/STM32F1xx
-I../ChibiOS_2.6.7/os/kernel/include -I../ChibiOS_2.6.7/os/hal/include
-I../ChibiOS_2.6.7/os/hal/platforms/STM32F1xx
-I../ChibiOS_2.6.7/os/hal/platforms/STM32
-I../ChibiOS_2.6.7/os/hal/platforms/STM32/GPIOv1
-I../ChibiOS_2.6.7/os/hal/platforms/STM32/I2Cv1
-I../ChibiOS_2.6.7/os/hal/platforms/STM32/RTCv1
-I../ChibiOS_2.6.7/os/hal/platforms/STM32/SPIv1
-I../ChibiOS_2.6.7/os/hal/platforms/STM32/TIMv1
-I../ChibiOS_2.6.7/os/hal/platforms/STM32/USARTv1
-I../ChibiOS_2.6.7/os/hal/platforms/STM32/OTGv1 -I../HPA_Libraries/board
-I../ChibiOS_2.6.7/os/various -I../HPA_Libraries performance.c -o
build/obj/performance.o


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-16 16:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-15 23:54 [Bug c/66547] New: arm-none-eabi-gcc - stack misaligned when calling va_arg function matt at hpamotorsport dot com
2015-06-16  0:00 ` [Bug target/66547] " matt at hpamotorsport dot com
2015-06-16 10:01 ` rearnsha at gcc dot gnu.org
2015-06-16 16:45 ` matt at hpamotorsport 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).