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]

[PATCH] Fix PR42991 and its dups


On odd trees, like component-refs of fields of unspecified size
like struct { int a[]; } we fail to initialize *pbitsize in
get_inner_reference.  This leads to uninitialized uses.

Fixed with the following, bootstrapped and tested on 
x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2010-02-07  Richard Guenther  <rguenther@suse.de>

	PR middle-end/42991
	* expr.c (get_inner_reference): Always initialize *pbitsize.

Index: gcc/expr.c
===================================================================
*** gcc/expr.c	(revision 156572)
--- gcc/expr.c	(working copy)
*************** get_inner_reference (tree exp, HOST_WIDE
*** 5968,5973 ****
--- 5968,5974 ----
  
    /* First get the mode, signedness, and size.  We do this from just the
       outermost expression.  */
+   *pbitsize = -1;
    if (TREE_CODE (exp) == COMPONENT_REF)
      {
        tree field = TREE_OPERAND (exp, 1);


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