]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-sra.c (build_ref_for_offset_1): Allow for zero size fields.
authorMartin Jambor <mjambor@suse.cz>
Thu, 21 Jan 2010 16:04:12 +0000 (17:04 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Thu, 21 Jan 2010 16:04:12 +0000 (17:04 +0100)
2010-01-21  Martin Jambor  <mjambor@suse.cz>

* tree-sra.c (build_ref_for_offset_1): Allow for zero size fields.

From-SVN: r156155

gcc/ChangeLog
gcc/tree-sra.c

index 349e1511f0b5a53844f51a6525bb3a5053a1621c..011af1de6c8fa69c7d99f6b4c8c400d816f80d56 100644 (file)
@@ -1,3 +1,7 @@
+2010-01-21  Martin Jambor  <mjambor@suse.cz>
+
+       * tree-sra.c (build_ref_for_offset_1): Allow for zero size fields.
+
 2010-01-21  Andrew Haley  <aph@redhat.com>
 
         * gcc.c (process_command): Move lang_specific_driver before
index dd62cc53798653c9ccd8eee8d46aa48e7eb2eecd..bc729ba5256db0ad4cc82f99d11628a9676af4a8 100644 (file)
@@ -1288,7 +1288,12 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset,
              if (!tr_size || !host_integerp (tr_size, 1))
                continue;
              size = tree_low_cst (tr_size, 1);
-             if (pos > offset || (pos + size) <= offset)
+             if (size == 0)
+               {
+                 if (pos != offset)
+                   continue;
+               }
+             else if (pos > offset || (pos + size) <= offset)
                continue;
 
              if (res)