Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
Bug 6 - ARM: Illegal instruction in runnable/aliasthis.d and with -O2
Summary: ARM: Illegal instruction in runnable/aliasthis.d and with -O2
Status: RESOLVED FIXED
Alias: None
Product: GDC
Classification: Unclassified
Component: gdc (show other bugs)
Version: development
Hardware: ARM Linux
: --- normal
Assignee: Iain Buclaw
URL:
Depends on:
Blocks:
 
Reported: 2012-09-24 16:24 CEST by Johannes Pfau
Modified: 2012-09-24 19:43 CEST (History)
0 users

See Also:


Attachments
Reduced test case (334 bytes, text/x-dsrc)
2012-09-24 16:24 CEST, Johannes Pfau
Details
gdb backtrace (2.01 KB, text/plain)
2012-09-24 16:24 CEST, Johannes Pfau
Details
gdc -v ouput / system info (855 bytes, text/plain)
2012-09-24 16:25 CEST, Johannes Pfau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Pfau 2012-09-24 16:24:14 CEST
Created attachment 1 [details]
Reduced test case

The test suite fails on runnable/aliasthis.d on ARM with an "Illegal instruction" message.

This does not happen on x86/x86-64.
Probably triggered by libgcc (unwinder) and a cross platform bug?

A reduced test case, the gdb backtrace and gdc -v is attached.
Comment 1 Johannes Pfau 2012-09-24 16:24:50 CEST
Created attachment 2 [details]
gdb backtrace
Comment 2 Johannes Pfau 2012-09-24 16:25:18 CEST
Created attachment 3 [details]
gdc -v ouput / system info
Comment 3 Johannes Pfau 2012-09-24 16:36:47 CEST
Actually seems to happen for any assert or thrown Exception. I remember Exceptions where working some time ago, so this is probably an error in my gdc / gcc configuration.
Comment 4 Iain Buclaw 2012-09-24 18:22:52 CEST
As this occurs in a libgcc .S file, yes it does seem like a configuration problem let's have a look and see what causes that illegal instruction to be ran...
Comment 5 Iain Buclaw 2012-09-24 18:28:50 CEST
That particular assembly code is intended for !__ARM_ARCH_6M__ systems.
Comment 6 Iain Buclaw 2012-09-24 18:34:46 CEST
Having a look at gcc-4.8/gcc/config/arm/arm-arches.def

Perhaps you need to reconfigure with --with-arch=armv6-m  or armv6s-m for soft float.

Regards
Iain.
Comment 7 Iain Buclaw 2012-09-24 18:36:22 CEST
(In reply to comment #6)
> Having a look at gcc-4.8/gcc/config/arm/arm-arches.def
> 
> Perhaps you need to reconfigure with --with-arch=armv6-m  or armv6s-m for soft
> float.
> 

At least, I assume the 's' bit means soft. ;)
Comment 8 Johannes Pfau 2012-09-24 18:55:19 CEST
No, I think it's a gdc bug. I think something recently broke the ARM EABI unwinder. The gcc executable from the same build as the gdc executable works. And the version (GNU_ARM_EABI_Unwinder) is not set, although it is detected by configure and DCFG_ARM_EABI_UNWINDER is set to "GNU_ARM_EABI_Unwinder".

Seems the reason is this commit:
https://github.com/D-Programming-GDC/gdc/commit/ffed7d684e94d2b933a7d2f27403d8fb7de65314

DCFG_ARM_EABI_UNWINDER=GNU_ARM_EABI_Unwinder ends up in the toplevel phobos-ver-syms file, but not in libdruntime/phobos-ver-syms. Seems the libdruntime/phobos-ver-syms.in file wasn't updated in https://github.com/D-Programming-GDC/gdc/commit/ffed7d684e94d2b933a7d2f27403d8fb7de65314


I'm not sure if using the wrong unwinder can have such an effect. But I looked at the exception handling code in libgcc and there's no reason why it would work for c++ but not form gdc, unless we corrupt the context in the personality routine.
Comment 9 Johannes Pfau 2012-09-24 19:43:17 CEST
yep, that was the problem. Fix: https://github.com/D-Programming-GDC/gdc/pull/31