]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR c++/58372 (internal compiler error: ix86_compute_frame_layout)
authorUros Bizjak <ubizjak@gmail.com>
Sun, 11 Nov 2018 17:44:43 +0000 (18:44 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Sun, 11 Nov 2018 17:44:43 +0000 (18:44 +0100)
Backport from mainline
2018-11-04  Uros Bizjak  <ubizjak@gmail.com>

PR middle-end/58372
* cfgexpand.c (pass_expand::execute): Move the call to
finish_eh_generation in front of the call to expand_stack_alignment.

testsuite/ChangeLog:

Backport from mainline
2018-11-04  Uros Bizjak  <ubizjak@gmail.com>

PR middle-end/58372
* g++.dg/pr58372.C: New test.

From-SVN: r266015

gcc/ChangeLog
gcc/cfgexpand.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr58372.C [new file with mode: 0644]

index d6877a588aad323216a07108c6f7f2aacead8204..a65e60019dfea9a50a70b753bf157ef418c6a6fb 100644 (file)
@@ -1,3 +1,12 @@
+2018-11-11  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline
+       2018-11-04  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR middle-end/58372
+       * cfgexpand.c (pass_expand::execute): Move the call to
+       finish_eh_generation in front of the call to expand_stack_alignment.
+
 2018-11-07  Max Filippov  <jcmvbkbc@gmail.com>
 
        Backport from mainline
index 4b98582256885c2c48267a30e5351c9908eade96..7fd3916a3c774a6e483c19513b801569daaaf8b6 100644 (file)
@@ -6466,6 +6466,14 @@ pass_expand::execute (function *fun)
   find_many_sub_basic_blocks (blocks);
   purge_all_dead_edges ();
 
+  /* After initial rtl generation, call back to finish generating
+     exception support code.  We need to do this before cleaning up
+     the CFG as the code does not expect dead landing pads.  */
+  if (fun->eh->region_tree != NULL)
+    finish_eh_generation ();
+
+  /* Call expand_stack_alignment after finishing all
+     updates to crtl->preferred_stack_boundary.  */
   expand_stack_alignment ();
 
   /* Fixup REG_EQUIV notes in the prologue if there are tailcalls in this
@@ -6473,12 +6481,6 @@ pass_expand::execute (function *fun)
   if (crtl->tail_call_emit)
     fixup_tail_calls ();
 
-  /* After initial rtl generation, call back to finish generating
-     exception support code.  We need to do this before cleaning up
-     the CFG as the code does not expect dead landing pads.  */
-  if (fun->eh->region_tree != NULL)
-    finish_eh_generation ();
-
   /* Remove unreachable blocks, otherwise we cannot compute dominators
      which are needed for loop state verification.  As a side-effect
      this also compacts blocks.
index 3564bfdc6b021d0ffc1a01ec77f5b12f0d28e6e7..7cef3b011d5a70ec52dbc88f4a95a46ff39544f4 100644 (file)
@@ -1,3 +1,11 @@
+2018-11-11  Uros Bizjak  <ubizjak@gmail.com>
+
+       Backport from mainline
+       2018-11-04  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR middle-end/58372
+       * g++.dg/pr58372.C: New test.
+
 2018-11-08  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/null_pointer_deref1.adb: Remove -gnatp and add pragma.
diff --git a/gcc/testsuite/g++.dg/pr58372.C b/gcc/testsuite/g++.dg/pr58372.C
new file mode 100644 (file)
index 0000000..865f88e
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR target/58372 */
+/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target c++14 } */
+
+__attribute__ ((__target__ ("rdrnd")))
+void f (unsigned int *b) noexcept
+{
+  __builtin_ia32_rdrand32_step (b);
+}