Re: [RFC/PATCH] sparse, llvm: Fix string globals access

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

 



On Jun 8, 2012, at 4:39 PM, Pekka Enberg wrote:
> 
> Xi, so I guess your current work on linearize.c might fix the SIGSEGV
> I'm seeing?

I guess the problem is that sparse-llvm generates an incorrect type
`load i64*' in llvm from the sparse instruction load.64.

	load.64     %r2 <- 0[foo]
	call.32     %r1 <- puts, %r2
	ret.32      $0

With the new ->ctype in pseudo sparse-llvm should be able to generate
the correct type.  I am playing with an LLVM backend with typed pseudos;
it generates the following code, which seems okay.

@0 = internal global [7 x i8] c"Foo !\0A\00", align 1
@foo = internal global i8* getelementptr inbounds ([7 x i8]* @0, i64 0, i64 0), align 8

define i32 @main(i32 %argc, i8** %argv) {
entry:
  %0 = load i8** @foo
  %1 = call i32 @puts(i8* %0)
  ret i32 0
}

- xi--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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