This is the mail archive of the gcc-patches@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: Allow generate_element_init in tree-sra.c to fail


    Could you please not move function calls with important side-effects 
    (IE non-predicates) into if conditions?
    It's incredibly annoying to debug, and also tends to introduce subtle 
    ordering bugs later on when someone adds on to the if condition without 
    noticing that some call has side effects.

I agree in general, but in this case, it's fairly clear what's going
on and if it were moved elsewhere, then the "if .. else if ... else
if" structure wouldn't be as clean and would be more confusing.

I welcome suggestions as to how to accomplish both goals, but my judgement
is that the overall structure takes precedence in this case.  My original
intent was not to do it this way for precisely the reasons you gave, but
I couldn't find a clean way to do it.


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