Browse Source

* fixed writing memory references on ppc when there is only an offset
(mantis #12685 and also the error message noted in mantis #12576,
although in case of the latter it's only a symptom of another bug)

git-svn-id: trunk@12199 -

Jonas Maebe 16 years ago
parent
commit
3d25478436
3 changed files with 30 additions and 2 deletions
  1. 1 0
      .gitattributes
  2. 6 2
      compiler/ppcgen/agppcgas.pas
  3. 23 0
      tests/webtbs/tw12685.pp

+ 1 - 0
.gitattributes

@@ -8618,6 +8618,7 @@ tests/webtbs/tw1255.pp svneol=native#text/plain
 tests/webtbs/tw12575.pp svneol=native#text/plain
 tests/webtbs/tw12575.pp svneol=native#text/plain
 tests/webtbs/tw12597.pp svneol=native#text/plain
 tests/webtbs/tw12597.pp svneol=native#text/plain
 tests/webtbs/tw12614.pp svneol=native#text/plain
 tests/webtbs/tw12614.pp svneol=native#text/plain
+tests/webtbs/tw12685.pp svneol=native#text/plain
 tests/webtbs/tw1269.pp svneol=native#text/plain
 tests/webtbs/tw1269.pp svneol=native#text/plain
 tests/webtbs/tw1275.pp svneol=native#text/plain
 tests/webtbs/tw1275.pp svneol=native#text/plain
 tests/webtbs/tw1279.pp svneol=native#text/plain
 tests/webtbs/tw1279.pp svneol=native#text/plain

+ 6 - 2
compiler/ppcgen/agppcgas.pas

@@ -132,14 +132,18 @@ unit agppcgas;
 	       s := s + ')@got';
 	       s := s + ')@got';
 {$endif cpu64bitaddr}
 {$endif cpu64bitaddr}
 
 
-           if (index=NR_NO) and (base<>NR_NO) then
+           if (index=NR_NO) then
              begin
              begin
                 if offset=0 then
                 if offset=0 then
                   begin
                   begin
                     if not (assigned(symbol)) then
                     if not (assigned(symbol)) then
                       s:=s+'0';
                       s:=s+'0';
                   end;
                   end;
-                s:=s+'('+gas_regname(base)+')';
+                if (base<>NR_NO) then
+                  s:=s+'('+gas_regname(base)+')'
+                else if not assigned(symbol) and
+                        not(refaddr in verbose_refaddrs) then
+                  s:=s+'(0)';
              end
              end
            else if (index<>NR_NO) and (base<>NR_NO) then
            else if (index<>NR_NO) and (base<>NR_NO) then
              begin
              begin

+ 23 - 0
tests/webtbs/tw12685.pp

@@ -0,0 +1,23 @@
+{ %norun }
+program BuggyProgram;
+    
+const
+SE_SysEvtMask = $144;
+SE_SysEvtMask2 = $14422241;
+
+type
+intPtr = ^integer;
+
+function GetSystemEventMask: INTEGER;
+    begin
+        GetSystemEventMask := intPtr(SE_SysEvtMask)^;
+        GetSystemEventMask := intPtr(SE_SysEvtMask2)^;
+    end;
+procedure StoreSystemEventMask (theMask: INTEGER);
+    begin
+        intPtr(SE_SysEvtMask)^ := theMask;
+        intPtr(SE_SysEvtMask2)^ := theMask;
+    end;
+    
+begin
+end.