gcc/fix-PR83666-punt-BLKmode-when-expand_debug_expr.patch
eastb233 6be565f050 [Bugfix] Fix ICEs when compiling simde
- fix-PR83666-punt-BLKmode-when-expand_debug_expr.patch: New patch for
  bugfix
- fix-AArch64-128-bit-immediate-ICEs.patch: Likewise
- gcc.spec: Add new patch
2021-06-28 21:36:37 +08:00

51 lines
1.2 KiB
Diff

This backport contains 1 patch from gcc main stream tree.
The commit id of these patchs list as following in the order of time.
0001-re-PR-debug-83666-ICE-SIGFPE-with-O2-g-param-sccvn-m.patch
c54af0682ce0881ecde74a3b7502287a53ced378
diff -Nurp a/gcc/cfgexpand.c b/gcc/cfgexpand.c
--- a/gcc/cfgexpand.c 2021-06-20 21:43:53.568000000 -0400
+++ b/gcc/cfgexpand.c 2021-06-20 22:04:33.432000000 -0400
@@ -4516,7 +4516,7 @@ expand_debug_expr (tree exp)
if (bitpos < 0)
return NULL;
- if (GET_MODE (op0) == BLKmode)
+ if (GET_MODE (op0) == BLKmode || mode == BLKmode)
return NULL;
if ((bitpos % BITS_PER_UNIT) == 0
diff -Nurp a/gcc/testsuite/gcc.dg/pr83666.c b/gcc/testsuite/gcc.dg/pr83666.c
--- a/gcc/testsuite/gcc.dg/pr83666.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/pr83666.c 2021-06-20 22:04:33.432000000 -0400
@@ -0,0 +1,28 @@
+/* PR debug/83666 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g --param=sccvn-max-scc-size=10 -Wno-psabi" } */
+
+typedef int __attribute__ ((vector_size (64))) V;
+
+int c, d;
+short e;
+V g;
+
+V
+bar (void)
+{
+ g[1] = d;
+ do
+ {
+ e += c;
+ g = g > 0;
+ }
+ while (g[1]);
+ return g;
+}
+
+void
+foo (void)
+{
+ int x = bar ()[3];
+}