Bug 25360 - Complex types are not encoded
Summary: Complex types are not encoded
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: objc (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Andrew Pinski
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: patch, wrong-code
Depends on:
Blocks:
 
Reported: 2005-12-12 05:53 UTC by Andrew Pinski
Modified: 2005-12-16 20:05 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-12-14 22:41:05


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-12-12 05:53:19 UTC
The following testsuite fails because of this
FAIL: objc.dg-struct-layout-encoding-1/t024_main.m execution test

unknown type ]}
struct { _Complex float a;} size is 8, but is calulated as 0
struct { _Complex float a;} align is 4, but is calulated as 1
struct { _Complex unsigned int a;} size is 8, but is calulated as 0
struct { _Complex unsigned int a;} align is 4, but is calulated as 1
FAIL: objc.dg-struct-layout-encoding-1/t024_main.m execution test
Comment 1 Andrew Pinski 2005-12-14 22:41:05 UTC
I am handling this one, I sent a RFC to the objective-C language list.
Comment 2 Andrew Pinski 2005-12-16 06:08:02 UTC
Patch here:
http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01234.html

This also includes the libobjc part.
Comment 3 Andrew Pinski 2005-12-16 20:05:00 UTC
Fixed.
Comment 4 Andrew Pinski 2005-12-16 20:19:41 UTC
Subject: Bug 25360

Author: pinskia
Date: Fri Dec 16 20:19:37 2005
New Revision: 108675

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108675
Log:
2005-12-14  Andrew Pinski  <pinskia@physics.uc.edu>

        PR objc/25360
        * objc/objc-act.c (encode_type): Encode Complex types as 'j' followed
        by the inner type.

2005-12-14  Andrew Pinski  <pinskia@physics.uc.edu>

        PR objc/25360
        * objc/objc-api.c (_C_COMPLEX): New define.
        * encoding.c (objc_sizeof_type): Handle _C_Complex.
        (objc_alignof_type): Likewise.
        (objc_skip_typespec): Likewise.


Modified:
    trunk/gcc/objc/ChangeLog
    trunk/gcc/objc/objc-act.c
    trunk/libobjc/ChangeLog
    trunk/libobjc/encoding.c
    trunk/libobjc/objc/objc-api.h