﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
1122	"Some compiler rewrites marked ""safe"" are really unsafe"	sjamaan		"Due to a currently unknown reason, sometimes the scrutinizer seems to be able to prevent hardwired compiler rewrites from being done.

If the following code is interpreted, it will print two lines saying ""error"".  If it is compiled, it will either print ""error"" and ""smaller"", or in case of a {{{DEBUGBUILD}}}, it will print ""error"" and show a low-level type assertion error.

{{{
#!scm
(use ports)
(handle-exceptions exn
    (print 'error)
    (print (if (char<? 1 #\a) 'smaller 'bigger-or-equal) ))
(handle-exceptions exn
    (print 'error)
    (print (if (char<? (with-input-from-string ""1"" read) #\a)
               'smaller 'bigger-or-equal)))
}}}

Perhaps it's a good idea to remove the compiler rewrites completely (they are in {{{c-platform.scm}}}), and, where suitable, move the rewrites to {{{types.db}}}.  This will prevent bogus rewrites like the one above, and should also make the compiler simpler.  We must ensure this doesn't mess up performance too bad.  Benchmarking will help."	defect	closed	major	4.11.0	compiler	4.9.x	fixed			
