Commit 1f8d3e42 by Dominik Vogt Committed by Andreas Krebbel

PR 66215: S390: Fix placement of post-label NOPs with -mhotpatch

gcc/ChangeLog:
	    PR target/66215
	    * config/s390/s390.c (s390_reorg): Fix placement of post-label NOPs
	    with -mhotpatch=.

gcc/testsuite/ChangeLog:
	    PR target/66215
	    * gcc.target/s390/hotpatch-1.c: Remove optimization options from
	    dg-options.
	    * gcc.target/s390/hotpatch-10.c: Likewise.
	    * gcc.target/s390/hotpatch-11.c: Likewise.
	    * gcc.target/s390/hotpatch-12.c: Likewise.
	    * gcc.target/s390/hotpatch-17.c: Likewise.
	    * gcc.target/s390/hotpatch-18.c: Likewise.
	    * gcc.target/s390/hotpatch-20.c: Likewise.
	    * gcc.target/s390/hotpatch-21.c: Likewise.
	    * gcc.target/s390/hotpatch-22.c: Likewise.
	    * gcc.target/s390/hotpatch-23.c: Likewise.
	    * gcc.target/s390/hotpatch-24.c: Likewise.
	    * gcc.target/s390/hotpatch-2.c: Likewise.  Adjust scan-assembler
	    to check for the exact nops too.
	    * gcc.target/s390/hotpatch-3.c: Likewise.
	    * gcc.target/s390/hotpatch-4.c: Likewise.
	    * gcc.target/s390/hotpatch-5.c: Likewise.
	    * gcc.target/s390/hotpatch-6.c: Likewise.
	    * gcc.target/s390/hotpatch-7.c: Likewise.
	    * gcc.target/s390/hotpatch-8.c: Likewise.
	    * gcc.target/s390/hotpatch-9.c: Likewise.
	    * gcc.target/s390/hotpatch-14.c: Likewise.
	    * gcc.target/s390/hotpatch-15.c: Likewise.
	    * gcc.target/s390/hotpatch-16.c: Likewise.
	    * gcc.target/s390/hotpatch-19.c: Likewise.
	    * gcc.target/s390/hotpatch-25.c: Likewise.  Remove
	    scan-assembler-times counting number of .align directives.
	    * gcc.target/s390/hotpatch-13.c: Remove optimization options from
	    dg-options.  Remove scan-assembler-times counting number of .align
	    directives.
	    * gcc.target/s390/hotpatch-26.c: New file.
	    * gcc.target/s390/hotpatch-27.c: New file.
	    * gcc.target/s390/hotpatch-28.c: New file.
	    * gcc.target/s390/s390.exp: Run hotpatch-*.c tests as torture tests
	    using -Os -O0 -O1 -O2 -O3 options.

