aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-05-31 21:49:54 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2018-05-31 21:49:54 +0200
commit28c84b6247e1ff5f3c7aa4c4912c361012fa3904 (patch)
tree29650364918c3f3a5e19f8490a14d0bd73152cc5
parent8b8003ed544bf7fd45192ad6b9429512dedc1a55 (diff)
downloadgcc-28c84b6247e1ff5f3c7aa4c4912c361012fa3904.zip
gcc-28c84b6247e1ff5f3c7aa4c4912c361012fa3904.tar.gz
gcc-28c84b6247e1ff5f3c7aa4c4912c361012fa3904.tar.bz2
re PR target/85984 (ICE in create_pseudo_cfg, at dwarf2cfi.c:2874)
PR target/85984 * bb-reorder.c (pass_partition_blocks::gate): Return false for functions with naked attribute. * gcc.target/i386/pr85984.c: New test. From-SVN: r261037
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/bb-reorder.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr85984.c18
4 files changed, 32 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a4563e0..09c8b7c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-05-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/85984
+ * bb-reorder.c (pass_partition_blocks::gate): Return false for
+ functions with naked attribute.
+
2018-05-31 Uros Bizjak <ubizjak@gmail.com>
* config/i386/sse.md (avx_vec_concat<mode>):
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 6f2ad5a..d1019d0 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -2928,8 +2928,8 @@ pass_partition_blocks::gate (function *fun)
{
/* The optimization to partition hot/cold basic blocks into separate
sections of the .o file does not work well with linkonce or with
- user defined section attributes. Don't call it if either case
- arises. */
+ user defined section attributes or with naked attribute. Don't call
+ it if either case arises. */
return (flag_reorder_blocks_and_partition
&& optimize
/* See pass_reorder_blocks::gate. We should not partition if
@@ -2937,6 +2937,7 @@ pass_partition_blocks::gate (function *fun)
&& optimize_function_for_speed_p (fun)
&& !DECL_COMDAT_GROUP (current_function_decl)
&& !lookup_attribute ("section", DECL_ATTRIBUTES (fun->decl))
+ && !lookup_attribute ("naked", DECL_ATTRIBUTES (fun->decl))
/* Workaround a bug in GDB where read_partial_die doesn't cope
with DIEs with DW_AT_ranges, see PR81115. */
&& !(in_lto_p && MAIN_NAME_P (DECL_NAME (fun->decl))));
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b414492..e0745e0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/85984
+ * gcc.target/i386/pr85984.c: New test.
+
2018-05-31 Martin Sebor <msebor@redhat.com>
PR c/82063
diff --git a/gcc/testsuite/gcc.target/i386/pr85984.c b/gcc/testsuite/gcc.target/i386/pr85984.c
new file mode 100644
index 0000000..23dd53d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr85984.c
@@ -0,0 +1,18 @@
+/* PR target/85984 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int foo (void);
+
+void __attribute__((naked))
+bar (void)
+{
+ if (!foo ())
+ __builtin_abort ();
+}
+
+void
+baz (void)
+{
+ bar ();
+}