linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sparse-llvm error in GEP offset
@ 2017-03-12 15:01 Dibyendu Majumdar
  2017-03-12 17:31 ` Luc Van Oostenryck
  0 siblings, 1 reply; 2+ messages in thread
From: Dibyendu Majumdar @ 2017-03-12 15:01 UTC (permalink / raw)
  To: Linux-Sparse

Hi,

The memops offset field in sparse linearized instruction is unsigned,
which is causing invalid memory access in sparse-llvm. A workaround
for this is to cast the offset to int in calc_memop_addr() function in
sparse-llvm:

 off = LLVMConstInt(int_type, (int) insn->offset, 0);

However, perhaps the offset should not be unsigned in the first place.

Regards
Dibyendu

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sparse-llvm error in GEP offset
  2017-03-12 15:01 sparse-llvm error in GEP offset Dibyendu Majumdar
@ 2017-03-12 17:31 ` Luc Van Oostenryck
  0 siblings, 0 replies; 2+ messages in thread
From: Luc Van Oostenryck @ 2017-03-12 17:31 UTC (permalink / raw)
  To: Dibyendu Majumdar; +Cc: Linux-Sparse

On Sun, Mar 12, 2017 at 03:01:23PM +0000, Dibyendu Majumdar wrote:
> Hi,
> 
> The memops offset field in sparse linearized instruction is unsigned,
> which is causing invalid memory access in sparse-llvm. A workaround
> for this is to cast the offset to int in calc_memop_addr() function in
> sparse-llvm:
> 
>  off = LLVMConstInt(int_type, (int) insn->offset, 0);
> 
> However, perhaps the offset should not be unsigned in the first place.

I think so, yes.

-- Luc 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-12 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-12 15:01 sparse-llvm error in GEP offset Dibyendu Majumdar
2017-03-12 17:31 ` Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).