comparison extra/README @ 416:b4d0eafc5bfe

Fix code generation error in gcc6809 It turned out that under some circumstances, the gcc optimizer would select an instruction sequence that had the sense of a branch inverted. It seems this was due to a particular instruction pattern included in the machine description not being quite right with respect to how the condition codes were tracked. Removing that instruction pattern seems to fix things (subtraction with the arguments reversed). gcc seems to be smart enough to figure out how to reorganize code to work without this reversed sense subtraction and then do the right thing.
author William Astle <lost@l-w.ca>
date Thu, 24 Mar 2016 20:07:20 -0600
parents 8222f30a0781
children d7b7004b0883
comparison
equal deleted inserted replaced
415:8222f30a0781 416:b4d0eafc5bfe
91 8. Run "make install". Note that you will have to have your PATH variable 91 8. Run "make install". Note that you will have to have your PATH variable
92 for "root" set up correctly if your install prefix requires root privileges. 92 for "root" set up correctly if your install prefix requires root privileges.
93 93
94 The above is WOMM certified. YMMV. 94 The above is WOMM certified. YMMV.
95 95
96 NOTES ABOUT GCC6809
97 ===================
98
99 There is one known code generation bug with current versions of gcc6809. If
100 you are getting bad behaviour for some reason and are using optimization
101 (-O1 or higher, -Os), you may be hitting this bug. If someone who
102 understands the gcc code is willing to look at it, patches for the patch
103 would be welcome (especially if that patch moves the base gcc version
104 upward). It is not clear whether this is a bug in the m6809 specific code
105 or the gcc core though it seems like it's in the gcc core. Disabling
106 optimization completely seems to generate correct, if suboptimal, code.
107
108 NOTES ABOUT SPECIFIC PATCHES 96 NOTES ABOUT SPECIFIC PATCHES
109 ============================ 97 ============================
110 98
111 gcc6809lw-4.6.4-2.patch 99 gcc6809lw-4.6.4-2.patch
112 100
136 particular, banking and "far calls" are not supported because there are no 124 particular, banking and "far calls" are not supported because there are no
137 targets supported by lwtools that do anything meaningful in the face of such 125 targets supported by lwtools that do anything meaningful in the face of such
138 things. Patches to clean that up are also welcome. Either to do something 126 things. Patches to clean that up are also welcome. Either to do something
139 meaningful or to remove such features entirely. 127 meaningful or to remove such features entirely.
140 128
129 gcc6809lw-4.6.4-4.patch
130
131 This is identical to the -3 version except it fixes a code generation bug
132 that showed up under optimization. It would result in the sense of a branch
133 following a subtraction being inverted for whatever reason. This change
134 seems to fix that.