This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Allow generate_element_init in tree-sra.c to fail
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: dberlin at dberlin dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 5 Jul 04 12:33:39 EDT
- Subject: 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.