bugTiny C Compiler - Bugs: bug #63895, TCC: Wrong initialization of an...


bug #63895: TCC: Wrong initialization of an array, when the struct includes another struct with some bitfields (#yarpgen v1)

Submitter:  Detlef Riekenberg <wine_dev>
Submitted:  Wed 08 Mar 2023 04:23:31 PM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

Wed 15 Mar 2023 07:28:40 PM UTC, comment #1: 

This bug and the following detected bugs
are all fixed in the current mob branch.

Thanks for everyone improving tcc to get the testcases
from yarpgen (v1) working with tcc.

Regards ... Detlef

Detlef Riekenberg <wine_dev>
Wed 08 Mar 2023 04:23:31 PM UTC, original submission:  

There are still bugs in tcc for testcodes generated by yarpgen v1.

Attached is a stripped down result of yarpgen (v1) with a seed of 84.

The initialization of an array of struct tf_3_struct_2 items fails with tcc.
Some items in struct tf_3_struct_2 are of the type tf_3_struct_1.

tcc fails always to correctly initialize the member_1_3 in every tf_3_struct_1.

Some members of struct tf_3_struct_1 are bitfields, but not the failing item "member_1_3".
I have no idea, if the buggy initialization is related to the bitfields.

driver.c is the stripped buggy file, filled with a big bunch of printf().

diff-O0 calls the reference compiler (ref-O0.sh: I use gcc)
and the test compiler (tst-O0.sh: tcc) and displays a diff
of the saved output from running the created binaries

Regards ... Detlef

Detlef Riekenberg <wine_dev>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #54465:  00084_mod.tar.gz added by wine_dev (12KiB - application/gzip)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by wine_dev (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-03-08 wine_dev Attached File- Added 00084_mod.tar.gz, #54465

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code