vbcc is (c) in 1995-99 by Volker Barthelmann (cgm68k): changes in the code generator for m68k (cgi386): changes in the code generator for i386 (cgppc): changes in the code generator for ppc (cgalpha): changes in the code generator for alpha (cla68k): changes in the C library for amiga68k (clappc): changes in the C library for amigappc (vc): changes in the compiler frontend Changes since V0.6d - bug fix: typedefs of functions were not handled correctly - bug fix: fgets read one character too many (cla68k,clappc,clawos) - removed tail-recursion from killsp() - bug fix: incorrect use of associativity in certain rare cases - bug fix: redeclarations of inline-assembly functions left inline assembly - bug fix: loop-unrolling had problems with loop-conditions that are pointer comparisons - bug fix: conversion of fp -> unsigned char/short generated incorrect assembly in special cases with FPU (cgm68k) - bug fix: fmul./fdiv. was generated incorrectly (cgppc) - bug fix: av_globals was calculated wrong (ouch!) - bug fix: adding a local optimizer-variable to a function which had no variables in nesting 1 before Changes since V0.6c - support for auto-opening of libraries - bug fix: SUBIFP in strength-reduction - gets/fgets must not always return 0 when EOF - triton-code by Frank Wille included - bug fix: problems with folding pointer constants - bug fix: loop-unrolling with non-constant number of iterations - added HUGE_VAL (cla68k,clappc) - replaced fprintf(stderr by printf( (cla68k,clappc) - fixed an internal error with -no-multiple-ccs (cgppc) - included scheduler for ppc by Frank Wille (vscppc) - added support for scheduler to vc - bug fix: -1/a != -a (ouch!) - bug fix: folding of KONST|DREFOBJ was broken with optimization - some work on memory-cse Changes since V0.6b - added support for unsigned int size_t - added small data support for PPC (cgppc) - started code generator for c16x - added __near, __far, __chip and __saveds for 68k+PPC (cgm68k/cgppc) - added support for target-specific variable attributes - started small data support for PPC (cgppc) - improved caching of memory contents - Julian Kinraid adapted vconfig to new vc (vca68k) - warning 164 is not displayed if a function is called - bug fix: update is not allowed with rA==rD (cgppc) - changed external reference in tan.s (m040.lib) to non-pc-relative (cla68k) Changes since V0.6a - bug fix: fp-expressions with constants were sometimes rearranged even without -fp-associative - bug fix: nested function-calls with stack-arguments and ORDERED_PUSH - several small changes to libvc.a/libm.a by Frank Wille (cla68k/clappc) - better use of loads with offsets (cgppc) - better tmpnam provided by A. M. Jorge (cla68k/clappc) - fwrite buffered now (clppc) - bug fix: there was a problem with GETRETURN - bug fix: bugs with argument passing in registers fixed - bug fix: a bug with TEST and UNSIGNED was introduced - bug fix: __reg without explicit type-/storage-class-specifier - bug fix: const float/double sometimes causes "#fp-constant"-problem (cgm68k) - added -double-push - negative values in reg_parm used for passign arguments in regs and stack - added -cf to vc - bug fix: format string for error 101 was broken - bug fix: conversions unsigned long->pointer in data-reg were broken (cgm68k) - bug fix: TEST without following branch could cause internal error (cgm68k) - new alib by Stephen Williams added - extra argument to reg_parm added, alpha/ppc cgs modified (cgalpha/cgppc) - bug fix: __reg was ignored in function-definitions with HAVE_REGPARMS - bug fix: switch_statement has to clear nocode Changes since V0.6 - bug fix: functions returning structs - bug fix: str(n)icmp in extra.lib (cla68k/clappc) - added some simple elimination of redundant compare/bccs - added loop-unrolling for certain loop-invariant number of iterations - fixed names of some dos-varargs-functions in vargs.h (cla68k/clappc) - -use-lmw added (cgppc) - some work on -peephole (cgppc) - bug fix: signed right-shifts (cgppc) - newmalloc made standard (cla68k) - fixed some bugs in addressing (cgm68k) - BeginIO added to libamiga.a - fixed certain type-conversions (cgppc) - some bug fixes (cgalpha) - added NOEXE to config-files using PhxAss - bug fix: replaced buggy strncpy (cla68k/clappc) - support for stack-frames larger than 32KB added (cgppc) - some changes in the code-generator for ppc (cgppc) - new pasm can replace branches >16bit (config-files changed) Changes since V0.5k - -ml option added to vc - remove() and rename() added (clappc) - vc accepts +file anywhere now Changes since V0.5j - -setccs added (cgppc) - bug fix: some bugs for ppc fixed (cgppc) - bug fix: problems with SUBPFP in ic.c - bug fix: do_refs() had problems with pointer-constants (cgm68k) - bug fix: similar problem for i386 (cgi386) - obsolete EOF-check in main() removed - format for -cc/-ccv changed (vc) - + does not need the full path anymore (vc) Changes since V0.5i - fixed minor bugs in strcmp, strncmp and memcmp (cla68k,clappc) - fixed certain problems with regargs - some bug-fixes (cgppc,cgalpha) - bug-fix: KONST|DREFOBJ was incorrectly propagated as constant - hacked fd2lib to create libcall-includes (cla68k) Changes since V0.5h - -ul added to vc - -no-regnames added (cgppc) - changed gen_cond() void - support for struct-return and HAVE_REGPARMS - several bug-fixes (cgppc,cgalpha) - removed debugging-output in printzul - warning 208 extended to simple endless loops - cyclic dependencies in load_reg_parms are handled now - several bug fixes (cgppc) Changes since V0.5g - argument-registers were assigned before rewriting array/function-types - r2 is reserved (cgppc) - warning 168 is no more displayed for main() - bug-fix: alignment of floating-point-constants not always ok (cgppc,cgi386) - bug-fix: sub const with short types (cgppc) - function-inlining works with register-parameters - added stdarg-support (cgppc) - leaf-functions don't creat a stack-frame (cgppc) - some bug fixes (cgppc) - several changes in handling of alignments - added support for modulo (cgppc) - some modifications on alignments (cgm68k,cgppc) - -amiga-align added (cgppc) - mysupp included in extra.lib (cla68k) - some docs updated - added memread_id, memwrite_id and memwrite_completely to vsc.h - added inline-assembly-functions Changes since V0.5f - added examples of stdarg.h into the codegen-docs - -save-fp added (cgi386) - bug fix: conversions int<->char and %esi etc. (cgi386) - warning 170 turned off by default - bug fix: corrected prototype for strerror() (cla68k) - no-builtins added (cgalpha) - added some builtin faunctions (cgalpha) - ?: now works with non-scalars - dtgen is easier to use when not building a cross-compiler - __typeof added - conversions of DREFOBJ sometimes generated illegal assembly on alpha (cgalpha) Changes since V0.5e - cg_copyright added - increased default-values for unroll-size and inline-size - some changes for PPC (cgppc) - bug fix: declarations with empty identifiers were accepted - bug fix: read_config() read one byte too much in vc (vc) - bug fix: warning 226 added - some optimizations for Alpha (cgalpha) - more conservative handling of copy-propagation and structs/unions - better handling of alignment of compund types - bug fix: local_regs() generated duplicate FREEREGs if a register was exchanged in free_hreg() - bug fix: moveq was used incorrectly sometimes (cgm68k) - bug fix: problems with must_convert() for m68k (cgm68k) - bug fix: sometimes scratch registers were reused too early with a op= b Changes since V0.5d - added warnings 224 and 225 - bug fix: parsing of format-strings works better now - inlined calls don't increase - some work on the code-generator for alpha - bug fix: function-inlining didn't work with register parameters - clearing am before gen_dc Changes since V0.5c - new Makefile - better support for crosscompilers and emulation of data types - bug fix: several bugs fixed - a68k/amiga68k became m68k Changes since V0.5b - bug fix: corrupt alias info in frequency-reduction - bug fix: loop1 in flow.c - bug fix: arith_opt() converted uninitialized var - uses ffree for i386 (cgi386) - added supp.h/c; started to separate C-specific parts Changes since V0.5a - setvbuf works better now (cla68k) - bug fix: float/double->unsigned char/short works correct with FPU now (cga68k) - -longalign added (cgi386) - bug fix: mieee.lib closed wrong library (cla68k) - bug fix: typo in default rule of Makefile - added warning 222 - bug fix: addressing-modes with 68020+ (cga68k) - bug fix: local register allocation when optimizing - bug fix: create_loop_headers had problems with empty basic blocks - bug fix: enforcer hit and incorrect warnings in certain while- and for-expressions when optimizing - bug fix: parsing of certain declarations was buggy Changes since V0.5 - loop-unrolling now works with multiple ccs - work on the ppc code generator (cgppc) - bug fix: old-style function-definitions with '...' didn't give a diagnostic - bug fix: missing ',' in function calls didn't give a diagnostic - bug fix: certain missing brackets around initializers didn't give a diagnostic - bug fix: in certain cases wrong code for divisions was generated (cgi386) - bug fix: optimizing local register allocation had problems with USEQ2ASZ - local_regs() tries to use best reg with SETRETURN - started support for default argument passing in registers - bug fix: rearranging of array-accesses was buggy with DREFOBJs - bug fix: loading of parameters into registers was sometimes wrong if there was a jump to the first basic block after optimization - bug fix: casting to void and conditional-expressions with void caused problems Changes since V0.4f - bug fix: there was a bug with local register allocation and optimizing - bug fix: t_max[CHAR] was wrong :-) (cga68k, cgi386, cgppc) - ixemul-support updated (cla68k) - bug fixed: initialized arrays with unspecified size always increased size of stack frame - work on the i386 code generator (cgi386) - fixed bug with register parameters and optimizer - a4 is saved when geta4 is called (cga68k) Changes since V0.4e - small improvements on the i386 code generator (cgi386) - bug fix: minor bug in loop-unrolling with TEST - bug fix: there was a check missing in type_expr/CALL - bug fix: do not use addressing modes if base register was freed (cga68k) - added new m040.lib by Aki M Laukkanen (cla68k) - added elf-support and -elf option to i386 code generator (cgi386) - bug fixed: _ctype_.c in vcs.lib had been built with large data (cla68k) - __reg added - added support for parameter passing in registers - small changes in local optimizing register allocation Changes since V0.4d - arguments for mieee-functions are passed in different order now; rebuilt mieee.lib (cga68k, cla68k) - changed directory-structure, Makefile and frontend - bug fixed: certain struct initializations got the alignment wrong (bug was probably introduced recently) - included new PhxLnk - included startup-code for ixemul.library by Frank Wille - changed default vc.config (-Ivinclude: put at the end) - better error handling when parsing enums - fixed a bug with struct-assigns and improved them a bit (cga68k) - moved a } in killsp() - slightly better error-handling of function-declarations - warning 121 only applies to storage-class extern - bug fixed: declaration for remove() was missing in stdio.h (cla68k) - bug fixed: extra ','s in function calls cause a diagnostic now - added a missing ';' in vconfig-sources - added missing includes and removed incorrect ',' in vbrowse-sources Changes since V0.4c - bug fixed: delayed-popping was corrupt in certain cases (cga68k, cgi386) - cleanup_cg() added - shortcut() added - fixed bug in the optimzer (av.c and regs.c) - modified handling of character-constants with multiple chars - cleaned up a lot of internal things and using the target's arithmetic where necessary - required changes in the code generators - simple-regs will assign scratch-registers again if no functions are called - fixed bug in simple-regs Changes since V0.4b - -no-multiple-ccs added - warning 119 is not displayed for static vars any more - bug fixed: global copy propagation probably didn't really do anything - better support for multiple condition code registers - started code-generator for ppc - changed directory-structure Changes since V0.4a - bug fixed: the new PUSH still didn't work ok in all cases (cga68k) - bug fixed: certain (useless) comparisons between unsigneds and constants generated wrong code Changes since V0.4 - bug fixed: isalpha must not be true for anything but a-z/A-Z (cla68k) - new PhxLnk - bug fixed: aliasing info was incorrect in some mustconvert-cases - bug fixed: the assert-macro didn't work (cla68k) - bug fixed: the offset of addressing modes was not cleared generating problems with the new PUSH (cga68k) - bug fixed: assign() had problems with qualified floats/doubles (cga68k) Changes since V0.3i - rebuilt libraries with -O2 (cla68k) - warning 216 added - bug fixed: initializations of structs containing unnamed bitfields were not handled correctly - [f|s]printf and [f|s]scanf are always recognized if declared correctly - modified cp.c to use aliasing info Changes since V0.3h - bug fixed: aliasing info with arrays and structs wasn't always correct - #pragma opt added - added __v0[s|f]printf to vc.lib and modified stdio.h (cla68k) - added replacing printf/scanf-like functions - warning 215 added - warning 214 added - looking at format strings of printf/scanf and similar functions - #pragma printflike/scanflike added - handling of #pragma changed a bit - warning 213 added - bug fixed: calls strlen, strcpy and memcpy were inlined even if they had no external linkage - warning 212 added - warning 211 added - bug fixed: t_max[UNSIGNED|LONG] wasn't set correctly (cga68k) - warning 210 added - warning 170 displays line number - INIC supported for error-messages - changed ierror-macro and eliminated multiple __FILE__-expansions reducing size of executable a bit - improved debugging output (cga68k) - vc prints size of generated executable with -v (vca68k) - vc puts temporary files in T: unless -notmpfile is specified (vca68k) - improved debugging output (cga68k) - added geta4() (cla68k) - moved a few killsp()s - added elementary source-level-debugging helps (cga68k) - added -g to activate symbol-debugging with PhxAss (cga68k) Changes since V0.3g - bug fixed: ceil() and floor() have been missing in m881.lib (cla68k) - bug fixed: prototype for fputs was wrong (cla68k) - improved pushing of larger objects (cga68k) - added chdir() to extra.lib (cla68k) - bug fixed: sometimes dc.l xyz(a4) was generated (cga68k) - fixed some memory-leaks with alias-info - bug fixed: always_reached was not reliable - bug fixed: frequency-reduction sometimes created the wrong type if a computation (but not the whole IC) was moved - slightly modified calc_movable() - used old version of always_reached again - address-of struct/union/array ICs were sometimes not moved out of loops - redesigned handling of used/changed objects and aliasing information Changes since V0.3f - bug fixed: space for at least one var on the stack has been allocated even if no var was ever used - changed optimizing register assignment slightly - bug fixed: type-based alias-optimization wasn't always correct - bug fixed: the new reaching-definitions did not handle compound types - bug fixed: strength-reduction created problems with certain configurations of nested loops and splittable induction-vars - bug fixed: strength-reduction of x-ind_var did not negate the induction - vbcc built itself, vc and vcpp succesfully under NetBSD-Amiga 1.1 - alignment of arrays in structures now depends on the array type - rebuilt mieee.lib, vc.lib and vcs.lib to use new return type passing (cla68k) - modified returning of larger types and added -no-fp-return and -no-mreg-return (cga68k) - returning of structures in registers is allowed - 8bit constants are copied in registers for 060 again (cga68k) - elimination of a dead GETRETURN does not count as a change any more - moved the computation of areached out of the frequency-reduction-loop - made printing of fp-constants a bit better (cga68k) - added -gas (cga68k) - bug fixed: in certain cases a TEST #const was generated - included new fd2lib/MakeALIB.script/DoPktn.c by Johnny Tevessen - removed some gcc-specific-#includes from amiga.lib (cla68k) - modified representation of reaching-definitions and its use in constant-propagation and frequency-/strength-reduction - bug fixed: declaration for fputs() was missing in stdio.h (cla68k) - added -no-alias-opt - alias-analysis by type added; currently used in: - active-variable-analysis - reaching-definitions-analysis - available-expression-analysis Changes since V0.3e - changed vbrowse to be compatible with new error-mechanism - changed error-mechanism somewhat - added -iso - meaning of -ansi changed - strength-reduction uses the same induction variable for equivalent operations now - bug fixed: another one with addressing-modes (cga68k) - bug fixed: end of basic blocks was not always correctly recognized and illegal addressing modes could have been used when optimizing (cga68k) - minor changes to time.h (cla68k) - lea is sometimes used for ADDI2P/SUBIFP (cga68k) - improved use of postincrement (cga68k) - pea is used with addressing-modes now (cga68k) - constant 0s are not copied into data registers any more (cga68k) - changed global register-allocation; starts with outermost loops and works a bit different now - bug fixed: if/while/for did generate corrupt code if the condition was constant 0 and the body contained a labeled-statement - bug fixed: simple_regs() did assign variables to scratch-registers even if the function contained function-calls sometimes - bug fixed: there was a hardcoded sizeof(POINTER)==4 in szof() - bug fixed: changed the init-value for local_offset from 4 to maxalign and adapted probj2() - some peephole-optimizations added - -fp-associative added - bug fixed: ICs with one source equal to the target were considered as a use(gen) preventing elimination of such ICs in loops - bug fixed: sometimes branch-instructions were moved incorrectly - strength-reduction added - bug fixed: peephole() did some not-so-nice things when folding pointer operations; probably not fatal in 68k code-generator - moved some parts from machine.c to other files and made the separation of machine-dependent parts somewhat nicer Changes since V0.3d - bug fixed: frequency-reduction (and perhaps cse, too) got the type of added temporaries wrong for ADDRESS/ADDI2P etc. - bug fixed: sometimes the test in for/while loops was corrupt if it contained type-conversions in optimizing compilation - bug fixed: function-inlining did complain about functions returning struct - bug fixed: there was a problem with copy-propagation and structs - bug fixed: labs() was called abs() (cla68k) - added inlining of several functions to the header files (cla68k) - bug fixed: vbcc tried to inline varargs functions which usually resulted in an error - frequency-reduction added - bug fixed: constant folding when optimizing did a division by zero when folding a floating-point division with ]-1;0[ v ]0;1[ - bug fixed: the 32bit division functions in vc.lib were buggy and got in an (almost) endless loop with certain arguments; as vbcc uses them it could get stuck when folding certain constants. - bug fixed: certain definitions haven't been set correctly at the start of a function leading to wrong reaching definitions and corrupt constant propagation in some cases - bug fixed: copy propagation did replace argument of ADDRESS - vc passes -+ through to vcpp (vca68k) Changes since V0.3c - vbcc accepts a space after '=' in its option (used by vc) - improved copy propagation; it was very conservative sometimes - bug fixed: there were parentheses missing somewhere in cp.c - bug fixed: restoring of scratch registers after function-calls was buggy in optimizing compilation - distributed Makefile should be ready to use with vbcc now, Makefile.generic should be easy to use with another compiler - polished Makefiles (added rules for vbccs etc.) - -o option of vc works with intermediate files, too (vca68k) - extra.lib included in source tree (cla68k) - vconfig included in source tree - bug fixed: the putc-macro in stdio.h wasn't ok, I think (cla68k) - vcpp was configured to accept C++-comments by default - this has been corrected; add '-+' to the -pp lines in vc.config if you insist - -strip-path added - vc and vbcc accept -o=executable now - changed the call to vcpp in vc.config (no stdout-redirection any more) (vca68k) - bug fixed: mysupp.c closed dup'ed files twice (cla68k) - replaced strstr in vc.lib by a version written by Kasper Graversen (cla68k) - -dontkeep-initialized-data causes vbcc not to keep initialized data in memory and can therefore reduce memory consumption - warning 118 is no ANSI-violation - warning 207 added - checking of type-specifiers/qualifiers is now more strict - changed text for error 58 - bug fixed: some initializations with additional braces were rejected - some minor changes to vc.doc (vca68k) - changed text for error 93 (errors.h, errors.doc, VBCCMessages.guide) - bug fixed: register assignment in optimizing compilation made errors due to wrong BRA interpretation Changes since V0.3b - minor changes to loop.c - bug fixed: fread didn't always return correct results (cla68k) - bug fixed: there were some 'extern's missing in vbc.h causing e.g. the old problems with source layout - rebuilt vcpp to allow more than 10 open files (ouch!) - bug fixed: under certain circumstances global common subexpressions were not replaced correctly if use and one evaluation were in the same basic block Changes since V0.3a - vc.lib/vcs.lib/mieee.lib/m881.lib/m040.lib/vbcc/vc rebuilt - div/ldiv should be conforming now - ungetc should now work even if it is the first action to a stream (cla68k) - fflush(0) only affects files in output mode (cla68k) - removed const qualifier from the ctype-array (cla68k) - changed the ctype-functions to use the array (cla68k) - added #definition of NULL to stdio.h (hope that's correct) (cla68k) - changed several stdio-functions and added line-buffering (cla68k) - bug fixed: setbuf/setvbuf was broken (cla68k) - bug fixed: vbrowse didn't ask for gadtools.library V39 - vbrowse opens a window that fits on a standard workbench by default now - bug fixed: there was a bug in newmalloc.c (cla68k) - bug fixed: included new version of the pooled memory routines for amiga.lib and rebuilt amiga.lib; hopefully works with OS2.0 now (cla68k) - bug fixed: struct-declaration-structs have been freed too early; current solution is not very nice, but should work - bug fixed: there should not be restrictions on the source layout any more (problem with look-ahead fixed) - bug fixed: identifiers longer than MAXI could cause problems - bug fixed: passing incomplete types to functions without prototypes did not cause a diagnostic - changed the internal representation of structs/unions/prototypes - some non-conforming things in the source corrected - hardcoded limit for struct sizes etc. eliminated - type of incomplete structs should be ok now - bug fixed: code after an always false if etc. wasn't generated even if it contained a label Changes since V0.3 - vc passes options starting with -D or -I through to the preprocessor - the format for -pp/-ppv has changed (vca68k) - vc writes names of objects for the linker to a temporary file if they are very long (vca68k) - vc supports option -nostdlib to prevent linking with standard-startup/libs additional entries -l2/-l2v are necessary in vc.config (vca68k) - bug fixed: perror was called prerror in the library - ouch; Make-scripts changed and vc.lib/vcs.lib rebuilt (cla68k) - bug fixed: perror-prototype was incorrect (cla68k) - added missing prototype for strerror() to string.h (cla68k) - added missing prototype for strtok() to string.h (cla68k) - rebuilt amigas.lib and vcs.lib (cla68k) - bug fixed: constant data in code-sections was addressed via a4 with -sd (cga68k) - bug fixed: conversion between pointers and integers may not be omitted in most cases (cga68k) - branches after TEST unsigned are changed now and tst may be omitted (cga68k) - rebuilt amiga.lib (cla68k) - bug fixed: fd2lib didn't work with varargs-functions expecting the argument-list in a data register (cla68k) - added several varargs-functions to fd2lib (cla68k) - edited the Make#?lib.scripts (cp->copy, *.c->#?.c) (cla68k) - added a few xdefs to amiga.lib (cla68k) Changes since V0.2v - changed the version number :-) Changes since V0.2u - rebuilt vc.lib and vcs.lib - bug fixed: the vbcc-compiled cpp did not close opened files; now the routines in mysupport.c close all opened files at exit - bug fixed: there was still an error that caused wrong line numbers to be printed in messages when an external preprocessor was used - compiling with NO_OPTIMIZER #defined and linking without av.o, cp.o, cse.o, flow.o, loop.o and rd.o produces a smaller executable that doesn't include the global optimizer - compiled the cpp from the lcc-distribution with vbcc and changed vc.config to call this one rather than dcpp (vca68k) - bug fixed: removed some float.h scratch from limits.h (cla68k) - bug fixed: some code generation errors fixed (cga68k) - bug fixed: addressing-modes were sometimes used where they shouldn't (cga68k) - bug fixed: sometimes wrong code was generated for a op= b; expressions - bug fixed: some optimizer routines sometimes called mymalloc(0) which caused mymalloc to abort with C-libraries returning a null pointer; fixed by changing the size to 1 in mymalloc (not very nice, but simple) - added alternative malloc-routines that use the Amiga's AllocPooled-Rotuines (libsrc/stdlib/newmalloc) (cla68k) - bug fixed: in the handling of switch-statements the addressing-mode-pointers were set to zero too early and therefore later overwritten with scratch - bug fixed: in some places memory that was already free'd was accessed under certain circumstances - replacing multiplications by shifts was not done in recent versions (cga68k) - some minor code generation improvements (cga68k) - bug fixed: copies of local auto variables of inlined functions got non-empty identifiers which caused corrupt code generation under certain circumstances - bug fixed: function-inlining didn't work with return-values that must be passed via pointer - bug fixed: variables in IDENTIFIER-nodes were searched with find_var() in gen_code() again, rather than using a copy from type_expression(); this generated corrupt code in certain cases of function-inlining - rebuilt showerr and tovbr using small-data with new PhxLnk - added special inlining of strlen() and strcpy() - bug fixed: the amiga68k code generator assumed long-alignment with inline_memcpy - bug fixed: tst may not be omitted if operand is unsigned (cga68k) - bug fixed: inline_memcpy was not only used when optimizing - bug fixed: the line number displayed in diagnostics were sometimes wrong if an external preprocessor with # "file" was used - bug fixed: function inlining messed up labels of static local vars Changes since V0.2t - removed any 060-specific modulo-handling again (060 has div?l.l) (cga68k) - some minor code generation improvements with arithmetic instructions and constants (cga68k) - warning for not correctly handled empty struct-declarations added - bug fixed: initializations of incomplete structs resulted in infinite error loops - improved diagnostics regarding incomplete types - bug fixed: nested calls to inlined functions were broken - address-of instructions are subject to common-subexpression-elimination - bug fixed: function-inlining sometimes assigned the arguments to the wrong variables - #pragma only-inline on/off added - some associativity optimizations are done with ADDI2P, too Changes since V0.2s - some minor changes and bug fixes on vbrowse - program showerr added - bug fixed: if the return value was moved to an address register this was supposed to set the condition codes (cga68k) - addq #const,a7 is no longer supposed to destroy condition-codes (cga68k) - bug fixed: sometimes the popping of function arguments was moved before a call (cga68k) - added #pragma type to display the type of an expression - bug fixed: declarations of functions within functions were buggy in 0.2r, because the prototype of the inner function was freed to early - bug fixed: vbcc assumed that "fmove.l fpx,ea" sets condition-codes for ea (cga68k) - bug fixed: TEST-instructions were omitted even if the type was different (could probably only happen with dirty things) (cga68k) - bug fixed: offsets for temporary buffers for scratch-registers were sometimes incorrectly calculated (only without optimizing); scanf() of the recent mieee.lib and m040.lib versions was broken due to that bug - bug fixed: string constants are only allowed as initalizers for array of char now - bug fixed: handling of long float/double is now a bit better - changed flags of a few error messages - bug fixed: problem with unexpected end of file errors fixed and some improvements in killsp() and translation_unit() - function calls are never separated from the corresponding PUSHs now (this might confuse the delayed popping of code-generators) - if all successors of a block have the same instruction at the beginning it is moved to the predecessor in certain cases - space for local variables is better used in optimizing compilation now - function inlining doesn't increase label-numbers any more - handling of local registers and pointer dereferencing improved a bit (temporary vars that get dereferenced should almost always be assigned a proper register now) - bug fixed: rearranging of array-accesses was buggy in 0.2s - bug fixed: a previous declaration of a function was not visible in the function definition in 0.2s - changed the ctype macros a bit (cla68k) - bug fixed: use of addressing modes was buggy in 0.2s (therefore the last mieee.lib was broken) (cga68k) - code generation for modulo improved for 020+ (incl. 060) (cga68k) Changes since V0.2r - bug fixed: conversions between unsigned<->floating point should now always be correct with mieee.lib (cga68k) (cla68k) mieee.lib rebuilt - if -noasm is specified the .asm file is no longer created - gen_vars() now does not create output if there were errors or -noasm was specified (this also fixes a bug that created infinite internal errors after certain corrupt initializers) - bug fixed: vbcc did not correctly recognize if opening of the input file failed in V0.2q/r - some optimizations to improve array accesses - VARADR objects are subject for copy propagation now - add/sub with constant addresses gets folded (opt only) - divsl.l is not used when -cpu=68060 is selected (cga68k) - switch-statements can be implemented by SUB/TEST/BEQ sequences rather than COMPARE/BEQ sequences (selectable with SWITCHSUBS) - bug fixed: no error for duplicate case labels was printed - bug fixed: detecting of loops did identify loops with jumps out of the loop as normal loops - bug fixed: scope of function prototypes should now be correct - bug fixed: function parameters were not marked as DEFINED and therefore redefinition of function parameters did not cause errors Changes since V0.2q - if several basic blocks have the single same successor and the last last instruction of those statements is identical it is moved to the common successor - for CPUs>=68040 8bit constants are not copied to registers (cga68k) - popping of function arguments is done one instruction before a TEST inst. (I thought this was necessary to avoid certain tst-instructions, because my manual says addq #x,a7 changes condition codes - however this seems to be wrong) (cga68k) - Thorsten Schaaps' preprocessor integrated into vbcc files vbpp.h and preproc.c added - new options: - -nested-comments allows nested comments (not ANSI conforming) - -cpp-comments allows C++ style comments (not ANSI conforming) - -macro-redefintion allows redefinition of macros (not ANSI conforming) - -no-trigraphs prevents expansion of trigraphs (not ANSI conforming) - -no-preprocessor prevents use of the bultin preprocessor - -E only preprocesses the file to .i Changes since V0.2p - bug fixed: strncat() did not append a 0, but behaved like strncpy (cla68k) - bug fixed: sizeof(uncomplete type) did not cause an error message - bug fixed: wrong code was generated for ?: if the condition evaluated to a scratch-var pointing somewhere - bug fixed: pointer:0 and 0:pointer was not allowed in conditional-exp - bug fixed: delayed popping produced wrong code with nested function calls - support for #line directive of most preprocessors added - several additions made to must_convert() (cga68k) - realloc() added to vc.lib (cla68k) - target-specific optimization options have been separated from the -O flag - the Amiga68k code generator now accepts the following flags to replace the former corresponding flags in the -O option: (cga68k) - -use-framepointer - -no-addressing-modes - -no-delayed-popping - bit 12 (4096) in -O activates function inlining; previously defined functions are inlined in their caller, depending on the size of the function - new option -inline-size can be used to in-/decrease the number of functions to be inlined; default=30 - higher values mean more functions get inlined Changes since V0.2n/0.2o - new option -optpasses=n sets the maximum number of optimizer passes - bug fixed: ADDI2P with a short integer sometimes was not converted if the target was a data register - constant data is placed in the code sections as long as -const-in-data is not specified (cga68k) - m040.lib started (cla68k) - unnecessary tst instructions are sometimes eliminated (cga68k) - constants -128<=x<128 are not copied in a register for SETRETURN and PUSH - COMPARE x,#0 should now always be converted to TEST x - bug fixed: a label-statement at the end of a block caused an error - bug fixed: sometimes still used type node was freed in alg_opt - bug fixed: unsigned function arguments were sometimes converted to signed - calling scheme for ieee and ldiv functions changed (cga68k) - usage of addressing modes with ieee and ldiv functions prohibited (cga68k) - bug fixed: files opened for append were deleted, oops (cla68k) - use of addressing modes slightly changed (cga68k) - modf, ldexp and frexp added to mieee.lib and m881.lib (cla68k) - bug fixed: unsigned integers were not allowed in case labels - bug fixed: push problem - bug fixed: cmp x,#0 was sometimes converted to tst x without changing the following branching instruction (cga68k) - for and while loops are generated differently when optimizing is activated (first testing of the loop condition can sometimes be deleted) - bug fixed: isquickkonst2 now tests for 0>0=a<<0=a and a few other algebraic optimizations added - insert_const2() added and insert_const() changed - saverestoreregs() now has a stack for the pushed register-lists (cga68k) (removed again, because saveregs/restoreregs has now been removed and mechanism changed) - bug fixed: delayed popping of function arguments corrected (cga68k) - delayed popping and omitting of framepointer can now be turned on separately (256 for framepointer, 512 for delayed popping) - bug fixed: stackoffset was sometimes incorrectly calculated - internal mechanism for passing function return values changed, structure returns should be reentrant now some library routines may have to be recompiled mieee.lib was rebuilt to use the new mechanism (cla68k) - op a,b->scratchvar; move scratchvar->c is combined to op a,b->c - handling of optimizations slightly changed - bug fixed: open_out() allocated a buffer one byte too small if the input file contained no period - bit 2... in -O option activate heavy optimizations - scratchvars are not assigned to registers during IC generation - labels are optimized and a flowgraph is constructed - branches to branches, branches to the following instruction etc. are optimised and unreachable code is eliminated - constants are propagated and folded - common subexpressions are eliminated - copies are propagated - active variables are analysed and dead assignments eliminated - temporary variables are recognized and assigned to registers - registers are assigned differently using information on active variables and loop structure - new source files added/changed: - opt.h : declarations etc. used in optimization routines - opt.c : general routines, peephole optimizations and control of optimization passes - flow.c: construction of flowgraphs, jump optimizations and other control-flow related routines - regs.c: register allocation - av.c : analysis of active variables and elimination of dead assignments - rd.c : analysis of reaching definitions, constant propagation and constant folding - cse.c : common subexpression elimination - cp.c : copy propagation - loop.c: analysis of loops and optimizations in loops - the following warnings have been added - use of variable before its initialization (with optimizer only) - dead assignments (opt only) - definition of global functions without prior declaration - non-void functions without return-statements - assignment in comparison context - weird code (opt only) Changes since V0.2m - if -ansi is specified assignments between differently signed pointers will cause an error - -dontwarn=n disables all warnings if n<0 - -warn option added to enable certain warnings, usage like -dontwarn - the following warnings have been added - implicit function declarations - function calls without prototype - use of #pragma - assignment/cast of integers to narrower type - cast of pointer to pointer with stricter alignment requirements - redundant comparisons with unsigned values - stupid, braindead error in codegenerator fixed (wrote to string constant and caused segmentation faults on systems with memory protection) (cga68k) - TimeDelay new in amiga.lib (has to be rebuilt) - ctype.h now has function prototypes and macros should be ok with negative arguments - macros in stdio.h now accept void* pointers and do some fancy type checking (cla68k) - temporary hack to display correct filename and line number in error messages - vc now handles filenames with spaces and always uses the complete path Changes since V0.2l - in conditional-expressions the type of the result was used for the generated comparison due to a bug - ceil() and floor() were added to m881.lib (cla68k) - flags may be specified more than once - vbcc does not change argv any more - output of errors/warnings changed and error/warning-texts put in - % with powers of two is not replaced by an 'and' any more if the operand is signed (cga68k) - entries in the history-file now in (bad) English rather than German - -dontwarn option added to suppress certain warnings - type conversions that are unnecessary on a certain machine may be omitted Aenderungen seit V0.2k - bei shifts werden keine arithmetischen Typerweiterungen mehr vorgenommen - endlose Fehlerschleifen sollten erkannt werden - Anfang eines SmallCode/SmallData-Modus; -sc und -sd schalten den jeweiligen Modus ein; deswegen wird auch vermehrt lea/pea verwendet (cga68k) - startup.o initialisiert nun a4 fuer den SmallData-Modus (cla68k) - die xref _LVO aus startup entfernt - fd2lib geschrieben - diverse Libraryfunktionen geschrieben (vla68k) - der rechte Teil einer conditional-expression ist jetzt eine conditional-expression (war faelschlicherweise expression) - Verwaltung der sections etwas geaendert; section=-1 am Anfang (cga68k) - Fehlerbehandlung verbessert: Initialisierungen von unvollstaendigen Strukturen/Unionen, Arrays mit size==0 und nicht vorhandene Identifier - Fehler bei der Erkennung von Fehler-Endlosschleifen behoben; funktioniert aber trotzdem nicht immer - Workaround fuer den compare-bug; leider nicht sehr schoen - Warnung bei dem Push-Problem - Ausdruecke hinter return wurden bemaengelt, wenn die Funktion void war - Funktionsargumente werden bei -O=256 nicht mehr sofort vom Stack geholt sondern, wenn moeglich gesammelt und dann auf einmal Aenderungen seit V0.2j - vc ruft jetzt 'FreePhxAss' statt 'CPhxAss' auf (vca68k) - free() verkraftet 0 (cla68k) - bei aufgetretenen Fehlern wird der Returncode auf EXIT_FAILURE gesetzt - keine Fehlermeldung bei Files ohne Funktionsdefinition mehr - Fehler behoben, der bei Verwendung einer Adressierungsart der Form (d,ax,dy.w[*z]) zu unnoetigen internal errors und evtl. Schlimmerem fuehrte (&7 vergessen) (cga68k) - difftime() wird in time.h als Makro definiert (cla68k) - #undef difftime in difftime.c eingefuegt (cla68k) - Deklaration von rename() in stdio.h korrigiert (cla68k) - wird Flag 8 (256) bei -O gesetzt, wird a5 nicht mehr als Framepointer benutzt (cga68k) - "offset out of object"-Meldungen geaendert - string-Funktionen geaendert (cla68k) - Fehler bei Registerallocation, der auftrat, wenn der Rueckgabewert nicht in einem Register zurueckgegen wird, behoben - Variablendeklaration geaendert; sollte jetzt korrekter sein und tentative definitions besser behandeln - fehlendes ; in stdlib.h eingefuegt (cla68k) - bei saveregs vor einem function call wird ein Scratchregister, ueber das die Funktion aufgerufen wird, nicht gespeichert - wenn der compare-Fehler auftritt sollte zumindest ein error gemeldet werden (cga68k) - wenn keine lokalen Variablen benutzt werden, wird kein Platz auf dem Stack gemacht (cga68k) - Berechnung des Alignments fuer Kopierschleife sollte jetzt auch ohne Framepointer korrekt sein (cga68k) - vc stark geaendert und config-file eingefuehrt (vca68k) - bei Meldungen wird der Filename mit ausgegeben Aenderungen seit V0.2i - Verbesserung der Codegenerierung fuer FPU-Operationen (cga68k) - Problem bei USEQ2ASZ und Zusammenfassen von IC/ASSIGN behoben - floating point nun auch ohne FPU moeglich, noch nicht 100% fehlerfrei (cga68k/cla68k) - Anfang einer Mathelibrary fuer die IEEE-Libraries (cla68k) FloatingPoint<->UnsignedInteger nicht korrekt - Fehler bei switch(UNSIGNED) behoben - alignment von struct-members sollte wieder passen - unsigned char/short->fp mit FPU korrigiert (cga68k) - ein labeled-statement enthaelt das nachfolgende statement - _main aus mieee.lib oeffnet die Libraries nun in der richtigen Reihenfolge (autsch) (cla68k) - Test auf am->Register in get_reg() eingebaut - Fehler bei Kopierschleife behoben - allocreg zaehlt bei Nutzung von erweiterten Adressierungsarten als zerstoerend; sollte damit jetzt halbwegs stabil sein; allerdings duerften noch internal errors, die aber wohl nichts mehr bedeuten, drin sein - allocreg/freereg von Registervariablen wird aus Code entfernt und internal errors sind beseitig; sollte nur Effekt haben, wenn Returnregister als Registervariable verwendet wird - bei initialisierten Unionen werden jetzt auch die uebrigen Werte aufgefuellt - bei initialisierten auto Strukturen und Unionen duerfen auch Strukturen/ Unionen gleichen Typs angegeben werden - die Kopierroutinen sollten jetzt in (fast?) allen Faellen korrekt funktionieren und teilweise auch schneller sein - Fehler mit auto arrays der Form a[]=... behoben; der Offset wurde nicht hochgezaehlt - difftime in der Math Library (cla68k) - einige ueble Fehler aus dem frontend fuer amiga68k entfernt (vca68k) - unbenannte Bitfelder werden bei Initialisierungen jetzt uebergangen - strengere Pruefung bei Zuweisungen zwischen Zeigern mit verschiedenen Qualifiern - Funktionsdefinitionen nach altem Stil erzeugen keinen Prototype mehr - float Parameter in alten Funktionsdefinitionen werden korrekt behandelt - diverse Aenderungen bei der Belegung von Registervariablen; gibt jetzt Register etwas leichter her Aenderungen seit V0.2h - Fehler beim Kommaoperator behoben und Meldung bei fehlenden sidefx - Konvertierungsroutinen fuer target data types geaendert - Routinen fuer Fehler/Warnungen akzeptieren jetzt beliebige Parameterlisten - Initialisierungen wie (cast)&var werden erlaubt (evtl. Probleme, wenn verschiedene Pointer existieren) - die Adresse eines Arrays kann jetzt ermittelt werden - Ueberpruefung der Gleichheit von Typen verbessert - Registerbelegung bei return verbessert - ueberfluessige Warnung bei nicht initialisierter const extern Variable entfernt - Franks div/mod in vc.lib eingebaut (cla68k) - Fliesskomma-returnwerte nur noch in fp0, wenn fuer fpu generiert wird (cga68k) - Stringkonstanten sind nicht mehr const char[] sondern char[] - vc versteht nun -l Option (vca68k) - printf/scanf durch leicht veraenderte Versionen aus libnix ersetzt (cla68k) - Anfang einer Mathelibrary fuer 68881 (cla68k) - (hoffentlich) korrekte floating point->integer Rundung bei FPU (cga68k) Aenderungen seit V0.2g - Fehler bei Registerbelegung in totem Code behoben - Fehler bei Registerbelegung in switch-statements behoben - boeser Fehler bei Variablen mit nicht-Register-return-values behoben - vc.lib: Ctrl-C wird erkannt (manchmal) (cla68k) - vc.lib: malloc() verbessert (cla68k) - vc.lib: limits.h korrigiert (cla68k) - vc.lib: time.h und time-Funktionen eingebaut (cla68k) - keine Warnung mehr bei const typedefs - Warnung bei Initialisierung von typedefs - verschiedene Aenderungen bei der Behandlung von storage-classes - globale static Variablen werden jetzt nicht mehr exportiert - storage-classes in Prototypen werden beachtet - const Variablen werden nicht mehr als Konstanten behandelt (war fehlerhaft) - Fehler in union atyps behoben (vuchar war zchar statt zuchar, argh!) - string concatenation eingebaut - Umwandlung unsigned->floating point mit FPU korrigiert (cga68k) - Vergleiche bei unsigned werden jetzt korrekt behandelt (cga68k) - bessere Behandlung von Funktionsprototypen - Zuweisungen zwischen Funktions- und Datenzeigern sind nicht mehr erlaubt Aenderungen seit V0.2f - -snma entfernt (cga68k) - einige Vereinfachungen im Codegenerator wegen reg/freg-Benutzung (cga68k) - Entfernung einiger alter Codefragmente im Codegenerator (cga68k) - Abfrage bei malloc() eingebaut - einige Fehler bei der IC-Generierung im Zusammenhang mit Registerbelegung behoben - Fehlerbehandlung verbessert; nach -maxerror=n (default 10) Fehlern wird Uebersetzung abgebrochen (bei 0 wird nicht abgebrochen) - -ansi unterdrueckt unwichtige Warnungen und Warnungen mit ANSI-Verletzung werden als Fehler behandelt - Flags loeschen jetzt durch &=~ - Zuweisungen von Arrays werden korrekt(er) behandelt (cga68k) - Zuweisungen von groesseren Typen geaendert, muss aber noch optimiert werden. (cga68k) - falscher Returncode in alg_opt() korrigiert - Behandlung von const-Konstanten korrigiert - Meldung, wenn main() nicht int ist - arithmetik mit void * nicht mehr erlaubt - casting nach void erlaubt Aenderungen seit V0.2e - Nutzung von 680x0-Adressierungsarten eingebaut (cga68k) - Schreibweise displ(ax) durch (displ,ax) ersetzt (cga68k) - Nutzung von reg/freg; dadurch kein zusaetzlicher Pass noetig (cga68k) Aenderungen seit V0.2d - Typpruefung bei Zuweisungen verbessert und nun auch bei Initialisierungen - freed free Register teilweise behoben (?) - Deklarationen von Prototypen ohne Typ werden bemaekelt - Abhanegigkeit in eigenen Include-Dateien behoben - Fehler bei arithmetischen Operationen behoben (cga68k) - falsche Fehlermeldung bei unsigned Typ als Schleifenbedingung - / und % wird nun auch mit 68000 unterstuetzt (wenn auch ineffizient) (cga68k) - Fehler bei ADDI2P und SUBIFP behoben - Fehler (mit DREFOBJ) bei Zusammenfassung op x,y->reg;move reg->z behoben - Optionen, die einen Parameter benoetigen, muessen jetzt -opt=parameter geschrieben werden, also z.B. vbcc -cpu=68020 file.c (das war noetig, um das Frontend und Wildcards zu vereinfachen) - enumerations eingebaut; noch einfach ohne grosse Tests, Tags werden ignoriert - arithmetische const Typen werden in Ausdruecken als Konstanten behandelt Aenderungen seit V0.2c - -noa4 Option hinzugekommen (cga68k) - Fehler beim Vertauschen von COMPARE-Argumenten und mustrepeat behoben (cga68k) - Fehler bei vorzeitiger Registerfreigabe bei POSTINC/POSTDEC behoben - Fehler bei mehreren Variablendeklarationen mit Funktionen behoben - Fehler bei dc float|double behoben (cga68k) - Fehler bei sections und dc/ds behoben (cga68k) - Fehler bei Rechnungen mit FP-Registern behoben (cga68k) - diverse Fehler bei a op= b behoben - jetzt hoffentlich immer korrekte Verwendung von lsl/lsr/asr (cga68k) - vbcc hat sich endlich erfolgreich selbst kompiliert - Fliesskommakonstanten eingebaut; Berechnung aber noch zu ungenau - Deklaration fuer Bitfields eingebaut; werden aber noch als Integers behandelt - Fehler bei interner Verarbeitung von Fliesskommazahlen behoben - Deklarationen der Form unsigned a; extern a; etc. werden zugelassen - Anfaenge einer eigenen C-Library Volker (volker@vb.franken.de)