Hello, I just updated our porting to include last 2-3 weeks of GCC developments. I noticed a large number of test failures at -O1 that use a user-defined data type (based on a special register file of our processor). All variables of such type are now spilled to memory which we don't allow at -O1 because it is too expensive. After investigation, I found that it is the following new code causes the trouble. I don't quite understand the function of the new code, but I don't see what's special for -O1 in terms of register allocation in comparison with higher optimizing levels. If I change it to (optimize < 1), everthing is fine as before. I start to wonder whether (optimize <= 1) is a typo or intended. Thanks in advance.
Cheers, Bingfeng Mei Broadcom UK if ((! flag_caller_saves && ALLOCNO_CALLS_CROSSED_NUM (a) != 0) /* For debugging purposes don't put user defined variables in callee-clobbered registers. */ || (optimize <= 1 <--------- why include -O1? && (attrs = REG_ATTRS (regno_reg_rtx [ALLOCNO_REGNO (a)])) != NULL && (decl = attrs->decl) != NULL && VAR_OR_FUNCTION_DECL_P (decl) && ! DECL_ARTIFICIAL (decl))) { IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), call_used_reg_set); IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a), call_used_reg_set); } else if (ALLOCNO_CALLS_CROSSED_NUM (a) != 0) { IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), no_caller_save_reg_set); IOR_HARD_REG_SET (ALLOCNO_TOTAL_CONFLICT_HARD_REGS (a), temp_hard_reg_set); IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a), no_caller_save_reg_set); IOR_HARD_REG_SET (ALLOCNO_CONFLICT_HARD_REGS (a), temp_hard_reg_set); }