[lisaac-Bugs][312025] C structs are optimized out even if aliased

lisaac-bugs at alioth.debian.org lisaac-bugs at alioth.debian.org
Wed Nov 11 20:43:14 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: Closed
Priority: 1
Submitted By: Mildred Ki'Lya (mildred-guest)
Assigned to: Nobody (None)
Summary: C structs are optimized out even if aliased 
Target Milestone: None
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 */`;

    ...
  );

----------------------------------------------------------------------

Comment By: Mildred Ki'Lya (mildred-guest)
Date: 2009-11-11 16:42

Message:
Can't reproduce the bug using a smaller testcase (see test typedef_missing)

----------------------------------------------------------------------

Comment By: Mildred Ki'Lya (mildred-guest)
Date: 2009-10-28 15:43

Message:
Attached t5.tar.bz2 that shows the bug clearly. This is not a minimalist testcase, sorry

----------------------------------------------------------------------

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