+2011-06-06 Mikael Pettersson <mikpe@it.uu.se>
+
+ PR tree-optimization/49243
+ * calls.c (setjmp_call_p): Also check if fndecl has the
+ returns_twice attribute.
+
2011-06-06 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* config/mips/iris6.h (ENDFILE_SPEC): Use crtfastmath.o if
int
setjmp_call_p (const_tree fndecl)
{
+ if (DECL_IS_RETURNS_TWICE (fndecl))
+ return ECF_RETURNS_TWICE;
return special_function_p (fndecl, 0) & ECF_RETURNS_TWICE;
}
+2011-06-06 Mikael Pettersson <mikpe@it.uu.se>
+
+ PR tree-optimization/49243
+ * gcc.dg/pr49243.c: New.
+
2011-06-06 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/cond_expr1.ads: New test.
--- /dev/null
+/* PR tree-optimization/49243 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -Winline" } */
+
+extern unsigned long jb[];
+extern int my_setjmp(unsigned long jb[]) __attribute__((returns_twice));
+extern int decode(const char*);
+
+static inline int wrapper(const char **s_ptr) /* { dg-warning "(inlining failed|function 'wrapper' can never be inlined because it uses setjmp)" } */
+{
+ if (my_setjmp(jb) == 0) {
+ const char *s = *s_ptr;
+ while (decode(s) != 0)
+ *s_ptr = ++s;
+ return 0;
+ } else
+ return -1;
+}
+
+void parse(const char *data)
+{
+ const char *s = data;
+ if (!(wrapper(&s) == -1 && (s - data) == 1)) /* { dg-warning "called from here" } */
+ __builtin_abort();
+}