Hi,
On Fri, 16 Dec 2016, grischka wrote:
Therfor before we change assumptions (which we clearly do as soon as we
start to use 'nocode_wanted' for optimization purposes) I'd really like
to see the below working under all tests and everything except fire in
the computer:
ST_FUNC void g(int c)
{
int ind1;
if (nocode_wanted)
tcc_error("internal: code generated but nocode_wanted");
ind1 = ind + 1;
True. The use of nocode_wanted (and even more so my extension to suppress
code generation for optimization) is somewhat fragile until the above
works. But OTOH this "misuse" mostly works right now :) Generating jumpy
code (i.e. in conditionals and for top-level statements) as well as
gv/gvtst is most susceptible currently to trigger an assert like the above
as reflected in one of my added comments:
/* XXX This doesn't handle nocode_wanted correctly at all.
It unconditionally calls gv/gvtst and friends. That's
the case for many of the expr_ routines. Currently
that should generate only useless code, but depending
on other operand handling this might also generate
pointer derefs for lvalue conversions whose result
is useless, but nevertheless can lead to segfault.
Somewhen we need to overhaul the whole nocode_wanted
handling. */
(Though I meanwhile I was a bit overstating the problem with gv. But
gvtst is a problem)
Ciao,
Michael.
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel