[Bug rtl-optimization/64294] invalid code, zero check gets optimized away

2014-12-20 Thread gcc at breakpoint dot cc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 Sebastian Andrzej Siewior changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|

[Bug rtl-optimization/64294] invalid code, zero check gets optimized away

2014-12-20 Thread mikpelinux at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 --- Comment #10 from Mikael Pettersson --- You're invoking undefined behaviour due to overflow in signed integer arithmetic. Running it after compiling with -fsanitize=undefined produces: petite.c:391:28: runtime error: signed integer overflow:

[Bug rtl-optimization/64294] invalid code, zero check gets optimized away

2014-12-20 Thread gcc at breakpoint dot cc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 --- Comment #9 from Sebastian Andrzej Siewior --- I added the complete function including its callers. $ gcc -g -o petite petite.c -Wall -O2 $ ./petite 447=> 5 452=> 5 447=> 5 452=> 5 447=> 0 452=> 0 Segmentation fault --- $ gcc -g -o petite pet

[Bug rtl-optimization/64294] invalid code, zero check gets optimized away

2014-12-20 Thread gcc at breakpoint dot cc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 --- Comment #8 from Sebastian Andrzej Siewior --- Created attachment 34305 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34305&action=edit self-contained complete TC

[Bug rtl-optimization/64294] invalid code, zero check gets optimized away

2014-12-20 Thread mikpelinux at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 --- Comment #7 from Mikael Pettersson --- The testcases don't build due to linkage errors. Please submit a self-contained and preferably minimized testcase.

[Bug rtl-optimization/64294] invalid code, zero check gets optimized away

2014-12-19 Thread gcc at breakpoint dot cc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 Sebastian Andrzej Siewior changed: What|Removed |Added Known to work||4.7.2 --- Comment #6 from Se

[Bug rtl-optimization/64294] invalid code, zero check gets optimized away

2014-12-13 Thread gcc at breakpoint dot cc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 Sebastian Andrzej Siewior changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resoluti

[Bug rtl-optimization/64294] invalid code, zero check gets optimized away

2014-12-13 Thread gcc at breakpoint dot cc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 --- Comment #4 from Sebastian Andrzej Siewior --- Created attachment 34276 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34276&action=edit tc-static function

[Bug rtl-optimization/64294] invalid code, zero check gets optimized away

2014-12-13 Thread gcc at breakpoint dot cc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 Sebastian Andrzej Siewior changed: What|Removed |Added Attachment #34272|0 |1 is obsolete|

[Bug rtl-optimization/64294] invalid code, zero check gets optimized away

2014-12-12 Thread gcc at breakpoint dot cc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 --- Comment #2 from Sebastian Andrzej Siewior --- It seems exit(0) is dropped with -O1 -ftree-vrp. (In reply to Andreas Schwab from comment #1) > This condition is true if backsize == 0: Ehm, yes. The Code is: -- printf("bufsz: %u backsize: %d\

[Bug rtl-optimization/64294] invalid code, zero check gets optimized away

2014-12-12 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 Andreas Schwab changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---