[Bug c/36232] Optimizer removes condition check to terminate loop

2008-05-13 Thread nick dot spence at freescale dot com
--- Comment #6 from nick dot spence at freescale dot com 2008-05-13 20:41 --- 1) Since most bootloaders are written in C your view is very interesting but probably not shared by everyone else working with embedded software. 2) If the compiler now treats this as an undefined condition i

[Bug c/36232] Optimizer removes condition check to terminate loop

2008-05-13 Thread pinskia at gcc dot gnu dot org
--- Comment #5 from pinskia at gcc dot gnu dot org 2008-05-13 20:02 --- >This section of code is used in a bootloader to test DRAM. You cannot use C for that code because of how C defines pointers. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36232

[Bug c/36232] Optimizer removes condition check to terminate loop

2008-05-13 Thread pinskia at gcc dot gnu dot org
--- Comment #4 from pinskia at gcc dot gnu dot org 2008-05-13 20:02 --- a pointer cannot go from a valid pointer to a NULL pointer. See PR 36124. *** This bug has been marked as a duplicate of 36124 *** -- pinskia at gcc dot gnu dot org changed: What|Removed

[Bug c/36232] Optimizer removes condition check to terminate loop

2008-05-13 Thread nick dot spence at freescale dot com
--- Comment #3 from nick dot spence at freescale dot com 2008-05-13 19:56 --- The code has two loops, which compile correctly when no optimization, or -O1 are used, but the second loop becomes infinite if -Os or -O2 is used. .file "test.c" .section.rodata.str1

[Bug c/36232] Optimizer removes condition check to terminate loop

2008-05-13 Thread nick dot spence at freescale dot com
--- Comment #2 from nick dot spence at freescale dot com 2008-05-13 19:52 --- Created an attachment (id=15637) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15637&action=view) Compiler intermediate file -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36232

[Bug c/36232] Optimizer removes condition check to terminate loop

2008-05-13 Thread nick dot spence at freescale dot com
--- Comment #1 from nick dot spence at freescale dot com 2008-05-13 19:51 --- Created an attachment (id=15636) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15636&action=view) Example code source file Compile with 'gcc -Os test.c' or 'gcc -O2 test.c' and examine assembly output.