wrong assertion in caller-save.c

BELBACHIR Selim selim.belbachir@fr.thalesgroup.com
Fri Jan 10 18:34:00 GMT 2014


Hi,

I think I found a bug in gcc 4.7.3 in gcc/caller-save.c at line 158 : 

     gcc_assert (cached_reg_save_code[reg][mode]);

should be :

     gcc_assert (cached_reg_save_code[reg][mode] != -1);

because cached_reg_save_code contains INSN_CODES that can be equal to 0 (see attached patch)


In my backend movdi pattern has unfortunately code '0' (depends on pattern declaration order).
When gcc tried to determine if my DI regs can be saved and restore as 'caller saves' (in caller-save.c::init_caller_save()) it failed on this wrong assertion.


Regards,

Selim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: caller-save.patch
Type: application/octet-stream
Size: 319 bytes
Desc: caller-save.patch
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20140110/d8465f00/attachment.obj>


More information about the Gcc mailing list