|
From: | Michael Matz |
Subject: | Re: [Tinycc-devel] nocode_wanted does not work |
Date: | Sun, 3 Apr 2016 19:21:04 +0200 (CEST) |
User-agent: | Alpine 2.20 (LSU 67 2015-01-07) |
Hi, On Sun, 3 Apr 2016, Sergey Korshunoff wrote:
The previous trace is wrong, sorry A correct place is else if (tok == '{') { if (const_wanted) tcc_error("expected constant"); /* save all registers */ save_regs(0); <<<<<<<<<<<<<<< /* statement expression : we do not accept break/continue inside as GCC does */ block(NULL, NULL, NULL, NULL, 0, 1); skip(')'); } else { gexpr(); skip(')'); } This is a save_regs(0) which generate a code when nocode_wanted=1 When if(!nocode_wanted) save_regs(0); then there is no error messages but a test program still hangs
Of course, because the whole parsing of the ({block}) still generates code. The nocode_wanted hack currently doesn't work for statement expressions, and as Edmund says deserves a little thought if it's applied at the right level currently (well I think it's clear that it isn't, but the question what the right level is remains).
Ciao, Michael.
[Prev in Thread] | Current Thread | [Next in Thread] |