This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

wrong assertion in caller-save.c


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

Attachment: caller-save.patch
Description: caller-save.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]