too much code elimination by optimizing for size

Bug #1679967 reported by Christian Neubert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
New
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.

Revision history for this message
Christian Neubert (cneubert) wrote :
no longer affects: gcc-arm-embedded-native-build-tools
Revision history for this message
Thomas Preud'homme (thomas-preudhomme) wrote :

Hi Christian,

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

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.