Bug 61759 - [ICE] [objc++] reaching gcc_unreachable in objc_eh_runtime_type at objc/objc-next-runtime-abi-01.c
Summary: [ICE] [objc++] reaching gcc_unreachable in objc_eh_runtime_type at objc/objc-...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: objc++ (show other bugs)
Version: 5.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL: https://github.com/jackaudio/jack2/is...
Keywords: EH, ice-on-valid-code
: 66504 107530 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-09 12:49 UTC by Douglas Mencken
Modified: 2024-03-18 13:02 UTC (History)
5 users (show)

See Also:
Host: *-*-darwin
Target: powerpc-*-darwin, i686-*-darwin
Build: *-*-darwin
Known to work:
Known to fail: 4.8.3, 4.9.1, 4.9.2, 5.2.0, 8.0
Last reconfirmed: 2017-09-07 00:00:00


Attachments
preprocessed a11yselectionwrapper.mm (526.34 KB, application/octet-stream)
2014-07-09 12:50 UTC, Douglas Mencken
Details
preprocessed builder.cxx (465.25 KB, application/octet-stream)
2014-07-09 13:17 UTC, Douglas Mencken
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Douglas Mencken 2014-07-09 12:49:06 UTC
I cannot compile some LibreOffice .mm files using gcc-4.8.3 on OS X 10.5. Many of them fails with ICE when -O2 is used, but with -O(1) they compiles.

I cannot also compile .cxx files when -x objective-c++ is used on gcc line.

All of them ICE at the same spot: "in objc_eh_runtime_type, at objc/objc-next-runtime-abi-01.c:2792"

This one (vcl/osx/a11yselectionwrapper.mm) ICEs even with -O:

S=/lo-build && I=$S/instdir && W=$S/workdir &&  mkdir -p $W/ObjCxxObject/vcl/osx/ $W/Dep/ObjCxxObject/vcl/osx/ && cd /lo-build &&   /usr/bin/ccache g++ -save-temps -mmacosx-version-min=10.5 -DCPPU_ENV=gcc3 -DLIBO_INTERNAL_ONLY -DMACOSX -DMACOSX_SDK_VERSION=1050 -DMAC_OS_X_VERSION_MAX_ALLOWED=1050 -DMAC_OS_X_VERSION_MIN_REQUIRED=1050 -DNDEBUG -DNO_PTHREAD_PRIORITY -DOPTIMIZE -DOSL_DEBUG_LEVEL=0 -DPOWERPC -DPPC -DSUPD=440 -DUNIX -DUNX -D_PTHREADS -D_REENTRANT  -DRTL_USING   -DVCL_DLLIMPLEMENTATION -DCUI_DLL_NAME=\"libcuilo.dylib\" -DDESKTOP_DETECTOR_DLL_NAME=\"\" -DTK_DLL_NAME=\"libtklo.dylib\" -DVCLPLUG_SVP_DLL_NAME=\"\"  -DMACOSX_BUNDLE_IDENTIFIER=\"org.libreoffice.script\"   -DHAVE_GCC_VISIBILITY_FEATURE -fvisibility=hidden   -Wall -Wendif-labels -Wextra -Wundef -Wunused-macros -fmessage-length=0 -fno-common -pipe  -fno-threadsafe-statics -fPIC -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -fno-strict-aliasing -fsigned-char -std=gnu++11  -O   -c $S/vcl/osx/a11yselectionwrapper.mm -o $W/ObjCxxObject/vcl/osx/a11yselectionwrapper.o -MMD -MT $W/ObjCxxObject/vcl/osx/a11yselectionwrapper.o -MP -MF $W/Dep/ObjCxxObject/vcl/osx/a11yselectionwrapper.d_ -I$S/vcl/osx/ -I$W/UnpackedTarball/lcms2/include -I$W/UnpackedTarball/icu/source -I$W/UnpackedTarball/icu/source/i18n -I$W/UnpackedTarball/icu/source/common -I$W/UnpackedTarball/boost -I$W/UnpackedTarball/jpeg  -I$S/include  -isystem /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I$S/config_host  -I$W/CustomTarget/officecfg/registry -I$W/CustomTarget/vcl/generic/fontmanager -I$S/vcl/inc   -I$W/UnoApiHeadersTarget/udkapi/normal -I$W/UnoApiHeadersTarget/offapi/normal -I$W/CustomTarget/officecfg/registry  -I$W/UnpackedTarball/nss/dist/public/nss -I$W/UnpackedTarball/nss/dist/out/include      && mv $W/Dep/ObjCxxObject/vcl/osx/a11yselectionwrapper.d_ $W/Dep/ObjCxxObject/vcl/osx/a11yselectionwrapper.d

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/powerpc-unknown-darwin/4.8.3/lto-wrapper
Target: powerpc-unknown-darwin
Configured with: ../gcc-4.8.3/configure --build=powerpc-unknown-darwin --host=powerpc-unknown-darwin --target=powerpc-unknown-darwin --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man --with-slibdir=/usr/lib --program-prefix= --enable-languages=c,c++,objc,obj-c++ --enable-checking=release --enable-stage1-checking --enable-shared --enable-static --enable-threads=posix --with-__thread --with-system-zlib --disable-werror
Thread model: posix
gcc version 4.8.3 (GCC)
Comment 1 Douglas Mencken 2014-07-09 12:50:56 UTC
Created attachment 33094 [details]
preprocessed a11yselectionwrapper.mm

