DMD Backend: Deciding instructions to use/avoid?

Jacob Carlborg doob at me.com
Sat Jun 4 03:07:40 PDT 2011


On 2011-06-04 11:36, Nick Sabalausky wrote:
> I'm working with Jacob to try to resolve an issue where D programs compiled
> on his Ubuntu box (in 32-bit/32-bit) error out on my Ubuntu box with
> "Illegal instruction". At first we thought it was because my OS was an older
> version than his. But he tried compiling on an older OS than mine and it
> still didn't work. So now I'm wondering if it may really be just like the
> message seems to imply: an illegal CPU instruction.

Actually, the Ubuntu 6.06 box is 64bit. Don't remember if I compiled 
with a 32bit or 64bit DMD. But anyway, it works on my Ubuntu 11.04 box 
that is 32bit.

> So my main question: Does DMD do anything like, say, detecting the CPU at
> compile time and then enabling instructions only available on that CPU and
> up? Or does it do anything like always assuming the target CPU has SSE2?
> Anything like that that could cause differences between our CPUs to result
> in object code that will work on one of the CPUs, but not the other? FWIW,
> the CPU on my linux box is i686, so it's not like I'm on some
> super-ultra-old i586, or anything like that.

I'm having an Intel Core 2 Duo. Don't know if it helps but when I run 
the pre-compiled DMD on the 6.06 box I get an errors message similar to: 
"Floating point exception".

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list