This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

segfault in categorize_ctor_elements_1


rth's new code bombs on powerpc-linux and powerpc64-linux bootstrap.

(gdb) p list
$1 = 0x0
(gdb) p ctor
$2 = 0xf7d814e0
(gdb) p debug_tree (ctor)
 <constructor 0xf7d814e0
    type <union_type 0xf7d91258 __gthread_mutex_t asm_written type_1 type_5 BLK
        size <integer_cst 0xf7d34320 constant invariant 192>
        unit size <integer_cst 0xf7d341e0 constant invariant 24>
        align 32 symtab -136792192 alias set -1
        fields <field_decl 0xf7d42438 __data type <record_type 0xf7d40f78 ._5>
            in_system_header nonlocal decl_3 BLK file /home/alan/powerpc-linux/include/bits/pthreadtypes.h line 80 size <integer_cst 0xf7d34320 192> unit size <integer_cst 0xf7d341e0 24>
            align 32 offset_align 128
            offset <integer_cst 0xf7edd180 constant invariant 0>
            bit offset <integer_cst 0xf7edd960 constant invariant 0> context <union_type 0xf7d40ca8 pthread_mutex_t> arguments <integer_cst 0xf7edd180 0> chain <field_decl 0xf7d425a0 __size>>
        X() X(constX&) this=(X&)
        pointer_to_this <pointer_type 0xf7d94b40> chain <type_decl 0xf7d40d98 ._4>>
    constant invariant static>
$3 = void

	* expr.c (categorize_ctor_elements_1): Don't segv on NULL
	CONSTUCTOR_ELTS.

Index: gcc/expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.776
diff -u -p -r1.776 expr.c
--- gcc/expr.c	27 Jan 2005 00:07:41 -0000	1.776
+++ gcc/expr.c	29 Jan 2005 23:01:11 -0000
@@ -4360,6 +4360,7 @@ categorize_ctor_elements_1 (tree ctor, H
     }
 
   if (!*p_must_clear
+      && CONSTRUCTOR_ELTS (ctor) != NULL_TREE
       && (TREE_CODE (TREE_TYPE (ctor)) == UNION_TYPE
 	  || TREE_CODE (TREE_TYPE (ctor)) == QUAL_UNION_TYPE))
     {

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]