Attaching preprocessed a11yselectionwrapper.mm (a11yselectionwrapper.mii)
Comment 2 Douglas Mencken 2014-07-09 13:15:37 UTC
Also, there's builder.cxx (one of files which compiles after removing -x objective-c++ from line, but not with it):

S=/lo-build && I=$S/instdir && W=$S/workdir &&  mkdir -p $W/CxxObject/vcl/source/window/ $W/Dep/CxxObject/vcl/source/window/ && cd /lo-build &&   /usr/bin/ccache g++ -mmacosx-version-min=10.5 -DCPPU_ENV=gcc3 -DLIBO_INTERNAL_ONLY -DMACOSX -DMACOSX_SDK_VERSION=1050 -DMAC_OS_X_VERSION_MAX_ALLOWED=1050 -DMAC_OS_X_VERSION_MIN_REQUIRED=1050 -DNDEBUG -DNO_PTHREAD_PRIORITY -DOPTIMIZE -DOSL_DEBUG_LEVEL=0 -DPOWERPC -DPPC -DSUPD=440 -DUNIX -DUNX -D_PTHREADS -D_REENTRANT  -DRTL_USING   -DVCL_DLLIMPLEMENTATION -DCUI_DLL_NAME=\"libcuilo.dylib\" -DDESKTOP_DETECTOR_DLL_NAME=\"\" -DTK_DLL_NAME=\"libtklo.dylib\" -DVCLPLUG_SVP_DLL_NAME=\"\"  -DMACOSX_BUNDLE_IDENTIFIER=\"org.libreoffice.script\"   -DHAVE_GCC_VISIBILITY_FEATURE -fvisibility=hidden   -Wall -Wendif-labels -Wextra -Wundef -Wunused-macros -fmessage-length=0 -fno-common -pipe  -fno-threadsafe-statics -fPIC -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -fno-strict-aliasing -fsigned-char -std=gnu++11  -Wno-long-double  -DEXCEPTIONS_ON -fexceptions -fno-enforce-eh-specs -O2  -x objective-c++ -fobjc-exceptions  -c $S/vcl/source/window/builder.cxx -o $W/CxxObject/vcl/source/window/builder.o -MMD -MT $W/CxxObject/vcl/source/window/builder.o -MP -MF $W/Dep/CxxObject/vcl/source/window/builder.d_ -I$S/vcl/source/window/ -I$W/UnpackedTarball/lcms2/include -I$W/UnpackedTarball/icu/source -I$W/UnpackedTarball/icu/source/i18n -I$W/UnpackedTarball/icu/source/common -I$W/UnpackedTarball/boost -I$W/UnpackedTarball/jpeg  -I$S/include  -isystem /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers -I$S/config_host  -I$W/CustomTarget/officecfg/registry -I$W/CustomTarget/vcl/generic/fontmanager -I$S/vcl/inc   -I$W/UnoApiHeadersTarget/udkapi/normal -I$W/UnoApiHeadersTarget/offapi/normal -I$W/CustomTarget/officecfg/registry  -I$W/UnpackedTarball/nss/dist/public/nss -I$W/UnpackedTarball/nss/dist/out/include      && mv $W/Dep/CxxObject/vcl/source/window/builder.d_ $W/Dep/CxxObject/vcl/source/window/builder.d

