Remove Istore_symbol (plus some Win64 fixes)#955
Conversation
|
This doesn't seem to be working - it fails with At which point I'm getting out of my depth - but happy to help debugging further. AppVeyor seems very unhappy with the generated code, though I haven't looked in detail as to why... |
|
By the way - did we only just enable the "Reviewers" feature today, or was GitHub listening to the dev meeting on Tuesday and psychically added a new feature? |
|
OK, out of my depth, but still trying! This seems to fix things. I haven't fully confirmed the testsuite, because 4.04 changes aren't yet on trunk (something I may do something about later...) but how's this: diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp
index 85b4cee31..5b69920f3 100644
--- a/asmcomp/amd64/emit.mlp
+++ b/asmcomp/amd64/emit.mlp
@@ -992,7 +992,7 @@ let begin_assembly() =
end;
- if !Clflags.dlcode then begin
+ if !Clflags.dlcode || true then begin
(* from amd64.S; could emit these constants on demand *)
begin match system with
| S_macosx -> D.section ["__TEXT";"__literal16"] None ["16byte_literals"]
diff --git a/asmcomp/amd64/reload.ml b/asmcomp/amd64/reload.ml
index 2e29de4c1..690e01651 100644
--- a/asmcomp/amd64/reload.ml
+++ b/asmcomp/amd64/reload.ml
@@ -94,7 +94,7 @@ method! reload_operation op arg res =
then (arg, res)
else super#reload_operation op arg res
| Iconst_symbol _ ->
- if !Clflags.pic_code || !Clflags.dlcode
+ if !Clflags.pic_code || !Clflags.dlcode || Arch.win64
then super#reload_operation op arg res
else (arg, res)
| _ -> (* Other operations: all args and results in registers *)I imagine that my |
|
@mshinwell I still get the error with your patch. Same observations as @dra27 :
Then it seems to work ! |
|
Will do - but not until tomorrow. |
|
All things considered, I'd rather remove the Sometimes removing code is the best solution.. |
|
@mshinwell I recompiled my not-so small application that exhibited the error in the first place — works fine now. @xavierleroy you mean |
|
@xavierleroy I presume you meant I don't yet understand why the changes to |
|
I meant The change in Reload for |
|
The latest version (sans |
|
I'll wait for David / Olivier to try it once more before merging. |
|
Still works for me, thx. |
This used to be MPR#6594, where the original poster describes assembly errors resulting from the use of an instruction with an out-of-range operand, namely attempting to move a 64-bit immediate (only 32 bits are allowed) into a 64-bit memory address. The instruction is believed to be generated by
Istore_symbol. This patch disables that pattern for Win64. On other systems, when not compiling for PIC (which is probably not that common anyway), it would be highly unusual to exceed the 4Gb barrier that would trigger this.@oandrieu Would you please test this?