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

cfi annotations are enabled even without -g #5681

Closed
vicuna opened this issue Jul 12, 2012 · 5 comments
Closed

cfi annotations are enabled even without -g #5681

vicuna opened this issue Jul 12, 2012 · 5 comments
Assignees
Milestone

Comments

@vicuna
Copy link

vicuna commented Jul 12, 2012

Original bug ID: 5681
Reporter: @ygrek
Assigned to: @lefessan
Status: closed (set by @damiendoligez on 2012-07-18T15:20:38Z)
Resolution: fixed
Priority: normal
Severity: trivial
Target version: 4.00.0+dev
Category: documentation

Bug description

I do not think this is the problem per se, but changelog says that cfi and debug info are enabled in ocamlopt -g only. This is not true since r12665.

@vicuna
Copy link
Author

vicuna commented Jul 12, 2012

Comment author: @lefessan

Do you mean in the "Changes" file ?

I can only find the line:

that is the name of a bug report, but does not say that .cfi directives are only generated with -g.

The goal of r12665 was to allow CFI directives even without -g, so that the code can be correctly profiled (-g would disactivate some optimizations, so the profiled code would not be the production code). Do you think it is a bad decision ? (it might, I have read somewhere that CFI directives can generate additional instructions, I should search for that again)

@vicuna
Copy link
Author

vicuna commented Jul 12, 2012

Comment author: @lefessan

Maybe we should use ".cfi_startproc simple" instead of just ".cfi_startproc".

@vicuna
Copy link
Author

vicuna commented Jul 12, 2012

Comment author: @ygrek

Yes, in Changes, see :

  • In -g mode, generation of CFI information and a few filename/line
    number debugging annotations, enabling in particular precise stack
    backtraces with the gdb debugger. Currently supported for x86 32-bits
    and 64-bits only. (PR Improved GDB support #5487)

-g would disactivate some optimizations, so the profiled code would not be the production code
Hm! We have discussed that already. -g shouldn't influence code generation. See PR #5426. I am ok with cfi without -g (but what is -g controlling then? what is the point of cfi without other debug info?)

I have read somewhere that CFI directives can generate additional instructions, I should search for that again
I've never seen anything like this.

@vicuna
Copy link
Author

vicuna commented Jul 12, 2012

Comment author: @lefessan

Ok, I changed the Changes file.

CFI annotations (.cfi_startproc/.cfi_endproc) are always generated (to get the correct names of functions in the backtrace, i.e. enough for basic profiling), but .line/.loc directives are still only generated if -g is provided (more important for debugging).

Actually, I partially disagree with Xavier on PR 0005426, -g should influence code generation (register coalescing should be turned off, and other optimizations in simplif too), so that we can at some point implement more debugging support on assembly code. Currently, there is no way to recover the values of the arguments from inside a function call, if the registers have been used for partial results...

@vicuna
Copy link
Author

vicuna commented Jul 18, 2012

Comment author: @damiendoligez

The Changes file was updated in 4.00 (commits 12703 and 12704).

@vicuna vicuna closed this as completed Jul 18, 2012
@vicuna vicuna added this to the 4.00.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
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