This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/38271] [4.4 Regression] Spurious / missing "... used uninitialized in this function" warning
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Dec 2008 13:05:12 -0000
- Subject: [Bug middle-end/38271] [4.4 Regression] Spurious / missing "... used uninitialized in this function" warning
- References: <bug-38271-16926@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from rguenth at gcc dot gnu dot org 2008-12-05 13:05 -------
The following would make SRA only combine all of the struct or nothing. That
avoids these messy situations:
Index: tree-sra.c
===================================================================
--- tree-sra.c (revision 142469)
+++ tree-sra.c (working copy)
@@ -1695,7 +1695,10 @@ try_instantiate_multiple_fields (struct
gcc_assert (~alchk < align);
- /* Create the field group as a single variable. */
+ /* Create the field group as a single variable if the group covers
+ the whole element. */
+ if (size != TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (elt->element))))
+ return f;
/* We used to create a type for the mode above, but size turns
to be out not of mode-size. As we need a matching type
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38271