www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Issue 24] New: GDC backend uses invalid type when using deferencing


             Bug #: 24
           Summary: GDC backend uses invalid type when using deferencing
                    toPtr on a static array inside of a struct.
    Classification: Unclassified
           Product: GDC
           Version: 4.8.x
          Platform: x86
        OS/Version: Other
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
        AssignedTo: ibuclaw gdcproject.org
        ReportedBy: venix1 gmail.com

The following code snippet will cause an ICE within the compiler.  This
occurred with GDC 4.8 head as of October 4th.


struct a
    char[1] b;

a c;

void main()
    pragma(msg, typeof(*c.b.ptr));
    pragma(msg, typeof(c.b.ptr));
    pragma(msg, typeof(c.b));
    if (*c.b.ptr)


The type used by GCC for *c.b.ptr is char[1LU] when it should be char as
reported by D's type system.

$ gdc test.d=20
test.d: In function =E2=80=98D main=E2=80=99:
test.d:8: error: mismatching comparison operand types
if (D.2039 !=3D 0) goto <D.2040>; else goto <D.2041>;

test.d:8: internal compiler error: verify_gimple failed
0x98f4af verify_gimple_in_seq(gimple_statement_d*)
0x828cb4 gimplify_body(tree_node*, bool)
0x829005 gimplify_function_tree(tree_node*)
0x6d1147 cgraph_analyze_function
0x6d3f8e cgraph_analyze_functions
0x6d4e50 finalize_compilation_unit()
0x61c704 d_write_global_declarations
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Configure issuemail: http://gdcproject.org/bugzilla/userprefs.cgi?tab=3Dema=
------- You are receiving this mail because: -------
You are watching all issue changes.=
Oct 29 2012