First Last Prev Next    No search results available
Details
: [llvm-gcc] Illegal union field reference
Bug#: 143
: tools
: llvm-gcc
Status: RESOLVED
Resolution: FIXED
: All
: All
: 1.0
: P2
: normal
: 1.1

:
: compile-fail
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Misha Brukman <brukman+bugs@uiuc.edu>
Assigned To: Chris Lattner <sabre@nondot.org>
:

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2003-11-20 14:49
Reduced from xemacs-21.5.14:

% cat doprnt.i
struct printf_spec {
  unsigned int minus_flag:1;
  char converter;
};

void parse_doprnt_spec () {
  struct printf_spec spec;
  spec.minus_flag = 1;
}
% llvm-gcc doprnt.i
cc1: ../../gcc-3.4/gcc/llvm-expand.c:4659: llvm_expand_lvalue_expr: Assertion
`(ActualSize & 7) == 0 && (Size & 7) == 0 && "Illegal union field reference!"'
failed.
doprnt.i: In function `parse_doprnt_spec':

doprnt.i:9: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://llvm.cs.uiuc.edu> for instructions.
------- Comment #1 From Chris Lattner 2003-11-20 14:58:28 -------
Fixed.  Testcase: CFrontend/2003-11-20-UnionBitfield.c

Patch:
$ diff -u llvm-expand.c~ llvm-expand.c
--- llvm-expand.c~      2003-11-20 13:38:23.000000000 -0600
+++ llvm-expand.c       2003-11-20 14:54:50.000000000 -0600
@@ -4655,8 +4655,6 @@
        *  pointer to the desired type now.
        */
       if (ActualOffset == Offset && ResultElTy != FieldDeclTy) {
-        assert((ActualSize & 7) == 0 && (Size & 7) == 0 &&
-               "Illegal union field reference!");
         Result = cast_if_type_not_equal(Fn, Op0,
                                         llvm_type_get_pointer(FieldDeclTy));
         ResultElTy = GET_POINTER_TYPE_ELEMENT(Result->Ty);

-Chris

First Last Prev Next    No search results available