From-SVN: r223867
parent 75eb6443
2015-05-29 Dominik Vogt <vogt@linux.vnet.ibm.com>
PR target/66215
* config/s390/s390.c (s390_reorg): Fix placement of post-label NOPs
with -mhotpatch=.
2015-05-29 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/66142
......
......@@ -12843,31 +12843,37 @@ s390_reorg (void)
/* Insert NOPs for hotpatching. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
if (NOTE_P (insn) && NOTE_KIND (insn) == NOTE_INSN_FUNCTION_BEG)
break;
}
gcc_assert (insn);
/* Output a series of NOPs after the NOTE_INSN_FUNCTION_BEG. */
while (hw_after > 0)
/* Emit NOPs
1. inside the area covered by debug information to allow setting
breakpoints at the NOPs,
2. before any insn which results in an asm instruction,
3. before in-function labels to avoid jumping to the NOPs, for
example as part of a loop,
4. before any barrier in case the function is completely empty
(__builtin_unreachable ()) and has neither internal labels nor
active insns.
*/
if (active_insn_p (insn) || BARRIER_P (insn) || LABEL_P (insn))
break;
/* Output a series of NOPs before the first active insn. */
while (insn && hw_after > 0)
{
if (hw_after >= 3 && TARGET_CPU_ZARCH)
{
insn = emit_insn_after (gen_nop_6_byte (), insn);
emit_insn_before (gen_nop_6_byte (), insn);
hw_after -= 3;
}
else if (hw_after >= 2)
{
insn = emit_insn_after (gen_nop_4_byte (), insn);
emit_insn_before (gen_nop_4_byte (), insn);
hw_after -= 2;
}
else
{
insn = emit_insn_after (gen_nop_2_byte (), insn);
emit_insn_before (gen_nop_2_byte (), insn);
hw_after -= 1;
}
}
gcc_assert (hw_after == 0);
}
}
......
2015-05-29 Dominik Vogt <vogt@linux.vnet.ibm.com>
PR target/66215
* gcc.target/s390/hotpatch-1.c: Remove optimization options from
dg-options.
* gcc.target/s390/hotpatch-10.c: Likewise.
* gcc.target/s390/hotpatch-11.c: Likewise.
* gcc.target/s390/hotpatch-12.c: Likewise.
* gcc.target/s390/hotpatch-17.c: Likewise.
* gcc.target/s390/hotpatch-18.c: Likewise.
* gcc.target/s390/hotpatch-20.c: Likewise.
* gcc.target/s390/hotpatch-21.c: Likewise.
* gcc.target/s390/hotpatch-22.c: Likewise.
* gcc.target/s390/hotpatch-23.c: Likewise.
* gcc.target/s390/hotpatch-24.c: Likewise.
* gcc.target/s390/hotpatch-2.c: Likewise. Adjust scan-assembler
to check for the exact nops too.
* gcc.target/s390/hotpatch-3.c: Likewise.
* gcc.target/s390/hotpatch-4.c: Likewise.
* gcc.target/s390/hotpatch-5.c: Likewise.
* gcc.target/s390/hotpatch-6.c: Likewise.
* gcc.target/s390/hotpatch-7.c: Likewise.
* gcc.target/s390/hotpatch-8.c: Likewise.
* gcc.target/s390/hotpatch-9.c: Likewise.
* gcc.target/s390/hotpatch-14.c: Likewise.
* gcc.target/s390/hotpatch-15.c: Likewise.
* gcc.target/s390/hotpatch-16.c: Likewise.
* gcc.target/s390/hotpatch-19.c: Likewise.
* gcc.target/s390/hotpatch-25.c: Likewise. Remove
scan-assembler-times counting number of .align directives.
* gcc.target/s390/hotpatch-13.c: Remove optimization options from
dg-options. Remove scan-assembler-times counting number of .align
directives.
* gcc.target/s390/hotpatch-26.c: New file.
* gcc.target/s390/hotpatch-27.c: New file.
* gcc.target/s390/hotpatch-28.c: New file.
* gcc.target/s390/s390.exp: Run hotpatch-*.c tests as torture tests
using -Os -O0 -O1 -O2 -O3 options.
2015-05-29 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/vdup_lane_2.c: Close comment on final line.
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch" } */
/* { dg-options "-mzarch" } */
#include <stdio.h>
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,0" } */
/* { dg-options "-mzarch -mhotpatch=0,0" } */
#include <stdio.h>
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=1,0" } */
/* { dg-options "-mzarch -mhotpatch=1,0" } */
#include <stdio.h>
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=999,0" } */
/* { dg-options "-mzarch -mhotpatch=999,0" } */
#include <stdio.h>
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch" } */
/* { dg-options "-mzarch" } */
#include <stdio.h>
......@@ -18,4 +18,3 @@ void hp1(void)
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
/* { dg-final { scan-assembler "alignment for hotpatch" } } */
/* { dg-final { scan-assembler-times "\.align\t8" 2 } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch" } */
/* { dg-options "-mzarch" } */
#include <stdio.h>
......@@ -13,7 +13,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(2 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nop\t0" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch" } */
/* { dg-options "-mzarch" } */
#include <stdio.h>
......@@ -13,7 +13,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(2 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nop\t0" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,0" } */
/* { dg-options "-mzarch -mhotpatch=0,0" } */
#include <stdio.h>
......@@ -13,7 +13,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(2 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nop\t0" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=1,2" } */
/* { dg-options "-mzarch -mhotpatch=1,2" } */
#include <stdio.h>
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=1,2 -mhotpatch=0,0" } */
/* { dg-options "-mzarch -mhotpatch=1,2 -mhotpatch=0,0" } */
#include <stdio.h>
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=1,2" } */
/* { dg-options "-mzarch -mhotpatch=1,2" } */
#include <stdio.h>
......@@ -19,7 +19,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(2 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nop\t0" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,1" } */
/* { dg-options "-mzarch -mhotpatch=0,1" } */
#include <stdio.h>
......@@ -12,7 +12,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
/* { dg-final { scan-assembler "post-label.*(1 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(1 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nopr\t" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch" } */
/* { dg-options "-mzarch" } */
#include <stdio.h>
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,1" } */
/* { dg-options "-mzarch -mhotpatch=0,1" } */
#include <stdio.h>
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,1 -falign-functions=1024" } */
/* { dg-options "-mzarch -mhotpatch=0,1 -falign-functions=1024" } */
#include <stdio.h>
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,1 -falign-functions=4096" } */
/* { dg-options "-mzarch -mhotpatch=0,1 -falign-functions=4096" } */
#include <stdio.h>
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,1 -falign-functions=2048" } */
/* { dg-options "-mzarch -mhotpatch=0,1 -falign-functions=2048" } */
#include <stdio.h>
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch" } */
/* { dg-options "-mzarch" } */
typedef long (*fn_t)(void);
......@@ -25,9 +25,8 @@ fn_t outer(void)
/* { dg-final { scan-assembler "pre-label.*(1 halfwords)" } } */
/* { dg-final { scan-assembler "pre-label.*(4 halfwords)" } } */
/* { dg-final { scan-assembler "pre-label.*(16 halfwords)" } } */
/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
/* { dg-final { scan-assembler "post-label.*(8 halfwords)" } } */
/* { dg-final { scan-assembler "post-label.*(32 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(2 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nopr\t" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(8 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*brcl\t0, 0" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(32 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*brcl\t0, 0" } } */
/* { dg-final { scan-assembler-times "alignment for hotpatch" 3 } } */
/* { dg-final { scan-assembler-times "\.align\t8" 6 } } */
/* { dg-final { scan-assembler "nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr.*\n.*nopr" } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=1,2" } */
__attribute__ ((noreturn)) void hp1(void)
{
__builtin_unreachable ();
}
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler "pre-label NOPs" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(2 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nop\t0" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
/* { dg-final { scan-assembler "alignment for hotpatch" } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=1,2" } */
__attribute__ ((noreturn)) void hp3(void)
{
__builtin_unreachable ();
}
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler "pre-label NOPs" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(2 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nop\t0" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
/* { dg-final { scan-assembler "alignment for hotpatch" } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=1,2" } */
void hp1 (volatile unsigned int *i)
{
for (;;)
(*i)++;
}
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler "pre-label NOPs" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(2 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nop\t0" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
/* { dg-final { scan-assembler "alignment for hotpatch" } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,2" } */
/* { dg-options "-mzarch -mhotpatch=0,2" } */
#include <stdio.h>
......@@ -12,7 +12,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
/* { dg-final { scan-assembler "post-label.*(2 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(2 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nop\t0" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,3" } */
/* { dg-options "-mzarch -mhotpatch=0,3" } */
#include <stdio.h>
......@@ -12,7 +12,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
/* { dg-final { scan-assembler "post-label.*(3 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(3 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*brcl\t0, 0" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,4" } */
/* { dg-options "-mzarch -mhotpatch=0,4" } */
#include <stdio.h>
......@@ -12,7 +12,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
/* { dg-final { scan-assembler "post-label.*(4 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(4 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*brcl\t0, 0" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,5" } */
/* { dg-options "-mzarch -mhotpatch=0,5" } */
#include <stdio.h>
......@@ -12,7 +12,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
/* { dg-final { scan-assembler "post-label.*(5 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(5 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*brcl\t0, 0" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-times "brcl\t0, 0" 1 } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -mhotpatch=0,6" } */
/* { dg-options "-mzarch -mhotpatch=0,6" } */
#include <stdio.h>
......@@ -12,7 +12,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
/* { dg-final { scan-assembler "post-label.*(6 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(6 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*brcl\t0, 0" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-not "nop\t0" } } */
/* { dg-final { scan-assembler-times "brcl\t0, 0" 2 } } */
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile { target { ! lp64 } } } */
/* { dg-options "-O3 -mesa -march=g5 -mhotpatch=0,3" } */
/* { dg-options "-mesa -march=g5 -mhotpatch=0,3" } */
#include <stdio.h>
......@@ -12,7 +12,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
/* { dg-final { scan-assembler "post-label.*(3 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(3 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nop\t0" } } */
/* { dg-final { scan-assembler-times "nopr\t%r7" 1 } } */
/* { dg-final { scan-assembler-times "nop\t0" 1 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
......
/* Functional tests for the function hotpatching feature. */
/* { dg-do compile { target { ! lp64 } } } */
/* { dg-options "-O3 -mesa -march=g5 -mhotpatch=0,4" } */
/* { dg-options "-mesa -march=g5 -mhotpatch=0,4" } */
#include <stdio.h>
......@@ -12,7 +12,7 @@ void hp1(void)
/* Check number of occurences of certain instructions. */
/* { dg-final { scan-assembler-not "pre-label NOPs" } } */
/* { dg-final { scan-assembler "post-label.*(4 halfwords)" } } */
/* { dg-final { scan-assembler "^\[^.\].*:\n.*post-label.*(4 halfwords).*\n\(\(.L.*:\n\)\|\(\[\[:space:\]\]*.cfi_.*\n\)\)*\[\[:space:\]\]*nop\t0" } } */
/* { dg-final { scan-assembler-not "nopr\t%r7" } } */
/* { dg-final { scan-assembler-times "nop\t0" 2 } } */
/* { dg-final { scan-assembler-not "brcl\t0, 0" } } */
......@@ -61,12 +61,21 @@ if ![info exists DEFAULT_CFLAGS] then {
# Initialize `dg'.
dg-init
set hotpatch_tests $srcdir/$subdir/hotpatch-\[0-9\]*.c
# Main loop.
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
"" $DEFAULT_CFLAGS
dg-runtest [lsort [prune [glob -nocomplain $srcdir/$subdir/*.\[cS\]] \
$hotpatch_tests]] "" $DEFAULT_CFLAGS
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*vector*/*.\[cS\]]] \
"" $DEFAULT_CFLAGS
# Additional hotpatch torture tests.
torture-init
set HOTPATCH_TEST_OPTS [list -Os -O0 -O1 -O2 -O3]
set-torture-options $HOTPATCH_TEST_OPTS
gcc-dg-runtest [lsort [glob -nocomplain $hotpatch_tests]] "" $DEFAULT_CFLAGS
torture-finish
# All done.
dg-finish
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment