Re: [PATCH 03/15] Add type information to struct instruction.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 23, 2008 at 3:23 AM, David Given <dg@xxxxxxxxxxx> wrote:
> I'm sure there's a better way of doing it, but I just couldn't find one!
> So if you can think of any way to clean all this up I'd be delighted.
> The underlying issue, BTW, is that OP_LOAD doesn't carry enough
> information in its arguments to determine the type of the instruction.

OK, if it is just for OP_LOAD. Will this attached patch solve your problem?

Instead of adding type to every instruction. It just add that for the OP_LOAD
instruction in insn->orig_type. If that works for you. I am very glad to reclaim
the space back on instruction structure.

> Incidentally, speaking of distinguishing arguments, one of the issues I
> have with Clue is that sparse can't distinguish between parameters of
> the different types but the same size in some situations --- e.g.:
>
> extern void foo(float i);
> ...
> foo(5);
>
> ...will call foo() with an *integer* parameter rather than a float one.
> This is preventing me doing certain optimisations (like being able to
> store ints in ints rather than doubles!). Is this related?

I think sparse should do the proper cast for you when you call
the function call. If it does not, that is a bug and we can fix it.

Please let me know if you can use the patch.

Chris

Attachment: load_type
Description: Binary data


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux