Thomas Preud'homme wrote:
Plus running the const_wanted branch without const_wanted being actually set doesn't look like a good idea. It could still generate code in the gen_cast() or gexpr() calls below.
Thanks, I'll set (and unset at the end of the function) const_wanted in the next experimental upload. I was thinking about doing it each time cur_text_section is non NULL but it requires a static variable to store the previous value of const_wanted accross functions.
If you want to fix a bug then adding tests on 'cur_text_section' is wrong because we don't have any such test anywhere currently. Which means that the code relies on the fact that it is always set when needed. If however you want to clean up the relationship between cur_text_section and const_wanted and maybe nocode_wanted which is probably possible, then your patch should remove more code than that it adds. Otherwise it would not be a cleanup.
int foo_array[fn() ? 2 : 42]; This should give an error such as with gcc: test.c:10: error: variable-size type declared outside of any functionWould the patch attached be satisfying or you prefer a better test for the global level?
I'd prefer one that actually works. And then one that doesn't mess with 'cur_text_section'. ;) I'd suggest you start here http://repo.or.cz/w/tinycc.git/commitdiff/9b52e16a50 or otherwise wait for Joe to do it. Joe? Btw, what about the multi-arch configuration. Do you still plan to move some of the logic out from tcc into configure? --- grischka _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
