clangupc / clang-upc

Clang UPC Front-End
https://clangupc.github.io/
Other
16 stars 5 forks source link

3.8 - Intrepid's test04 fails to compile with 'struct' configuration #86

Closed nenadv closed 8 years ago

nenadv commented 8 years ago

I am getting internal error while compiling test04.upc.

Seems it fails if optimization with "-g" is specified (e.g. -g -O1).

piece covers entire variable
  call void @llvm.dbg.value(metadata i64 %p1.coerce0, i64 0, metadata !32, metadata !161), !dbg !162
!32 = !DILocalVariable(name: "p1", arg: 1, scope: !25, file: !1, line: 38, type: !15)
!161 = !DIExpression(DW_OP_bit_piece, 0, 64)
piece is larger than or outside of variable
  call void @llvm.dbg.value(metadata i32 %p1.sroa.2.8.extract.trunc, i64 0, metadata !32, metadata !163), !dbg !162
!32 = !DILocalVariable(name: "p1", arg: 1, scope: !25, file: !1, line: 38, type: !15)
nenadv commented 8 years ago

This is 'struct' pointer representation.

-fupc-pts=struct -O1 -g 
swatanabe commented 8 years ago

AMDG

On 05/02/2016 10:30 PM, Nenad Vukicevic wrote:

This is 'struct' pointer representation.

-fupc-pts=struct -O1 -g 

I can't reproduce this. Let me try a debug build.

In Christ, Steven Watanabe

nenadv commented 8 years ago

Yes, it is with the debug build.

BTW. Last night build/test completed without errors. All the testing was with Berkeley harness (self Clang UPC, upcc with upc2c and cupc options). But none of the configurations is using '-g' with optimization flags.

swatanabe commented 8 years ago

AMDG

On 05/03/2016 10:36 AM, Nenad Vukicevic wrote:

Yes, it is with the debug build.

BTW. Last night build/test completed without errors. All the testing was with Berkeley harness (self Clang UPC, upcc with upc2c and cupc options). But none of the configurations is using '-g' with optimization flags.

It looks like this is an old problem that previous versions of clang didn't detect. Basically, the debug info for pointers to shared is written as if they were pointers. This mostly works for the packed representation, but fails for -fupc-pts=struct because the size is wrong.

In Christ, Steven Watanabe