missed an assignment-copy for simple expressions
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 15 May 2021 16:05:26 +0000 (17:05 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 15 May 2021 16:05:26 +0000 (17:05 +0100)
src/openpower/decoder/pseudo/parser.py

index b6eba3e2c9696a05b013c2a29bf848c022bd6d4f..b24baeacf24d94ec01c66a2288ba749961c5e800 100644 (file)
@@ -429,7 +429,11 @@ class PowerParser:
             else:
                 print("help, help")
                 print(astor.dump_tree(p[1]))
-            print("expr assign", name, p[1])
+            print("expr assign", name, p[1], "to", p[3])
+            if isinstance(p[3], ast.Name):
+                toname = p[3].id
+                if toname in self.gprs:
+                    self.read_regs.add(toname)
             if name and name in self.gprs:
                 self.write_regs.add(name)  # add to list of regs to write
             p[0] = Assign(autoassign, name, p[1], p[3], iea_mode)