too much code elimination by optimizing for size

Bug #1679967 reported by Christian Neubert on 2017-04-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU ARM Embedded Toolchain
Undecided
Unassigned

Bug Description

I´m using the following version (output from --version):

arm-none-eabi-gcc.exe (GNU Tools for ARM Embedded Processors) 5.4.1 20160609 (re
lease) [ARM/embedded-5-branch revision 237715]
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If I compile the given file with the options "-Os -S" the compiler eliminates too much code.

Christian Neubert (cneubert) wrote :
no longer affects: gcc-arm-embedded-native-build-tools

Hi Christian,

Your program contains undefined behavior: it accesses array[64] in the last iteration of the while loop. Try exchanging the two tests.

Christian Neubert (cneubert) wrote :

Hi Thomas,

Thanks! Shame on me that I haven´t seen this. With this change it seems to work with all optimizations and all gcc versions I got here :)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers