[lisaac-Bugs][312025] C structs are optimized out even if aliased
lisaac-bugs at alioth.debian.org
lisaac-bugs at alioth.debian.org
Wed Oct 28 14:43:00 UTC 2009
Bugs item #312025, was changed at 2009-10-23 02:25 by Mildred Ki'Lya
You can respond by visiting:
https://alioth.debian.org/tracker/?func=detail&atid=413092&aid=312025&group_id=100200
Status: Open
Priority: 3
Submitted By: Mildred Ki'Lya (mildred-guest)
Assigned to: Nobody (None)
Summary: C structs are optimized out even if aliased
Target Milestone: Lisaac 0.4
Category: Lisaac Compiler
Initial Comment:
Sometimes, the compiler generated a typedef like:
typedef struct CLONABLE__WB_struct __STACK_FRAME__EC; // ALIAS with CLONABLE__WB
It means that the type __STACK_FRAME and __CLONABLE have the same struct layout. Thus, intelligently, the compiler uses the CLONABLE_struct instead of creating a STACK_FRAME_struct.
Now, sometimes, when CLONABLE is never used (or used only for inheritance), the compiler detects that it doesn't need the type __CLONABLE. As a consequence it removes the typedef for __CLONABLE and thestruct declaration for CLONABLE_struct.
Now, unfortunately, the __STACK_FRAME type doesn't have its struct and the generated C code have incomplete types. makeing it impossible to dereference pointers or call sizeof() on the type. This is very annoying.
A workaround is to force the creation of the __CLONABLE type using for example:
- main <-
( + c:CLONABLE;
c := CLONABLE;
`/* @c */`;
...
);
----------------------------------------------------------------------
You can respond by visiting:
https://alioth.debian.org/tracker/?func=detail&atid=413092&aid=312025&group_id=100200
More information about the Lisaac-devel
mailing list