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]

Re: sibcall fixup


On Sun, Feb 18, 2001 at 10:24:58PM -0500, Richard Kenner wrote:
> I really don't understand why code of the form:

[ multiple ifs ]

> is *ever* better than

[ one huge if ]

> no matter *how* many conditions there are or how complex they are.
> 
> Can you explain?

Easily.

You can step through the former in a debugger a piece at a time.  The
later becomes one statement, such that "step" or "next" (depending on
how many embedded function calls actually get invoked) takes you directly
to the "then" or "else" statement.

Moreover, the former is demonstrably easier to understand and maintain.
Look, for instance, at the garbage that cluttered jump.c before I
deleted 3/4 of it in favour of ifcvt.  Look at the horrors that still
haunt push_reload.



r~


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