mburkley / tms9900-gcc

gcc cross-compiler for TMS9900
GNU General Public License v3.0
13 stars 1 forks source link

sub_const_hi assumes immediate is a const_int but it could be a label #38

Closed mburkley closed 9 months ago

mburkley commented 9 months ago

The constraint "i" matches any constant including labels with relative offsets. These can't be translated to integers using INTVAL so yield random values.

Either add a constraint of "n" or check using CONST_INT to make sure a value really is an int before converting.