program: only reuse constants of the same size and value
authorWim Taymans <wtaymans@redhat.com>
Mon, 22 Jun 2015 11:13:36 +0000 (13:13 +0200)
committerWim Taymans <wtaymans@redhat.com>
Mon, 22 Jun 2015 11:13:36 +0000 (13:13 +0200)
commit4c81fbf198184e2ee986ac88d73ba81382bcff7a
tree361bbf813bbc435e460122e99123b748dc83679b
parent8f6487540d28b47c47cd5b93d21cad2c3c5d6e34
program: only reuse constants of the same size and value

When reusing an existing constant, make sure not only the value but also
the size is the same. We then also need to make a name based on the size
and value so that we can store the same value for different sizes.

Fixes problem with the bayer functions that used 255 as a 16 and 8 bit
constant. This was not detected in the unit test because both the backup
and asm functions do the same error, but it could be seen when a new
backup function was checked against a older ORC.
orc/orccompiler.c
orc/orcparse.c
orc/orcprogram.c