]> Shamusworld >> Repos - rmac/commitdiff
Fix a bug in +o5 where outer displacement would not optimise to word size
authorggn <ggn.dbug@gmail.com>
Sat, 18 Jul 2020 16:34:16 +0000 (19:34 +0300)
committerShamus Hammons <jlhamm@acm.org>
Mon, 3 Aug 2020 16:42:36 +0000 (11:42 -0500)
parmode.h

index 7e31545b16f36955b8a7e114910269870f14be08..44e08d954a9fa7002fe7ae92ee38aaf46d3c7f88 100644 (file)
--- a/parmode.h
+++ b/parmode.h
@@ -616,13 +616,15 @@ CHECKODn:
                                        if (*tok == DOTL)
                                                tok++;                          // Doesn't matter, we're going for .L anyway
 
+                                       WORD od_ea = 0;
+
                                        // od.L
                                        if (!(AnEXTEN & EXT_BS))
-                                               AnEXTEN |= EXT_IISPOSL; // Long outer displacement
+                                               od_ea = EXT_IISPOSL; // Long outer displacement
                                        else
                                        {
                                                // bd is suppressed, so sticking the od size in bd
-                                               AnEXTEN |= EXT_BDSIZEL;
+                                               od_ea = EXT_BDSIZEL;
                                                // And of course the expression has to be copied to
                                                // AnBEXPR instead of AnEXPR. Yay. :-/
                                                int i = 0;
@@ -644,11 +646,12 @@ CHECKODn:
                                                && ((AnEXATTR & (TDB | DEFINED)) == DEFINED)
                                                && (((uint32_t)AnEXVAL + 0x8000) < 0x10000))
                                        {
-                                               AnEXTEN |= EXT_IISPOSW; // Word outer displacement
+                                               od_ea = EXT_IISPOSW; // Word outer displacement
                                                AMn = MEMPOST + ea_PC;
                                                if (optim_warn_flag)
                                                        warn("absolute value in outer displacement ranging $FFFF8000..$00007FFF optimised to absolute short");
                                        }
+                                       AnEXTEN |= od_ea;
                                }
 
                                // Check for final closing parenthesis