as & .restore sp directive
Hi all,
my java compiler now compiles quite a bit of java.*
and so Am looking at the unwind info that I need to emit. I now have a problem with the .restore directive. It looks like I can only emit it once or as dies.
Given:
if (condition) {
...;
return;
} else {
...;
return;
}I emit two function trailers (restoring b0, resetting sp, etc.) and in doing so I also emit two ".restore sp" directives and as dies with:
out.s: Assembler messages:
out.s:79: Error: Epilogue count of 4294967296 exceeds number of nested prologues (0)
Adding two .prologue statements or two ".restore sp, 1" won't work. Any ideas ?
R.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Ronald Veldema
Ronald> Hi all, my java compiler now compiles quite a bit of java.* Ronald> and so Am looking at the unwind info that I need to emit. I Ronald> now have a problem with the .restore directive. It looks Ronald> like I can only emit it once or as dies.
Ronald> Given:
Ronald> if (condition) { ...; return; } else { ...; return; }
Ronald> I emit two function trailers (restoring b0, resetting sp, Ronald> etc.) and in doing so I also emit two ".restore sp" Ronald> directives and as dies with:
Ronald> out.s: Assembler messages: out.s:79: Error: Epilogue count Ronald> of 4294967296 exceeds number of nested prologues (0)
Ronald> Adding two .prologue statements or two ".restore sp, 1" Ronald> won't work. Any ideas ?
Looks like you need to upgrade the assembler. This is a known bug in earlier versions (sorry, I don't recall when exactly this was fixed).
--david
I know, that is what gcc does as well.
It just looks inefficient to add extra jumps, esp. if we don't need them... R.
Quoted 29 lines · CH Gowri Kumar
Quoted 4 lines
Adding two .prologue statements or two ".restore sp, 1" won't work. Any ideas ?
How about doing it this way?
if(){ .... goto RETURN; } else { .... goto RETURN; } RETURN: .restore sp mov r12 = r2 br.ret.sptk.many b0 .endpThis way I feel you can put all the necessary things (restoring sp, returning etc..) at one place, instead of duplicating the same code.
Regards,
Gowri Kumar