[Bug objc/80949] New: ICE in do_warn_duplicated_branches_r

egall at gwmail dot gwu.edu gcc-bugzilla@gcc.gnu.org
Fri Jun 2 02:56:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80949

            Bug ID: 80949
           Summary: ICE in do_warn_duplicated_branches_r
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: diagnostic, ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: objc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: egall at gwmail dot gwu.edu
  Target Milestone: ---
              Host: i386-apple-darwin9.8.0
            Target: i386-apple-darwin9.8.0
             Build: i386-apple-darwin9.8.0

Created attachment 41447
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41447&action=edit
compressed preprocessed source

Compiling my fork of emacs led to a new ICE with my latest pull from trunk.
Full command line:

/usr/local/bin/gcc -c -DMAC_OSX=1   -DXASSERTS=1 -Demacs  -I.
-I/var/root/emacs/src -I../lib -I/var/root/emacs/src/../lib  -DMAC_OSX=1
-isystem /usr/X11/include  -fno-strict-aliasing  -isystem /sw/include/librsvg-2
-isystem /sw/include/glib-2.0 -isystem /sw/lib/glib-2.0/include -isystem
/sw/include/gtk-2.0 -isystem /sw/include/cairo -isystem /sw/include -isystem
/sw/include/freetype2 -isystem /usr/X11/include -isystem
/sw/include/ImageMagick    -isystem /sw/include/libxml2 -isystem /sw/include
-isystem /sw/include/dbus-1.0 -isystem /sw/lib/dbus-1.0/include         
-isystem /sw/include    -fno-common -Wabi -Waddress
-Waggressive-loop-optimizations -Wall -Wattributes -Wbool-compare
-Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wchkp -Wclobbered
-Wcomment -Wcoverage-mismatch -Wcpp -Wdate-time -Wdeprecated
-Wdeprecated-declarations -Wdesignated-init -Wdisabled-optimization
-Wdiscarded-array-qualifiers -Wdiscarded-qualifiers -Wdiv-by-zero
-Wdouble-promotion -Wduplicated-cond -Wempty-body -Wendif-labels -Wenum-compare
-Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-security
-Wformat-signedness -Wformat-y2k -Wformat-zero-length -Wframe-address
-Wfree-nonheap-object -Whsa -Wimplicit -Wimplicit-function-declaration
-Wimplicit-int -Wincompatible-pointer-types -Winit-self -Wint-conversion
-Wint-to-pointer-cast -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init
-Wlogical-not-parentheses -Wmain -Wmaybe-uninitialized -Wmemset-transposed-args
-Wmisleading-indentation -Wmissing-braces -Wmissing-declarations
-Wmissing-include-dirs -Wmissing-parameter-type -Wmissing-prototypes
-Wmultichar -Wnarrowing -Wnonnull -Wnonnull-compare -Wnull-dereference
-Wold-style-declaration -Wold-style-definition -Woverflow -Woverlength-strings
-Woverride-init -Wpacked -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith
-Wpointer-sign -Wpointer-to-int-cast -Wpragmas -Wreturn-local-addr
-Wreturn-type -Wscalar-storage-order -Wsequence-point -Wshift-count-negative
-Wshift-count-overflow -Wshift-negative-value -Wsizeof-array-argument
-Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-prototypes
-Wsuggest-attribute=const -Wsuggest-attribute=format
-Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types
-Wswitch-bool -Wswitch-default -Wtautological-compare -Wtrampolines -Wtrigraphs
-Wuninitialized -Wunknown-pragmas -Wunsafe-loop-optimizations -Wunused
-Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function
-Wunused-label -Wunused-local-typedefs -Wunused-macros -Wunused-result
-Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros
-Wvector-operation-performance -Wvolatile-register-var -Wwrite-strings
-Warray-bounds=2 -Wnormalized=nfc -Wshift-overflow=2 -Wunused-const-variable=2
-Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -Wno-switch
-Wno-unused-parameter -Wno-format-nonliteral -Wno-logical-op
-Wnonportable-cfstrings -Wstrict-overflow=1 -Wdeclaration-after-statement
-Wmissing-noreturn -Wunreachable-code -Woverride-init-side-effects
-Wshift-overflow=2 -Wdangling-else -Wduplicate-decl-specifier -Wmemset-elt-size
-Wswitch-unreachable -Wimplicit-fallthrough -Wformat-overflow=2
-Wformat-truncation=2 -Wstringop-overflow=2 -Wexpansion-to-defined -Wrestrict
-Wint-in-bool-context -Wpointer-compare -Wbool-operation -Wduplicated-branches
-Walloca-larger-than=16384 -Wvla-larger-than=16384
-Walloc-size-larger-than=32840 -Walloc-zero -Wpsabi
-Wbuiltin-declaration-mismatch -fno-eliminate-unused-debug-symbols
-fno-crossjumping -fno-delete-dead-exceptions -fno-delete-null-pointer-checks
-fno-isolate-erroneous-paths-dereference -fno-omit-frame-pointer
-fno-optimize-sibling-calls -fno-optimize-strlen -fno-sched-spec-load-dangerous
-fno-split-wide-types -fbounds-check -fcheck-data-deps -fexceptions
-fstack-check -ftrapv -fvar-tracking -fvar-tracking-assignments -gpubnames
-gstrict-dwarf -falign-functions=4 -falign-labels=4 -falign-loops=4
-falign-jumps=4 -ggdb3 -Og -gdwarf-2 -gfull -mfix-and-continue 
-fobjc-exceptions   -Wassign-intercept -Wcast-align -Wproperty-assign-default
-Wprotocol -Wshadow-ivar -Wundeclared-selector -Wno-missing-noreturn
-Wno-overlength-strings \
   nsselect.m
