gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: A pretty funny 2.7.0 compiler warning


From: Camm Maguire
Subject: [Gcl-devel] Re: A pretty funny 2.7.0 compiler warning
Date: 08 Apr 2006 23:07:41 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  Just back from a week's travel overseas.

More on this later, but you can see what is happening -- the compiler
knows that x has no possible type space left on the last branch, but
tries to coerce it to a general argument (of type '*) for passing to
error.  These messages are infrequent as in most such cases, the
compiler can simply eliminate the unreachable branch.  Right now, we
eliminate 'or branches if one form therein is known to return t.  We
should likely expand this to eliminating any branch on which some
variable has an inferred type of nil.

There is so much useful diagnostic material that can be output from
the compiler for aid in debugging and optimization, but I cannot see
how to organize it in an uncluttered fashion at present.  For example,
one generates the warning below deep inside (i.e, '(error ... x)) code
which generates the issue (i.e. '((or ....) (t ....))), the latter of
which one would like to have clearly pointed out in the diagnostic
message.

If one sets compiler::*suppress-compiler-notes* to nil, one quickly
concludes that all of the branch elimination information is not
desirable in general.

Take care,

Robert Boyer <address@hidden> writes:

> Below is a pretty funny 2.7.0 compiler warning.
> 
> Bob
> 
> -------------------------------------------------------------------------------
> 
> % xg
> GCL (GNU Common Lisp)  2.7.0 ANSI    Apr  1 2006 15:10:32
> 
> >(defun duhtest (x)
>   (cond ((or (atom x) (consp x)) nil)
>         (t (error "~a failed duhtest" x))))
> 
> DUHTEST
> 
> >(compile *)
> 
> ;; Compiling /tmp/gazonk_23485_0.lsp.
> ; (DEFUN DUHTEST ...) is being compiled.
> ;; Warning: The type of the form X is not *, but NIL.
> ;; End of Pass 1.  
> ;; End of Pass 2.  
> ;; OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3, 
> (Debug quality ignored)
> ;; Finished compiling /tmp/gazonk_23485_0.o.
> Loading /tmp/gazonk_23485_0.o
> start address -T 0xab02488 Finished loading /tmp/gazonk_23485_0.o
> #<compiled-function DUHTEST>
> NIL
> NIL
> 
> >
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]