Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operator definition breaks amd64 assembly code with Spacetime #7326

Closed
vicuna opened this issue Aug 15, 2016 · 1 comment
Closed

Operator definition breaks amd64 assembly code with Spacetime #7326

vicuna opened this issue Aug 15, 2016 · 1 comment
Assignees

Comments

@vicuna
Copy link

vicuna commented Aug 15, 2016

Original bug ID: 7326
Reporter: cspiel
Assigned to: @mshinwell
Status: closed (set by @xavierleroy on 2017-09-24T15:33:21Z)
Resolution: fixed
Priority: normal
Severity: crash
OS: GNU/Linux
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: back end (clambda to assembly)

Bug description

Ocamlopt (4.05.0+dev0-2016-08-01) with the Spacetime extension writes
a comment to the assembler file in the form
/* Shape for PARTIALLY_MANGLED_FUNCTION_NAME */
where PARTIALLY_MANGLED_FUNCTION_NAME is derived from the function
name. If the function name happens to contain the end-of-comment
character sequence of the assembler, the assembler barfs.

For the example given in `Steps To Reproduce' the offending line is
/* Shape for camlTimes_slash__*/_4: */

Steps to reproduce

Compile the following two-liner with a Spacetime-enabled native compiler.

type t = {x: float}
let ( */ ) a v = {x = a *. v.x}

Additional information

Three possible fixes immediately come into my mind.
They all concern file "asmcomp/amd64/emit.mlp".

(1) Make the assembler comment in function emit_spacetime_shapes' a literal, e.g. D.comment "Start of Spacetime shapes." The bracketing end-of-shapes comment already is such a constant. (2) Consider the attached patch of emit_spacetime_shapes'. It applies the
same mangling to the function name inside the comment as is applied
to the function's assembler label.
(3) Spice up function `comment' to escape all character sequences that are
indigestible to the assembler.

File attachments

@vicuna
Copy link
Author

vicuna commented Aug 15, 2016

Comment author: @mshinwell

Thanks for the bug report and patch. Fixed on the 4.04 branch (b149ab3) and trunk (7747145).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants