pkgsrc-ng/lang/gcc45/patches/patch-gcc_testsuite_gcc.c-torture_compile_pr51767.c
Lionel Sambuc 612ad0a18c lang/gcc45
2016-01-22 00:09:29 +01:00

29 lines
496 B
C

$NetBSD$
--- gcc/testsuite/gcc.c-torture/compile/pr51767.c.orig Wed May 21 19:48:58 2014
+++ gcc/testsuite/gcc.c-torture/compile/pr51767.c
@@ -0,0 +1,23 @@
+/* PR rtl-optimization/51767 */
+
+extern void fn1 (void), fn2 (void);
+
+static inline __attribute__((always_inline)) int
+foo (int *x, long y)
+{
+ asm goto ("" : : "r" (x), "r" (y) : "memory" : lab);
+ return 0;
+lab:
+ return 1;
+}
+
+void
+bar (int *x)
+{
+ if (foo (x, 23))
+ fn1 ();
+ else
+ fn2 ();
+
+ foo (x, 2);
+}