summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gnat.dg/specs/rep_clause4.ads42
-rw-r--r--gcc/tree-ssa-sccvn.c4
4 files changed, 54 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d85370692eb..6a4c7ee48a2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-31 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-ssa-sccvn.c (vn_reference_lookup_3): Bail out instead of
+ aborting if the sizes of the two references don't match.
+
2009-10-31 Toon Moene <toon@moene.org>
* ipa-inline.c (cgraph_decide_inlining):
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 042b4eca675..14c8a50d711 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,9 +1,12 @@
+2009-10-31 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/rep_clause4.ads: New test.
+
2009-10-30 Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
PR target/41885
* gcc.target/avr/torture/pr41885.c: New test.
-
2009-10-30 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/pack5.ads: New test.
diff --git a/gcc/testsuite/gnat.dg/specs/rep_clause4.ads b/gcc/testsuite/gnat.dg/specs/rep_clause4.ads
new file mode 100644
index 00000000000..8009f876cf2
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/specs/rep_clause4.ads
@@ -0,0 +1,42 @@
+-- { dg-do compile }
+-- { dg-options "-O" }
+
+package Rep_Clause4 is
+
+ type Uns16 is mod 2**16;
+
+ type Rec32 is
+ record
+ W1 : Uns16 := 1;
+ W2 : Uns16 := 2;
+ end record;
+ for Rec32 use
+ record
+ W1 at 0 range 0..15;
+ W2 at 2 range 0..15;
+ end record;
+ for Rec32'size use 32;
+
+ type Rec48 is
+ record
+ W1andW2 : Rec32;
+ W3 : Uns16;
+ end record;
+ for Rec48 use
+ record
+ W1andW2 at 0 range 0..31;
+ W3 at 4 range 0..15;
+ end record;
+ for Rec48'size use 48;
+
+ type Rec_Type is
+ record
+ Field1 : Rec48;
+ end record;
+ for Rec_Type use
+ record
+ Field1 at 0 range 0 .. 47;
+ end record;
+ for Rec_Type'size use 48;
+
+end Rep_Clause4;
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 4158fbd88df..0a8dcaa36c4 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -1157,7 +1157,9 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
/* Adjust *ref from the new operands. */
if (!ao_ref_init_from_vn_reference (&r, vr->set, vr->type, vr->operands))
return (void *)-1;
- gcc_assert (ref->size == r.size);
+ /* This can happen with bitfields. */
+ if (ref->size != r.size)
+ return (void *)-1;
*ref = r;
/* Keep looking for the adjusted *REF / VR pair. */