PATCH: SSA for hard registers

Mark Mitchell mark@codesourcery.com
Mon Jul 31 23:30:00 GMT 2000


>>>>> "Jeffrey" == Jeffrey A Law <law@cygnus.com> writes:

    Jeffrey> I don't see how assert buys us anything significant over
    Jeffrey> what we're doing with abort, particularly with how we
    Jeffrey> redefine abort.

The point, and I really will shut up after this, is that it's a
(small) abstraction.  It takes fewer keystrokes, fits on one line, and
doesn't make you wonder about the control-flow.

The meaning of:

  assert (x);

is immediate; the meaning of:

  if (!x)
    abort ();

is less so.  You can also do things with assert like print out the
condition that failed, if you have the right preprocessor support -- a
nice improvement over a simple file and line number.

Apropos of nothing, it looks to me like the `assert' in dwarf2out.c
went in with:

  1998-02-06  Jason Merrill  <jason@yorick.cygnus.com>

	  * dwarf2out.c: Add old_args_size.
	  (dwarf2out_args_size): Use it.
	  (dwarf2out_begin_prologue): Initialize it.
	  (dwarf2out_stack_adjust): If !asynchronous_exceptions, save up
	  pushed args until we see a call.
	  * final.c (final_scan_insn): Hand CALL_INSNs off to the dwarf2 code
	  before outputting them.

My archaeology could be wrong, though.  Of course, the C++ front-end
has used assert forever, in the form of the (somewhat appallingly
Windows95-anticipatory named) my_friendly_assert. :-)

The best empirical evidence I have that the current thing is confusing
is that (literally) every single person I've talked to after a first
look at the GCC sources has asked me "What is the deal with all this
calling `abort'?  Why don't they just use `assert' like everyone
else?"

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


More information about the Gcc-patches mailing list