[Bug rtl-optimization/61509] New: GCC miscompilation on ARM during RTL optimization when compiled with -O3

2014-06-14 Thread quentusrex at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61509

Bug ID: 61509
   Summary: GCC miscompilation on ARM during RTL optimization when
compiled with -O3
   Product: gcc
   Version: 4.6.3
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: quentusrex at gmail dot com

C code:
if(strcasecmp(var,"a")) 
else if(strcasecmp(var, "b") 

the second call to strcasecmp is being optimized out, and the control statement
is effectively being treated as an if() else statement.

More detailed write up here: 
http://quentusrex.com/freeswitch-raspberrypi-gcc-compiler-bug.html

Debug files located here:
https://github.com/quentusrex/FS-6495/tree/master/gcc_debug_orig

The second call to strcasecmp is being removed in pass #200 during a DCE loop.


[Bug rtl-optimization/61509] GCC miscompilation on ARM during RTL optimization when compiled with -O3

2014-06-14 Thread quentusrex at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61509

--- Comment #2 from William King  ---
Created attachment 32939
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32939&action=edit
Source file for switch_core_media.c

Line 3356 is the strcasecmp that is being optimized out.


[Bug rtl-optimization/61509] GCC miscompilation on ARM during RTL optimization when compiled with -O3

2014-06-14 Thread quentusrex at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61509

--- Comment #3 from William King  ---
Line 7945 has the strcasecmp of the gcc output 'original' pass:
https://github.com/quentusrex/FS-6495/blob/master/gcc_debug_orig/switch_core_media.c.003t.original


[Bug rtl-optimization/61509] GCC miscompilation on ARM during RTL optimization when compiled with -O2

2014-06-14 Thread quentusrex at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61509

--- Comment #5 from William King  ---
Preprocessed file located here:
http://quentusrex.com/switch_core_media.c.preprocessed


[Bug rtl-optimization/61509] GCC miscompilation on ARM during RTL optimization when compiled with -O2

2014-06-17 Thread quentusrex at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61509

--- Comment #7 from William King  ---
While I haven't had a chance to run through more than a handful of call
scenarios, building FreeSWITCH on the Raspberry Pi with GCC 4.9.0 does not have
the same problem.