http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48377

           Summary: [4.6 regression] miscompilation at -O3
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: middle-end
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: m...@use.net


Created attachment 23827
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23827
tarball containing preprocessed output, valgrind warnings, and object files

With GCC 4.6.0, I get a crash, early in the startup of our system, when
compiling the system at –O3. This previously worked fine with GCC 4.5 and
4.4.5. Re-compiling only the top-most .cpp file in the crash's call stack with
–O2, and re-linking, fixes the crash. 


In the attached archive:

-console_urls.i, in which
Console_url_table::Add_url_to_category() calls url_map->Put(), which ends up
calling Hashcode() and crashes on a dereference of the 'wordp' variable
(*wordp++ & 0xdfdfdfdf). gdb claims wordp has been optimized out when we debug
the crash. 

-vg-*, which is the valgrind (3.6.1, using the ubuntu natty package) output at
each optimization level. I have been told that some of the warnings are false
positives, but the PPL and GMP ones I have never seen before. (For what it's
worth, I ran valgrind on 4.5.3 compiling the same file, and it had nothing to
report at all in GCC or related libraries.)

-build-cross-4.6.sh, which is the script I used to generate the toolchain and
contains package versions, configure commandlines, and build parameters for GCC
and all the supporting libraries. I tried downgrading a few of the libraries to
versions supplied in the sourceryg++ tarball, but it didn’t appear to fix the
issue. The 4.5.3 I tested (which did not have this bug) was compiled with a
similar script, and with all the same library versions.

My commandline:
g++
-Wa,-adlh=build_products/shared/x86_64/SOGS_native/release/gcc_v4.6.0/console_urls.s
 -pipe -m64 -minline-all-stringops -fvisibility-inlines-hidden -ggdb -g3 -fpic
-nostdinc -ftree-loop-linear -funroll-loops -march=opteron -Wa,-mtune=opteron
-Wchar-subscripts -Wreturn-type -Wunknown-pragmas -Wno-int-to-pointer-cast
-Wformat -Wformat-nonliteral -Wformat-security -Wpointer-arith -Wcast-align
-Wwrite-strings -Wsign-compare -Wunused-variable -Wunused-parameter
-Wparentheses -fasynchronous-unwind-tables -fno-enforce-eh-specs -fcheck-new
-O3 -fno-omit-frame-pointer -fno-strict-aliasing -fno-builtin-abort
-fno-builtin-calloc -fno-builtin-exit -fno-builtin-free -fno-builtin-malloc
-fno-builtin-realloc -fvisibility=default -fno-threadsafe-statics -Werror
-I/home/matt/src/clueboat/porkius/main/src/include/libc
-I/home/matt/src/clueboat/porkius/main/src/include/os
-I/home/matt/src/clueboat/porkius/main/src/include/hal/x86_64
-I/home/matt/src/clueboat/porkius/main/src/include/hal
-I/home/matt/src/clueboat/porkius/main/src/common/include
-I/home/matt/src/clueboat/porkius/main/src/common/portability/shared/include
-I/home/matt/src/clueboat/porkius/main/src/common/portability/shared/include
-I/home/matt/src/clueboat/porkius/main/src/common/include
-I/home/matt/src/clueboat/porkius/main/src/include/legacy
-I/home/matt/src/clueboat/porkius/main/src/network/stack/sys
-I/home/matt/src/clueboat/porkius/main/src/network/stack/local
-I/home/matt/src/clueboat/porkius/main/src/network/stack/include
-I../../monitoring
-I/home/matt/src/clueboat/porkius/main/objects/SOGS_x86_64_release/autogen/management/ami/SOGS/dml/include
-I/home/matt/src/clueboat/porkius/main/src/management/ami/SOGS/include
-I/home/matt/src/clueboat/porkius/main/src/management/ami/shared/include
-I/home/matt/src/clueboat/porkius/main/src/common/ami/dml/include
-I/home/matt/src/clueboat/porkius/toolchain/linux/x86_64_host/gcc-cross/x86_64_target/v4.6.0/x86_64-iscb-SOGS/include/c++/4.6.0
-I/home/matt/src/clueboat/porkius/toolchain/linux/x86_64_host/gcc-cross/x86_64_target/v4.6.0/x86_64-iscb-SOGS/include/c++/4.6.0/x86_64-iscb-SOGS
-DOPENSSL_FIPS -DSOGS_ANY -DSOGS_NATIVE -DSOGS_porkius
-DSOGS_TARGET_NAME=x86_64  
-DSOGS_SRC_ROOT="\"/home/matt/src/clueboat/porkius/main/src/util/shared/\"" -c
-O3 /home/matt/src/clueboat/porkius/main/src/util/shared/console_urls.cpp -o
/tmp/console_urls-O3.o

If there’s anything else you need from me to help debug/resolve this, please
let me know.

Reply via email to