llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Error "Non-constant offsets error are not supported" parsing assembly with comments

Open goussepi opened this issue 10 years ago • 6 comments

Bugzilla Link 28547
Resolution FIXED
Resolved on Jul 15, 2016 04:18
Version trunk
OS Windows NT
CC @pogo59

Extended Description

clang 3.9 @​275278


repro.asm:

.intel_syntax vmovaps xmm15, xmmword ptr [rip+ones] # +1.0, +1.0, +1.0, +1.0

$ clang -c repro.asm repro.asm:2:39: error: Non-constant offsets are not supported! vmovaps xmm15, xmmword ptr [rip+ones] # +1.0, +1.0, +1.0, +1.0 ^

This seems to have been introduced by r273007 which introduce a change to how "CPPHash Directives" are handled during assembly parsing.

goussepi avatar Jul 14 '16 11:07 goussepi

Fixed in rL275445.

Much appreciated thanks!

goussepi avatar Jul 15 '16 11:07 goussepi

Fixed in rL275445.

llvmbot avatar Jul 14 '16 19:07 llvmbot

Oh wow.

This is definitely a Parsing bug. Apparently the existence of a "." in the comment is causing this.

llvmbot avatar Jul 14 '16 16:07 llvmbot

This is largely correct as "ones" is not defined.

The confusion arises from the error erronously pointing to the end-on-line comment instead of the reference to [rip+ones].

Hi Nirav, thanks for looking into this!

The strange thing is that in my case, if the # comment is removed then no errors is printed. Also if I add a definition for 'ones' the error is still printed, so it still seems like a bug to me, or did I miss your point?

Eg: Pass: .intel_syntax ones: .float +1.0, +1.0, +1.0, +1.0 vmovaps xmm15, xmmword ptr [rip+ones]

Fail: .intel_syntax ones: .float +1.0, +1.0, +1.0, +1.0 vmovaps xmm15, xmmword ptr [rip+ones] # +1.0, +1.0, +1.0, +1.0

goussepi avatar Jul 14 '16 16:07 goussepi

This is largely correct as "ones" is not defined.

The confusion arises from the error erronously pointing to the end-on-line comment instead of the reference to [rip+ones].

llvmbot avatar Jul 14 '16 15:07 llvmbot

Adding Nirav to CC as he is involved in this area of the compiler.

goussepi avatar Jul 14 '16 11:07 goussepi