* expmed.c (strict_volatile_bitfield_p): Fix off-by-one error.
* gcc.dg/
20141029-1.c: New.
From-SVN: r216844
+2014-10-29 DJ Delorie <dj@redhat.com>
+
+ * expmed.c (strict_volatile_bitfield_p): Fix off-by-one error.
+
2014-10-29 Martin Liska <mliska@suse.cz>
PR ipa/63587
/* Check for cases where the C++ memory model applies. */
if (bitregion_end != 0
&& (bitnum - bitnum % modesize < bitregion_start
- || bitnum - bitnum % modesize + modesize > bitregion_end))
+ || bitnum - bitnum % modesize + modesize - 1 > bitregion_end))
return false;
return true;
+2014-10-29 DJ Delorie <dj@redhat.com>
+
+ * gcc.dg/20141029-1.c: New.
+
2014-10-29 Martin Liska <mliska@suse.cz>
PR ipa/63587
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fstrict-volatile-bitfields -fdump-rtl-final" } */
+
+#define PERIPH (*(volatile struct system_periph *)0x81234)
+
+struct system_periph {
+ union {
+ unsigned short WORD;
+ struct {
+ unsigned short a:1;
+ unsigned short b:1;
+ unsigned short :5;
+ unsigned short c:1;
+ unsigned short :8;
+ } BIT;
+ } ALL;
+};
+
+void
+foo()
+{
+ while (1)
+ {
+ PERIPH.ALL.BIT.a = 1;
+ }
+}
+/* { dg-final { scan-rtl-dump-times "mem/v(/.)*:HI" 4 "final" } } */
+/* { dg-final { cleanup-rtl-dump "final" } } */