Open Bug 1196871 Opened 9 years ago Updated 2 years ago

avoid referencing local parameters in LinuxSignal.h

Categories

(Core :: MFBT, defect)

defect

Tracking

()

People

(Reporter: froydnj, Unassigned)

References

()

Details

Attachments

(1 file)

clang doesn't appreciate local parameter references in naked functions.
Rather than hacking around this with preprocessor trickery, let's just
declare all the argument registers as clobbered.  This ensures the
register allocation won't try to use them for loading the handler
address.

fix
Things seem to work OK in GCC without referencing the registers in the clobber
specification, but it seemed better to put them there anyway, just to make sure.
Attachment #8650621 - Flags: review?(mh+mozilla)
Attachment #8650621 - Flags: review?(mh+mozilla) → review+
We're not going to be able to take this quite yet, since clang miscompiles the code in question.  I've opened a clang bug about it: https://llvm.org/bugs/show_bug.cgi?id=24556

Other options include...writing all the assembly ourselves, I guess.
preventing inlining sounds like it could work.
(In reply to Mike Hommey [:glandium] from comment #3)
> preventing inlining sounds like it could work.

Nothing gets inlined here.
(In reply to Nathan Froyd [:froydnj][:nfroyd] from comment #4)
> (In reply to Mike Hommey [:glandium] from comment #3)
> > preventing inlining sounds like it could work.
> 
> Nothing gets inlined here.

The code in the clang bug very much looks inlined.
The generated assembly is for the SignalTrampoline function (I could have made that clearer, my mistake), and there's nothing to be inlined into that.

The bug assignee didn't login in Bugzilla in the last 7 months.
:sg, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: froydnj+bz → nobody
Flags: needinfo?(simon.giesecke)
Flags: needinfo?(simon.giesecke)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: