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]

Re: Typo or intended?


Bingfeng Mei wrote:
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.

Sorry for the delay with the answer. I was on vacation last week.

As Andrew Haley guess, it was intended. I thought that improving debugging for -O1 is also important (more important than optimization). Although GCC manual says

    With `-O', the compiler tries to reduce code size and execution
    time, without performing any optimizations that take a great deal
    of compilation time.

it also says

`-O' also turns on `-fomit-frame-pointer' on machines where doing
    so does not interfere with debugging.

Therefore I've decided to do analogous thing for the patch. May be I am wrong. We could do this only for -O0 if people really want this which I am not sure about.
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);
}


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