@@ -226,7 +226,8 @@ static tree
get_field_at_bit_offset (tree record_type, bit_offset_t bit_offset)
{
gcc_assert (TREE_CODE (record_type) == RECORD_TYPE);
- gcc_assert (bit_offset >= 0);
+ if (bit_offset < 0)
+ return NULL;
/* Find the first field that has an offset > BIT_OFFSET,
then return the one preceding it.
new file mode 100644
@@ -0,0 +1,36 @@
+/* { dg-additional-options "-O1" } */
+
+struct vd {
+ struct vd *rs;
+};
+
+struct fh {
+ struct vd cl;
+};
+
+struct i3 {
+ struct fh *h4;
+};
+
+struct fh *
+gm (void);
+
+void
+j7 (struct vd *);
+
+inline void
+mb (struct vd *e7)
+{
+ j7 (e7->rs);
+}
+
+void
+po (struct i3 *d2)
+{
+ struct i3 *s2;
+
+ d2->h4 = gm ();
+ mb (&d2->h4->cl);
+ s2 = ({ d2 - 1; });
+ po (s2);
+}