+2016-07-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/71969
+ * c-decl.c (finish_function): Only set DECL_DISREGARD_INLINE_LIMITS
+ on GNU extern inline functions.
+
2016-07-29 Marek Polacek <polacek@redhat.com>
PR c/71583
/* For GNU C extern inline functions disregard inline limits. */
if (DECL_EXTERNAL (fndecl)
- && DECL_DECLARED_INLINE_P (fndecl))
+ && DECL_DECLARED_INLINE_P (fndecl)
+ && (flag_gnu89_inline
+ || lookup_attribute ("gnu_inline", DECL_ATTRIBUTES (fndecl))))
DECL_DISREGARD_INLINE_LIMITS (fndecl) = 1;
/* Genericize before inlining. Delay genericizing nested functions
+2016-07-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/71969
+ * gcc.dg/alias-11.c (add_cfi, new_cfi): Change __inline__ to
+ static __inline__.
+ * gcc.dg/pr71969-1.c: New test.
+ * gcc.dg/pr71969-2.c: New test.
+ * gcc.dg/pr71969-3.c: New test.
+
2016-07-29 Marek Polacek <polacek@redhat.com>
PR c/71574
unsigned fde_table_in_use;
dw_fde_node *fde_table;
-__inline__ void
+static __inline__ void
add_cfi (dw_cfi_node **list_head, dw_cfi_node *cfi)
{
dw_cfi_node **p;
*p = cfi;
}
-__inline__ struct dw_cfi_struct *
+static __inline__ struct dw_cfi_struct *
new_cfi (void)
{
dw_cfi_node *cfi = (dw_cfi_node *) malloc (sizeof (dw_cfi_node));
--- /dev/null
+/* PR c/71969 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -fno-gnu89-inline -O2 -fdump-tree-einline-details" } */
+
+volatile int v;
+#define S v++;
+#define S10 S S S S S S S S S S
+#define S100 S10 S10 S10 S10 S10 S10 S10 S10 S10 S10
+
+extern inline void
+foo (void) { S100 }
+
+inline void
+bar (void) { S100 }
+
+static inline void
+baz (void) { S100 }
+
+int
+main ()
+{
+ foo ();
+ foo ();
+ foo ();
+ foo ();
+ bar ();
+ bar ();
+ bar ();
+ bar ();
+ baz ();
+ baz ();
+ baz ();
+ baz ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will not early inline" 12 "einline" } } */
--- /dev/null
+/* PR c/71969 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -fno-gnu89-inline -O2 -fdump-tree-einline-details" } */
+
+volatile int v;
+#define S v++;
+#define S10 S S S S S S S S S S
+#define S100 S10 S10 S10 S10 S10 S10 S10 S10 S10 S10
+
+extern inline __attribute__((gnu_inline)) void
+foo (void) { S100 }
+
+int
+main ()
+{
+ foo ();
+ foo ();
+ foo ();
+ foo ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "Inlining foo into main" 4 "einline" } } */
--- /dev/null
+/* PR c/71969 */
+/* { dg-do compile } */
+/* { dg-options "-std=gnu99 -fgnu89-inline -O2 -fdump-tree-einline-details" } */
+
+volatile int v;
+#define S v++;
+#define S10 S S S S S S S S S S
+#define S100 S10 S10 S10 S10 S10 S10 S10 S10 S10 S10
+
+extern inline void
+foo (void) { S100 }
+
+inline void
+bar (void) { S100 }
+
+static inline void
+baz (void) { S100 }
+
+int
+main ()
+{
+ foo ();
+ foo ();
+ foo ();
+ foo ();
+ bar ();
+ bar ();
+ bar ();
+ bar ();
+ baz ();
+ baz ();
+ baz ();
+ baz ();
+ return 0;
+}
+
+/* { dg-final { scan-tree-dump-times "will not early inline" 8 "einline" } } */
+/* { dg-final { scan-tree-dump-times "Inlining foo into main" 4 "einline" } } */