Re: [cc65] structure bug?

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2001-05-24 20:45:00


On Thu, May 24, 2001 at 06:28:41AM -0400, Mark Keates wrote:
> Have a look at this code at the end of this post.
[...]
> Is this a bug?

Yes, this is a bug. It has the same reason as the bug posted by me to the bugs
page this morning: Mixing pure constants and constant offsets (E_MCONST).

Unfortunately, there is no easy solution. The handling of the E_MCONST flag is
a mess, and it is often not easy to determine if a change in one place will
not break other things. So I don't want to fix that in the 2.6.1 version of
the compiler, because I'm anxious it will break other things. I will add the
necessary changes to the snapshot, so I have some time to test them.

But negative offsets will not work, even with the fixes. Currently, offsets
are always positive and there are too many places where offsets are handled as
unsigned data types to make this an easy change. In addition, ANSI disallows
calculating pointers that point outside of objects, so your code is not
standard compliant anyway. I agree that it may be useful to have negative
offsets, so I will probably fix that in the future, but it's a nice excuse to
have the standard on your side:-)

I'm about to rip the compiler apart again to make more changes on the backend.
This means that it will not be possible to compile working sources for some
time, so I will copy the current snapshot with the mentioned fixes to
cc65-sources-snapshot-kg.tar.gz. This version contains several addition
compared to version 2.6.1. Below is my list of changes so far, any feedback on
the snapshot is - as always - very appreciated. To get an impression of the
new backend, try the -T flag - it works a lot better than in the old version.


  * Assembler:

      - More flexible .INCBIN command

      - Line info placed into object files and passed to linker.


  * Compiler:

      - New compiler option --create-dep to create a dependency list for a
	makefile.

      - Option and pragma to generate stack overflow checks.

      - Transparent and efficient handling of fixed params in variadic
	functions.

      - Build parameter frames when calling other functions by adjusting
	the stack once and then storing into this frame instead of pushing
	each parameter separately.

      - Functions do now have a common exit point (again).

      - Added an additional command line option --codesize that gives the
	factor (in percent) how much code inlining should be done by the
	compiler. This allows finer control about size vs. speed code
	generation issues.

      - The literal pool works now without a hardcoded limit.

      - New, much improved backend.

      - Compiler generates line info for the assembler.


  * Linker

      - Symbols may now be defined in the config file.


  * cl65 utility:


  * Library

      - C64 startup code no longer uses fixed stack top.

      - Stack size now defined by linker symbol in configuration file.

      - Several changed/added runtime functions for better performance.


  * Generic

      - Command line response files.

      - Moved Verbosity flag and corresponding output code to a shared module.


Regards


        Uz


--
Ullrich von Bassewitz                                  uz_at_musoftware.de
	   
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:40 CET