** Error message:
vcl/source/window/builder.cxx: In member function 'void VclBuilder::loadTranslations(const LanguageTag&, const rtl::OUString&)':
vcl/source/window/builder.cxx:91:6: internal compiler error: in objc_eh_runtime_type, at objc/objc-next-runtime-abi-01.c:2792
 void VclBuilder::loadTranslations(const LanguageTag &rLanguageTag, const OUString& rUri)
      ^
libbacktrace could not find executable to open

** Error message for vcl/osx/a11yselectionwrapper.mm was:
./vcl/osx/a11yselectionwrapper.mm:31:61: internal compiler error: in objc_eh_runtime_type, at objc/objc-next-runtime-abi-01.c:2792
 +(id)selectedChildrenAttributeForElement:(AquaA11yWrapper *)wrapper
Comment 3 Douglas Mencken 2014-07-09 13:17:11 UTC
Created attachment 33095 [details]
preprocessed builder.cxx

Attaching preprocessed builder.cxx (builder.mii)
Comment 4 Douglas Mencken 2014-10-06 13:47:01 UTC
In 4.9.1, it's not :2792 but :2793 ---

vcl/osx/a11yselectionwrapper.cxx:31:61: internal compiler error: in objc_eh_runtime_type, at objc/objc-next-runtime-abi-01.c:2793
Comment 5 Douglas Mencken 2014-10-07 17:45:12 UTC
Now I know it's question about non-well-supported NeXT Objective C ABIs.

Will try -fgnu-runtime
Comment 6 Douglas Mencken 2015-10-02 01:05:58 UTC
Looks like I found the root of the issue ~
GCC ICEs when it meets C++ exception handling (try+catch)

$ cat main.mm
#include <Foundation/Foundation.h>
#include <iostream>

int main (void)
{
	try {
		throw 0;
	} catch (int & e) {
		std::cout << "caught" << std::endl;
	}

	NSString *name = @"GNUstep !";
	NSAutoreleasePool *pool;
	pool = [NSAutoreleasePool new];
	[pool drain];
}

$ g++ main.mm -o test.out -framework Foundation -lobjc
main.mm: In function 'int main()':
main.mm:4:5: internal compiler error: in objc_eh_runtime_type, at objc/objc-next-runtime-abi-01.c:2804
 int main (void)
     ^
