1. 23 Mar, 2023 2 commits
  2. 18 Mar, 2023 2 commits
  3. 13 Mar, 2023 1 commit
    • Michael Matz's avatar
      Fix 128_run_atexit.c on linux · 4dc4e93f
      Michael Matz authored
      if we include standard headers on glibc-based systems then
      we can't use '__attribute__' (those are defined away for unknown
      compilers) but must use '__attribute' (or #undef that token).
      4dc4e93f
  4. 12 Mar, 2023 2 commits
    • grischka's avatar
      small scopes cleanup etc. · 19e3e10e
      grischka authored
      tccgen.c:
      - just track local_stack for small scopes (can't declare variables)
      - fix a vla problem with nested scopes
      - move debug N_L/RBRAC into curly braced block
      
      Also:
      - tccpp.c: move 'label_...' functions to tccgen.c
      - tccpp.c: let get_tok_str() say "<no name>" for anonymous symbols
      - tcctest.c: let __pa_symbol() work for memory > 2GB
      - 119_random_stuff.c: revert strtoll test (no reason to test libc)
      - tccdefs.h/tcctest.c: enable bit fncs for _WIN32
      - Makefile:
        - use i686-linux-gnu instead of i386-linux-gnu for cross-i386
        - update 'make help'
        - revert umplicit 'make all' with 'make install' (but print warning)
      19e3e10e
    • grischka's avatar
      Revert ""Fix" nocode_wanted in expr_landor" · 5f08561e
      grischka authored
      instead in vcheck_cmp(), pass the CODE_OFF_BIT to generators
      unless other nocode purposes are set.
      
      This reverts commit cad87395.
      
      Also in 128_run_atexit.c:
      avoid line output disorder which may happen on windows when
      tcc itself and runned code are using two different printf
      implementations and tcc would print the "[Returns 1]" above
      any output from the runned test.
      5f08561e
  5. 11 Mar, 2023 4 commits
  6. 10 Mar, 2023 3 commits
    • Michael Matz's avatar
      Fix type of cond-op · ef3eb02c
      Michael Matz authored
      the optimization of a ternary op with two boolean operands had
      the same problem (as in the last commit) of loosing the type.
      ef3eb02c
    • Michael Matz's avatar
      Fix casted boolean expressions · 96b31ba6
      Michael Matz authored
      the casted type was lost when a delayed bool was finally converted
      to a value.  See testcase, in the wrong case the '(unsigned int)' cast
      was ignored, and hence the division was signed reulting in -1 instead of
      the proper 0x7fffffff.
      96b31ba6
    • herman ten brugge's avatar
      Add attribute nodebug support and skip bitfield padding · 2cb8bddd
      herman ten brugge authored
      The following code:
      typedef struct {
        unsigned int a __attribute__((nodebug));
        unsigned int b;
        unsigned int : 32;
        unsigned int c;
      } tst;
      
      Supresses a and also suppresses bitfield padding.
      So debugger shows only b and c in above example.
      2cb8bddd
  7. 09 Mar, 2023 4 commits
    • Michael Matz's avatar
      Fix more jumpopts (in ternary op) · 2cf3a6eb
      Michael Matz authored
      the code in expr_cond save nocode_wanted around some parts of
      expression evaluation, but at the wrong spots.  If the evaluation
      of the condition itself (e.g. in the testcase the first whole ternary
      expression) resulted in CODE_OFF, then that was saved, and restored
      before return, even if in-between codegen would have CODE_ON'ed already.
      Thus the whole CODE_OFF state bled out to outside the expression
      evaluation and also disabled the whole if-block.  Found by yarpgen v1
      (seed 64).
      2cf3a6eb
    • herman ten brugge's avatar
      Fix test90 for 32 bits targets · ec81877f
      herman ten brugge authored
      Should have used 'long long' instead of 'long' for 32 bits targets.
      ec81877f
    • herman ten brugge's avatar
      Fix Makefile install target · 80909254
      herman ten brugge authored
      Update target all before installing
      80909254
    • herman ten brugge's avatar
      Fix init bitfield padding with size 32/64 · 3f0a1719
      herman ten brugge authored
      The init code did not work for padding bitfields with size 32 and 64.
      3f0a1719
  8. 07 Mar, 2023 1 commit
    • Michael Matz's avatar
      Fix code suppression during nocode_wanted · c771cb52
      Michael Matz authored
      we activate code (CODE_ON) only when the target labels are used,
      which doesn't happen during nocode_wanted regions.  So, we cannot
      just switch off code either during nocode_wanted regions, nothing
      would switch it on again (except in the happy coincidences when we
      outright save/restore nocode_wanted).  See the testcase for one
      example, reduced from code generated by yarpgen: in
        ext = (xxx || 1)           // #1
              || ((xxx && 1) || 1) // #2
      code is first suppressed in #1 normally, then (before this commit)
      was suppressed via CODE_OFF during #2 (via indirect gjmp),
      then the suppression from #1 was undone, but nothing undoes the
      suppression from #2 anymore as everything therein was generated
      while nocode_wanted was active.
      
      So, we would either need to save/restore nocode_wanted around
      some more expressions, activate CODE_ON also with unused labels (breaks
      some optimizations we want), or deactivate CODE_OFF only when not
      already in nocode_wanted state.  This does the latter.
      c771cb52
  9. 05 Mar, 2023 1 commit
  10. 23 Feb, 2023 1 commit
  11. 22 Feb, 2023 1 commit
    • Michael Matz's avatar
      Fix sym_scope of typedefs · 605538f4
      Michael Matz authored
      Sym.sym_scope and Sym.f (FuncAttr) share space, so blindly setting
      one clobbers the other.  Right now this only leads to missing errors
      on incompatible typedefs (see testcase), which this commit fixes.
      
      But it points to a larger problem:
      Generally we can only manipulate Sym.f for anonymous and field symbols,
      not for anything that has a top-level name (basically any proper decl),
      because the latter use sym_scope.  Luckily the functions type always
      contains an anonymous symbol (in sym->type.ref), so we can use that.
      But some of the functions attributes actually _do_ apply to the decl,
      not the type (e.g. always_inline), so we still have a problem possibly,
      when we update an pre-existing type that may already be shared with
      another decl.
      
      Would need untangling and perhaps using accessor functions that check
      that Sym.f and Sym.sym_scope aren't used for the same symbol.
      605538f4
  12. 03 Feb, 2023 2 commits
  13. 17 Jan, 2023 3 commits
  14. 16 Jan, 2023 3 commits
  15. 01 Jan, 2023 2 commits
  16. 28 Dec, 2022 2 commits
  17. 27 Dec, 2022 4 commits
  18. 26 Dec, 2022 1 commit
  19. 24 Dec, 2022 1 commit