Blame SOURCES/papi-lto.patch

fbe51a
commit cbca67dae5722d65590e33b8b885a561ac3fff5d
fbe51a
Author: William Cohen <wcohen@redhat.com>
fbe51a
Date:   Tue Jun 15 21:48:15 2021 -0400
fbe51a
fbe51a
    Use numeric local labels to allow compilation with LTO enabled
fbe51a
    
fbe51a
    Some assembly snippets in instructions_testcode.c used regular label
fbe51a
    names.  Unfortunately, when multiple copies of the snippets are
fbe51a
    inlined in different places with LTO enabled the multiple copies of a
fbe51a
    label by the same name cause the build to fail because of the
fbe51a
    redefinition of the label.  To avoid this problem all those labels
fbe51a
    have been converted to numeric local labels to allow multiple copies
fbe51a
    to peacefully coexist in the LTO enabled code.
fbe51a
fbe51a
diff --git a/src/validation_tests/instructions_testcode.c b/src/validation_tests/instructions_testcode.c
fbe51a
index 3634b1f90..128127c25 100644
fbe51a
--- a/src/validation_tests/instructions_testcode.c
fbe51a
+++ b/src/validation_tests/instructions_testcode.c
fbe51a
@@ -10,9 +10,9 @@ int instructions_million(void) {
fbe51a
 #if defined(__i386__) || (defined __x86_64__)
fbe51a
 	asm(	"	xor	%%ecx,%%ecx\n"
fbe51a
 		"	mov	$499999,%%ecx\n"
fbe51a
-		"test_loop:\n"
fbe51a
+		"55:\n"
fbe51a
 		"	dec	%%ecx\n"
fbe51a
-		"	jnz	test_loop\n"
fbe51a
+		"	jnz	55b\n"
fbe51a
 		: /* no output registers */
fbe51a
 		: /* no inputs */
fbe51a
 		: "cc", "%ecx" /* clobbered */
fbe51a
@@ -47,9 +47,9 @@ int instructions_million(void) {
fbe51a
 #elif defined(__sparc__)
fbe51a
 	asm(	"	sethi	%%hi(333333), %%l0\n"
fbe51a
 		"	or	%%l0,%%lo(333333),%%l0\n"
fbe51a
-		"test_loop:\n"
fbe51a
+		"55:\n"
fbe51a
 		"	deccc	%%l0		! decrement count\n"
fbe51a
-		"	bnz	test_loop	! repeat until zero\n"
fbe51a
+		"	bnz	55b		! repeat until zero\n"
fbe51a
 		"	nop			! branch delay slot\n"
fbe51a
 		: /* no output registers */
fbe51a
 		: /* no inputs */
fbe51a
@@ -57,13 +57,13 @@ int instructions_million(void) {
fbe51a
 	);
fbe51a
 	return 0;
fbe51a
 #elif defined(__arm__)
fbe51a
-	asm(	"	ldr	r2,count	@ set count\n"
fbe51a
-		"	b       test_loop\n"
fbe51a
-		"count:	.word 333332\n"
fbe51a
-		"test_loop:\n"
fbe51a
+	asm(	"	ldr	r2,42f		@ set count\n"
fbe51a
+		"	b       55f\n"
fbe51a
+		"42:	.word 333332\n"
fbe51a
+		"55:\n"
fbe51a
 		"	add	r2,r2,#-1\n"
fbe51a
 		"	cmp	r2,#0\n"
fbe51a
-		"	bne	test_loop	@ repeat till zero\n"
fbe51a
+		"	bne	55b		@ repeat till zero\n"
fbe51a
 		: /* no output registers */
fbe51a
 		: /* no inputs */
fbe51a
 		: "cc", "r2" /* clobbered */
fbe51a
@@ -71,10 +71,10 @@ int instructions_million(void) {
fbe51a
 	return 0;
fbe51a
 #elif defined(__aarch64__)
fbe51a
 	asm(	"	ldr	x2,=333332	// set count\n"
fbe51a
-		"test_loop:\n"
fbe51a
+		"55:\n"
fbe51a
 		"	add	x2,x2,#-1\n"
fbe51a
 		"	cmp	x2,#0\n"
fbe51a
-		"	bne	test_loop	// repeat till zero\n"
fbe51a
+		"	bne	55b		// repeat till zero\n"
fbe51a
 		: /* no output registers */
fbe51a
 		: /* no inputs */
fbe51a
 		: "cc", "r2" /* clobbered */
fbe51a
@@ -97,7 +97,7 @@ int instructions_fldcw(void) {
fbe51a
 	double three=3.0;
fbe51a
 
fbe51a
 	asm(	"	mov	$100000,%%ecx\n"
fbe51a
-		"big_loop:\n"
fbe51a
+		"44:\n"
fbe51a
 		"	fldl	%1		# load value onto fp stack\n"
fbe51a
 		"	fnstcw	%0		# store control word to mem\n"
fbe51a
 		"	movzwl	%0, %%eax	# load cw from mem, zero extending\n"
fbe51a
@@ -106,7 +106,7 @@ int instructions_fldcw(void) {
fbe51a
 		"	fldcw	%3		# save new rounding mode\n"
fbe51a
 		"	fistpl	%2		# save stack value as integer to mem\n"
fbe51a
 		"	fldcw	%0		# restore old cw\n"
fbe51a
-		"	loop	big_loop	# loop to make the count more obvious\n"
fbe51a
+		"	loop	44b		# loop to make the count more obvious\n"
fbe51a
 		: /* no output registers */
fbe51a
 		: "m"(saved_cw), "m"(three), "m"(result), "m"(cw) /* inputs */
fbe51a
 		: "cc", "%ecx","%eax" /* clobbered */
fbe51a
@@ -129,13 +129,13 @@ int instructions_rep(void) {
fbe51a
 
fbe51a
 	asm(	"	mov	$1000,%%edx\n"
fbe51a
 		"	cld\n"
fbe51a
-		"loadstore:			# test 8-bit store\n"
fbe51a
+		"66:				# test 8-bit store\n"
fbe51a
 		"	mov	$0xd, %%al	# set eax to d\n"
fbe51a
 		"	mov	$16384, %%ecx\n"
fbe51a
 		"	mov	%0, %%edi	# set destination\n"
fbe51a
 		"	rep	stosb		# store d 16384 times, auto-increment\n"
fbe51a
 		"	dec	%%edx\n"
fbe51a
-		"	jnz	loadstore\n"
fbe51a
+		"	jnz	66b\n"
fbe51a
 		: /* outputs */
fbe51a
 		: "rm" (buffer_out) /* inputs */
fbe51a
 		: "cc", "%esi","%edi","%edx","%ecx","%eax","memory" /* clobbered */
fbe51a
@@ -147,13 +147,13 @@ int instructions_rep(void) {
fbe51a
 
fbe51a
 	asm(	"	mov	$1000,%%edx\n"
fbe51a
 		"	cld\n"
fbe51a
-		"loadstore:			# test 8-bit store\n"
fbe51a
+		"66:				# test 8-bit store\n"
fbe51a
 		"	mov	$0xd, %%al	# set eax to d\n"
fbe51a
 		"	mov	$16384, %%ecx\n"
fbe51a
 		"	mov	%0, %%rdi	# set destination\n"
fbe51a
 		"	rep	stosb		# store d 16384 times, auto-increment\n"
fbe51a
 		"	dec	%%edx\n"
fbe51a
-		"	jnz	loadstore\n"
fbe51a
+		"	jnz	66b\n"
fbe51a
 		: /* outputs */
fbe51a
 		: "rm" (buffer_out) /* inputs */
fbe51a
 		: "cc", "%esi","%edi","%edx","%ecx","%eax","memory" /* clobbered */