libbacktrace could not find executable to open
Please submit a full bug report,
Comment 7 Eric Gallager 2017-07-23 21:11:36 UTC
(In reply to Douglas Mencken from comment #6)
> Looks like I found the root of the issue ~
> GCC ICEs when it meets C++ exception handling (try+catch)
> 
> $ cat main.mm
> #include <Foundation/Foundation.h>
> #include <iostream>
> 
> int main (void)
> {
> 	try {
> 		throw 0;
> 	} catch (int & e) {
> 		std::cout << "caught" << std::endl;
> 	}
> 
> 	NSString *name = @"GNUstep !";
> 	NSAutoreleasePool *pool;
> 	pool = [NSAutoreleasePool new];
> 	[pool drain];
> }
> 
> $ g++ main.mm -o test.out -framework Foundation -lobjc
> main.mm: In function 'int main()':
> main.mm:4:5: internal compiler error: in objc_eh_runtime_type, at
> objc/objc-next-runtime-abi-01.c:2804
>  int main (void)
>      ^
> libbacktrace could not find executable to open
> Please submit a full bug report,

This is similar to bug 35756 but since you have a different testcase I'll leave this open as a separate bug. Anyways, I think I have bad headers on my system, because my compiler chokes in that part:

$ /usr/local/bin/g++ 61759_main.mm -o test.out -framework Foundation -lobjc
In file included from /System/Library/Frameworks/Security.framework/Headers/Security.h:57:0,
                 from /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSSharedFileList.h:32,
                 from /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h:37,
                 from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:41,
                 from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:20,
                 from /System/Library/Frameworks/Foundation.framework/Headers/NSAppleEventDescriptor.h:8,
                 from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:107,
                 from 61759_main.mm:1:
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:102:46: error: shift expression ‘(1853123693 << 8)’ overflows [-fpermissive]
     kSecAuthenticationTypeNTLM             = AUTH_TYPE_FIX_ ('ntlm'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:102:46: error: enumerator value for ‘kSecAuthenticationTypeNTLM’ is not an integer constant
     kSecAuthenticationTypeNTLM             = AUTH_TYPE_FIX_ ('ntlm'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:103:46: error: shift expression ‘(1836281441 << 8)’ overflows [-fpermissive]
     kSecAuthenticationTypeMSN              = AUTH_TYPE_FIX_ ('msna'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:103:46: error: enumerator value for ‘kSecAuthenticationTypeMSN’ is not an integer constant
     kSecAuthenticationTypeMSN              = AUTH_TYPE_FIX_ ('msna'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:104:46: error: shift expression ‘(1685086561 << 8)’ overflows [-fpermissive]
     kSecAuthenticationTypeDPA              = AUTH_TYPE_FIX_ ('dpaa'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:104:46: error: enumerator value for ‘kSecAuthenticationTypeDPA’ is not an integer constant
     kSecAuthenticationTypeDPA              = AUTH_TYPE_FIX_ ('dpaa'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:105:46: error: shift expression ‘(1919967585 << 8)’ overflows [-fpermissive]
     kSecAuthenticationTypeRPA              = AUTH_TYPE_FIX_ ('rpaa'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:105:46: error: enumerator value for ‘kSecAuthenticationTypeRPA’ is not an integer constant
     kSecAuthenticationTypeRPA              = AUTH_TYPE_FIX_ ('rpaa'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:106:46: error: shift expression ‘(1752462448 << 8)’ overflows [-fpermissive]
     kSecAuthenticationTypeHTTPBasic        = AUTH_TYPE_FIX_ ('http'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:106:46: error: enumerator value for ‘kSecAuthenticationTypeHTTPBasic’ is not an integer constant
     kSecAuthenticationTypeHTTPBasic        = AUTH_TYPE_FIX_ ('http'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:107:46: error: shift expression ‘(1752462436 << 8)’ overflows [-fpermissive]
     kSecAuthenticationTypeHTTPDigest       = AUTH_TYPE_FIX_ ('httd'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:107:46: error: enumerator value for ‘kSecAuthenticationTypeHTTPDigest’ is not an integer constant
     kSecAuthenticationTypeHTTPDigest       = AUTH_TYPE_FIX_ ('httd'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:108:46: error: shift expression ‘(1718579821 << 8)’ overflows [-fpermissive]
     kSecAuthenticationTypeHTMLForm         = AUTH_TYPE_FIX_ ('form'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:108:46: error: enumerator value for ‘kSecAuthenticationTypeHTMLForm’ is not an integer constant
     kSecAuthenticationTypeHTMLForm         = AUTH_TYPE_FIX_ ('form'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:109:46: error: shift expression ‘(1684434036 << 8)’ overflows [-fpermissive]
     kSecAuthenticationTypeDefault          = AUTH_TYPE_FIX_ ('dflt'),
                                              ^
/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:109:46: error: enumerator value for ‘kSecAuthenticationTypeDefault’ is not an integer constant
     kSecAuthenticationTypeDefault          = AUTH_TYPE_FIX_ ('dflt'),
                                              ^
In file included from /usr/local/include/c++/8.0.0/bits/ios_base.h:46:0,
                 from /usr/local/include/c++/8.0.0/ios:42,
                 from /usr/local/include/c++/8.0.0/ostream:38,
                 from /usr/local/include/c++/8.0.0/iostream:39,
                 from 61759_main.mm:2:
/usr/local/include/c++/8.0.0/system_error:191:23: internal compiler error: Bus error
     explicit operator bool() const noexcept
                       ^~~~
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.

And my ICE looks similar to the one I get in bug 57607 which also includes the c++ <iostream> header...
Comment 8 Eric Gallager 2017-09-07 16:23:05 UTC
(In reply to Eric Gallager from comment #7)
> (In reply to Douglas Mencken from comment #6)
> > Looks like I found the root of the issue ~
> > GCC ICEs when it meets C++ exception handling (try+catch)
> > 
> > $ cat main.mm
> > #include <Foundation/Foundation.h>
> > #include <iostream>
> > 
> > int main (void)
> > {
> > 	try {
> > 		throw 0;
> > 	} catch (int & e) {
> > 		std::cout << "caught" << std::endl;
> > 	}
> > 
> > 	NSString *name = @"GNUstep !";
> > 	NSAutoreleasePool *pool;
> > 	pool = [NSAutoreleasePool new];
> > 	[pool drain];
> > }
> > 
> > $ g++ main.mm -o test.out -framework Foundation -lobjc
> > main.mm: In function 'int main()':
> > main.mm:4:5: internal compiler error: in objc_eh_runtime_type, at
> > objc/objc-next-runtime-abi-01.c:2804
> >  int main (void)
> >      ^
> > libbacktrace could not find executable to open
> > Please submit a full bug report,
> 
> This is similar to bug 35756 but since you have a different testcase I'll
> leave this open as a separate bug. Anyways, I think I have bad headers on my
> system, because my compiler chokes in that part:
> 
> $ /usr/local/bin/g++ 61759_main.mm -o test.out -framework Foundation -lobjc
> In file included from
> /System/Library/Frameworks/Security.framework/Headers/Security.h:57:0,
>                  from
> /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.
> framework/Headers/LSSharedFileList.h:32,
>                  from
> /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.
> framework/Headers/LaunchServices.h:37,
>                  from
> /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:41,
>                  from
> /System/Library/Frameworks/ApplicationServices.framework/Headers/
> ApplicationServices.h:20,
>                  from
> /System/Library/Frameworks/Foundation.framework/Headers/
> NSAppleEventDescriptor.h:8,
>                  from
> /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:107,
>                  from 61759_main.mm:1:
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:102:46:
> error: shift expression ‘(1853123693 << 8)’ overflows [-fpermissive]
>      kSecAuthenticationTypeNTLM             = AUTH_TYPE_FIX_ ('ntlm'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:102:46:
> error: enumerator value for ‘kSecAuthenticationTypeNTLM’ is not an integer
> constant
>      kSecAuthenticationTypeNTLM             = AUTH_TYPE_FIX_ ('ntlm'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:103:46:
> error: shift expression ‘(1836281441 << 8)’ overflows [-fpermissive]
>      kSecAuthenticationTypeMSN              = AUTH_TYPE_FIX_ ('msna'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:103:46:
> error: enumerator value for ‘kSecAuthenticationTypeMSN’ is not an integer
> constant
>      kSecAuthenticationTypeMSN              = AUTH_TYPE_FIX_ ('msna'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:104:46:
> error: shift expression ‘(1685086561 << 8)’ overflows [-fpermissive]
>      kSecAuthenticationTypeDPA              = AUTH_TYPE_FIX_ ('dpaa'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:104:46:
> error: enumerator value for ‘kSecAuthenticationTypeDPA’ is not an integer
> constant
>      kSecAuthenticationTypeDPA              = AUTH_TYPE_FIX_ ('dpaa'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:105:46:
> error: shift expression ‘(1919967585 << 8)’ overflows [-fpermissive]
>      kSecAuthenticationTypeRPA              = AUTH_TYPE_FIX_ ('rpaa'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:105:46:
> error: enumerator value for ‘kSecAuthenticationTypeRPA’ is not an integer
> constant
>      kSecAuthenticationTypeRPA              = AUTH_TYPE_FIX_ ('rpaa'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:106:46:
> error: shift expression ‘(1752462448 << 8)’ overflows [-fpermissive]
>      kSecAuthenticationTypeHTTPBasic        = AUTH_TYPE_FIX_ ('http'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:106:46:
> error: enumerator value for ‘kSecAuthenticationTypeHTTPBasic’ is not an
> integer constant
>      kSecAuthenticationTypeHTTPBasic        = AUTH_TYPE_FIX_ ('http'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:107:46:
> error: shift expression ‘(1752462436 << 8)’ overflows [-fpermissive]
>      kSecAuthenticationTypeHTTPDigest       = AUTH_TYPE_FIX_ ('httd'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:107:46:
> error: enumerator value for ‘kSecAuthenticationTypeHTTPDigest’ is not an
> integer constant
>      kSecAuthenticationTypeHTTPDigest       = AUTH_TYPE_FIX_ ('httd'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:108:46:
> error: shift expression ‘(1718579821 << 8)’ overflows [-fpermissive]
>      kSecAuthenticationTypeHTMLForm         = AUTH_TYPE_FIX_ ('form'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:108:46:
> error: enumerator value for ‘kSecAuthenticationTypeHTMLForm’ is not an
> integer constant
>      kSecAuthenticationTypeHTMLForm         = AUTH_TYPE_FIX_ ('form'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:109:46:
> error: shift expression ‘(1684434036 << 8)’ overflows [-fpermissive]
>      kSecAuthenticationTypeDefault          = AUTH_TYPE_FIX_ ('dflt'),
>                                               ^
> /System/Library/Frameworks/Security.framework/Headers/SecKeychain.h:109:46:
> error: enumerator value for ‘kSecAuthenticationTypeDefault’ is not an
> integer constant
>      kSecAuthenticationTypeDefault          = AUTH_TYPE_FIX_ ('dflt'),
>                                               ^
> In file included from /usr/local/include/c++/8.0.0/bits/ios_base.h:46:0,
>                  from /usr/local/include/c++/8.0.0/ios:42,
>                  from /usr/local/include/c++/8.0.0/ostream:38,
>                  from /usr/local/include/c++/8.0.0/iostream:39,
>                  from 61759_main.mm:2:
> /usr/local/include/c++/8.0.0/system_error:191:23: internal compiler error:
> Bus error
>      explicit operator bool() const noexcept
>                        ^~~~
> 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.
> 
> And my ICE looks similar to the one I get in bug 57607 which also includes
> the c++ <iostream> header...

This error has now disappeared for me, so I can now confirm that I'm getting the same ICE that you originally reported:

$ /usr/local/bin/g++ 61759_main.mm -fpermissive -o 61759.exe -framework Foundation -lobjc
during GIMPLE pass: eh
61759_main.mm: In function ‘int main()’:
61759_main.mm:4:5: internal compiler error: in objc_eh_runtime_type, at objc/objc-next-runtime-abi-01.c:2793
 int main (void)
     ^~~~
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.
$

Running in gdb gives this backtrace:

Breakpoint 1, 0x00e60154 in internal_error ()
(gdb) bt
#0  0x00e60154 in internal_error ()
#1  0x014954c5 in fancy_abort ()
#2  0x0118edd7 in objc_eh_runtime_type ()
#3  0x0076e69e in add_type_for_runtime ()
#4  0x0076e715 in gen_eh_region_catch ()
#5  0x00ba90de in lower_eh_constructs_1 ()
#6  0x00baa7fb in (anonymous namespace)::pass_lower_eh::execute ()
#7  0x00a5b2e0 in execute_one_pass ()
#8  0x00a5bba0 in execute_pass_list_1 ()
#9  0x00a5bbee in execute_pass_list ()
#10 0x0067ecb9 in cgraph_node::analyze ()
#11 0x006819ef in analyze_functions ()
#12 0x006829d2 in symbol_table::finalize_compilation_unit ()
#13 0x00b4638b in compile_file ()
#14 0x01af141b in toplev::main ()
#15 0x01af2a24 in main ()
(gdb)

I'd need to rebuild gcc with debug info to get a better backtrace.
Comment 9 Eric Gallager 2018-10-28 17:00:36 UTC
*** Bug 66504 has been marked as a duplicate of this bug. ***
Comment 10 Eric Gallager 2019-10-28 04:11:21 UTC
cc-ing objc[++] maintainers
Comment 11 Andrew Pinski 2022-11-05 02:04:04 UTC
*** Bug 107530 has been marked as a duplicate of this bug. ***
Comment 12 Sergey Fedorov 2022-11-05 02:14:15 UTC
(In reply to Andrew Pinski from comment #11)
> *** Bug 107530 has been marked as a duplicate of this bug. ***

I.e. gcc12 has the same bug too.
Comment 13 Sergey Fedorov 2023-07-30 10:07:42 UTC
Any update on this?
Comment 14 Sergey Fedorov 2023-07-30 10:11:55 UTC
(In reply to Eric Gallager from comment #8)

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

Have you been able to?
Comment 15 Iain Sandoe 2023-07-30 11:26:36 UTC
(In reply to Sergey Fedorov from comment #14)
> (In reply to Eric Gallager from comment #8)

With current trunk on a cross to powerpc-apple-darwin9 this reproduces for the runtime ABI 01 - which is used on 32b Darwin. (i.e the code compiles fine for '-m64')

A guess would be that we have a conflict between C++ exception handling (DWARF unwinding) and runtime-abi-01 exception handling (set jump / long jump).  Probably, there needs to be some way to flag which kind of exception is present.

For runtime ABI 02 (64bit) this should not happen - so the only really affected targets are 32b powerpc and i686 Darwin.

===== backtrace for curent trunk:

  * frame #0: 0x00000001021b78a5 cc1objplus`internal_error(gmsgid="in %s, at %s:%d") at diagnostic.cc:2166:25
    frame #1: 0x00000001021b7d8b cc1objplus`fancy_abort(file="/src-local/gcc-master/gcc/objc/objc-next-runtime-abi-01.cc", line=2795, function="objc_eh_runtime_type") at diagnostic.cc:2296:18
    frame #2: 0x000000010003dab7 cc1objplus`::objc_eh_runtime_type(type=0x000000011401c5e8) at objc-next-runtime-abi-01.cc:2795:3
    frame #3: 0x00000001011501ad cc1objplus`add_type_for_runtime(type=0x000000011401c5e8) at except.cc:683:40
    frame #4: 0x000000010114f8c4 cc1objplus`gen_eh_region_catch(t=0x0000000117c3b318, type_or_list=0x000000011401c5e8) at except.cc:424:23
    frame #5: 0x0000000101a400bb cc1objplus`::lower_catch(state=0x0000000309267190, tp=0x000000014813f690) at tree-eh.cc:1815:31
    frame #6: 0x0000000101a40cfe cc1objplus`::lower_eh_constructs_2(state=0x0000000309267190, gsi=0x0000000309267140) at tree-eh.cc:2107:27
    frame #7: 0x0000000101a40e17 cc1objplus`::lower_eh_constructs_1(state=0x0000000309267190, pseq=0x0000000309267188) at tree-eh.cc:2153:27
    frame #8: 0x0000000101a40f46 cc1objplus`pass_lower_eh::execute(this=0x000060000260c540, fun=0x00000001480e8678) const at tree-eh.cc:2198:25
    frame #9: 0x00000001017b5131 cc1objplus`execute_one_pass(pass=0x000060000260c540) at passes.cc:2641:30
    frame #10: 0x00000001017b5570 cc1objplus`::execute_pass_list_1(pass=0x000060000260c540) at passes.cc:2750:28
    frame #11: 0x00000001017b5607 cc1objplus`execute_pass_list(fn=0x00000001480e8678, pass=0x000060000260c240) at passes.cc:2761:23
    frame #12: 0x0000000100fe00c4 cc1objplus`cgraph_node::analyze(this=0x0000000148128990) at cgraphunit.cc:694:22
    frame #13: 0x0000000100fe23d1 cc1objplus`::analyze_functions(first_time=true) at cgraphunit.cc:1247:18
    frame #14: 0x0000000100fe5ed4 cc1objplus`symbol_table::finalize_compilation_unit(this=0x0000000114006000) at cgraphunit.cc:2554:21
    frame #15: 0x0000000101987ad5 cc1objplus`::compile_file() at toplev.cc:471:41
    frame #16: 0x000000010198b4f0 cc1objplus`::do_compile(no_backend=false) at toplev.cc:2126:24
    frame #17: 0x000000010198ba34 cc1objplus`toplev::main(this=0x000000030926751a, argc=16, argv=0x0000000309267668) at toplev.cc:2282:18
    frame #18: 0x0000000102187a64 cc1objplus`main(argc=16, argv=0x0000000309267668) at main.cc:39:23
Comment 16 Sergey Fedorov 2023-07-30 12:11:47 UTC
(In reply to Iain Sandoe from comment #15)

Would be nice to have it fixed, otherwise `jack` is broken: https://github.com/jackaudio/jack2/issues/950
Which, in turn, leaves broken dependencies.
Comment 17 Sergey Fedorov 2024-03-18 13:02:30 UTC
(In reply to Iain Sandoe from comment #15)

Iain, any chance of addressing this one?

If would have really helped with quite a number of usable software for PowerPC (majority of which are 32-bit, and even on G5 not all software support ppc64 anyway).