Hi,
I found some more testcases that would cause an internal compiler
error while working on my bit-field lowering pass. Since there was no
testcase already done, I thought it would be best if it was applied to
the trunk.
Thanks,
Andrew Pinski
testsuite/ChangeLog:
* gcc.c-torture/compile/20200105-1.c: New testcase.
* gcc.c-torture/compile/20200105-2.c: New testcase.
* gcc.c-torture/compile/20200105-3.c: New testcase.
Index: gcc.c-torture/compile/20200105-1.c
===================================================================
--- gcc.c-torture/compile/20200105-1.c (nonexistent)
+++ gcc.c-torture/compile/20200105-1.c (working copy)
@@ -0,0 +1,12 @@
+struct mouse_button_str {
+ unsigned char left : 1;
+ unsigned char right : 1;
+ unsigned char middle : 1;
+ };
+int g(void)
+{
+ signed char a = 0;
+ struct mouse_button_str *newbutton1 = (struct mouse_button_str*)&a;
+ newbutton1->left = 1;
+ return a;
+}
Index: gcc.c-torture/compile/20200105-2.c
===================================================================
--- gcc.c-torture/compile/20200105-2.c (nonexistent)
+++ gcc.c-torture/compile/20200105-2.c (working copy)
@@ -0,0 +1,12 @@
+struct mouse_button_str {
+ signed char left : 1;
+ signed char right : 1;
+ signed char middle : 1;
+};
+int g(void)
+{
+ unsigned char a = 0;
+ struct mouse_button_str *newbutton1 = (struct mouse_button_str*)&a;
+ newbutton1->left = 1;
+ return a;
+}
Index: gcc.c-torture/compile/20200105-3.c
===================================================================
--- gcc.c-torture/compile/20200105-3.c (nonexistent)
+++ gcc.c-torture/compile/20200105-3.c (working copy)
@@ -0,0 +1,12 @@
+struct mouse_button_str {
+ unsigned char left : 1;
+ unsigned char right : 1;
+ unsigned char middle : 1;
+};
+int g(void)
+{
+ unsigned char a = 0;
+ struct mouse_button_str *newbutton1 = (struct mouse_button_str*)&a;
+ newbutton1->left = 1;
+ return a;
+}