nsselect.m: In function ‘ns_string_from_pasteboard’:
nsselect.m:303:1: internal compiler error: Bus error
 }
 ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
make: *** [nsselect.o] Error 1


Adding -wrapper gdb,--args allows me to get this backtrace:

. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x0015c45d in do_warn_duplicated_branches_r ()
(gdb) bt
#0  0x0015c45d in do_warn_duplicated_branches_r ()
#1  0x00dfdd62 in walk_tree_1 ()
#2  0x00dfe2f4 in walk_tree_1 ()
#3  0x00dfe2f4 in walk_tree_1 ()
#4  0x00dfe2f4 in walk_tree_1 ()
#5  0x00dfd8ae in walk_tree_without_duplicates_1 ()
#6  0x0011ed29 in c_genericize ()
#7  0x00056e19 in finish_function ()
#8  0x000c92d0 in c_parser_declaration_or_fndef ()
#9  0x000d1467 in c_parser_external_declaration ()
#10 0x000d1ee0 in c_parse_file ()
#11 0x0012c4fb in c_common_parse_file ()
#12 0x00ad99d5 in compile_file ()
#13 0x017cf25f in toplev::main ()
#14 0x017d0cd4 in main ()


I'd have to rebuild gcc with debug info to get a better backtrace...

Version info for the gcc I'm using:

$ /usr/local/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i386-apple-darwin9.8.0/8.0.0/lto-wrapper
Target: i386-apple-darwin9.8.0
Configured with: ../configure --disable-werror --disable-werror-always
--enable-languages=c,c++,lto,objc,obj-c++ --enable-stage1-checking=release,rtl
-C --with-system-libunwind --enable-secureplt --enable-frame-pointer
--enable-debug --with-isl --disable-host-shared --enable-maintainer-mode
--disable-default-pie --with-ld64 --without-pic --enable-target-optspace
CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ AUTOCONF=/usr/local/bin/autoconf
AUTOHEADER=/usr/local/bin/autoheader AUTORECONF=/usr/local/bin/autoreconf
AUTOM4TE=/usr/local/bin/autom4te AUTOSCAN=/usr/local/bin/autoscan
AUTOUPDATE=/usr/local/bin/autoupdate IFNAMES=/usr/local/bin/ifnames
Thread model: posix
gcc version 8.0.0 20170601 (experimental) (GCC)


More information about the Gcc-bugs mailing list