1 2007-11-06 Jakub Jelinek <jakub@redhat.com>
3 PR tree-optimization/33763
4 * gcc.dg/pr33763.c: New test.
5 * g++.dg/opt/inline13.C: New test.
7 2007-11-06 Jan Hubicka <jh@suse.cz>
9 PR tree-optimization/33763
10 * tree-inline.c (expand_call_inline): Silently ignore always_inline
11 attribute for redefined extern inline functions.
13 --- gcc/tree-inline.c.jj 2007-11-06 09:29:04.000000000 +0100
14 +++ gcc/tree-inline.c 2007-11-06 16:19:12.000000000 +0100
15 @@ -3817,6 +3817,12 @@ expand_call_inline (basic_block bb, gimp
18 if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn))
19 + /* For extern inline functions that get redefined we always
20 + silently ignored always_inline flag. Better behaviour would
21 + be to be able to keep both bodies and use extern inline body
22 + for inlining, but we can't do that because frontends overwrite
24 + && !cg_edge->callee->local.redefined_extern_inline
25 /* Avoid warnings during early inline pass. */
26 && cgraph_global_info_ready
27 /* PR 20090218-1_0.c. Body can be provided by another module. */
28 --- gcc/testsuite/gcc.dg/pr33763.c.jj 2007-11-06 16:19:12.000000000 +0100
29 +++ gcc/testsuite/gcc.dg/pr33763.c 2007-11-06 16:19:12.000000000 +0100
31 +/* PR tree-optimization/33763 */
32 +/* { dg-do compile } */
33 +/* { dg-options "-O2" } */
40 +extern void *foo (const char *, const char *);
41 +extern void *bar (void *, const char *, T);
42 +extern int baz (const char *, int);
44 +extern inline __attribute__ ((always_inline, gnu_inline)) int
45 +baz (const char *x, int y)
51 +baz (const char *x, int y)
59 +inl (const char *x, const char *y)
62 + int *f = (int *) __builtin_malloc (sizeof (int));
67 + for (z = y; *z; z++)
82 + r = bar (f, "w", t);
87 +foo (const char *x, const char *y)
91 --- gcc/testsuite/g++.dg/opt/inline13.C.jj 2007-11-06 16:20:20.000000000 +0100
92 +++ gcc/testsuite/g++.dg/opt/inline13.C 2007-11-06 16:21:30.000000000 +0100
94 +// PR tree-optimization/33763
96 +// { dg-options "-O2" }
103 +extern void *foo (const char *, const char *);
104 +extern void *bar (void *, const char *, T);
105 +extern int baz (const char *, int);
107 +extern inline __attribute__ ((always_inline, gnu_inline)) int
108 +baz (const char *x, int y)
114 +baz (const char *x, int y)
122 +inl (const char *x, const char *y)
124 + T t = { &xa, &xb };
125 + int *f = (int *) __builtin_malloc (sizeof (int));
130 + for (z = y; *z; z++)
145 + r = bar (f, "w", t);
150 +foo (const char *x, const char *y)