Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Both operands to a binary operator are not of the same type! #25

Closed
ariovistus opened this issue Nov 16, 2011 · 5 comments
Closed

Both operands to a binary operator are not of the same type! #25

ariovistus opened this issue Nov 16, 2011 · 5 comments

Comments

@ariovistus
Copy link

on fedora 16 x86_64, I compile me some code like so:

ldc2 dis.d ~/mercurial/my-deimos/wrapper/udis86.d -op -oq -of dis ~/mercurial/my-deimos/deimos/udis86.d

and for my labors, I am rewarded with err.. this:

mercurial/my-deimos/deimos/udis86.d: Error: module deimos.udis86 Both operands to a binary operator are not of the same type!
%tmp7 = or i8 %tmp6, i32 1
Instruction does not dominate all uses!
%tmp7 = or i8 %tmp6, i32 1
store i8 %tmp7, i8* %tmp5
Both operands to a binary operator are not of the same type!
%tmp12 = and i8 %tmp11, i32 -2
Instruction does not dominate all uses!
%tmp12 = and i8 %tmp11, i32 -2
store i8 %tmp12, i8* %tmp10
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Both operands to a binary operator are not of the same type!
%tmp7 = or i8 %tmp6, i32 2
Instruction does not dominate all uses!
%tmp7 = or i8 %tmp6, i32 2
store i8 %tmp7, i8* %tmp5
Both operands to a binary operator are not of the same type!
%tmp12 = and i8 %tmp11, i32 -3
Instruction does not dominate all uses!
%tmp12 = and i8 %tmp11, i32 -3
store i8 %tmp12, i8* %tmp10
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Both operands to a binary operator are not of the same type!
%tmp7 = or i8 %tmp6, i32 4
Instruction does not dominate all uses!
%tmp7 = or i8 %tmp6, i32 4
store i8 %tmp7, i8* %tmp5
Both operands to a binary operator are not of the same type!
%tmp12 = and i8 %tmp11, i32 -5
Instruction does not dominate all uses!
%tmp12 = and i8 %tmp11, i32 -5
store i8 %tmp12, i8* %tmp10
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Both operands to a binary operator are not of the same type!
%tmp7 = or i8 %tmp6, i32 8
Instruction does not dominate all uses!
%tmp7 = or i8 %tmp6, i32 8
store i8 %tmp7, i8* %tmp5
Both operands to a binary operator are not of the same type!
%tmp12 = and i8 %tmp11, i32 -9
Instruction does not dominate all uses!
%tmp12 = and i8 %tmp11, i32 -9
store i8 %tmp12, i8* %tmp10
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Both operands to a binary operator are not of the same type!
%tmp7 = or i8 %tmp6, i32 16
Instruction does not dominate all uses!
%tmp7 = or i8 %tmp6, i32 16
store i8 %tmp7, i8* %tmp5
Both operands to a binary operator are not of the same type!
%tmp12 = and i8 %tmp11, i32 -17
Instruction does not dominate all uses!
%tmp12 = and i8 %tmp11, i32 -17
store i8 %tmp12, i8* %tmp10
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.
Broken module found, compilation terminated.

@ariovistus
Copy link
Author

surely there must be a way to attach files.. deimos/udis86.d is rather large..

@Trass3r
Copy link
Contributor

Trass3r commented Nov 16, 2011

You could try to reduce it with DustMite.

@ariovistus
Copy link
Author

heh heh. dustmite crashes dmd 2.056 linux x86_64. perhaps we could use dustmite to figure out why dustmite is doing this?
ldc won't compile it, complaining about std.ascii not existing, but when you get rid of it dmd will compile it.

very handy tool though.

dis.d:

import wrapper.udis86;
import std.stdio;

void main(){
    UDis u = new UDis(File());
        writefln(u.asmstring);
}

deimos/udis86.d:

module deimos.udis86;

import std.stdio: FILE, File;
import std.conv: to;

    struct ud
    {
        char[]          insn_buffer;
    }

wrapper/udis86.d:

module wrapper.udis86;

import deimos.udis86;

class UDis{
    ud obj;
    this(File inf){
    }
        string asmstring(){
            return to!string(obj.insn_buffer.ptr);
        }
}

@dnadlinger
Copy link
Member

@mylodon: I edited your post to include GitHub code tags (```), now it is actually readable. ;)

I hope the Phobos dependencies are not needed, otherwise the sample needs further minification – copy Phobos over to your reduction directory, and move it to another package (replace all occurrences of std. with e.g. mystd.).

@dnadlinger
Copy link
Member

Seems to be fixed in master – please reopen if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants