This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Sanitize block partitioning under -freorder-blocks-and-partition
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Teresa Johnson <tejohnson at google dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Steven Bosscher <stevenb dot gcc at gmail dot com>, Jeff Law <law at redhat dot com>, "marxin.liska" <marxin dot liska at gmail dot com>, Sriraman Tallam <tmsriram at google dot com>
- Date: Sat, 31 Aug 2013 18:04:20 +0200
- Subject: Re: [PATCH] Sanitize block partitioning under -freorder-blocks-and-partition
- Authentication-results: sourceware.org; auth=none
- References: <20130809095843 dot GC31755 at kam dot mff dot cuni dot cz> <CAAe5K+XXT6t5CXBDXPWMNSrLWwqfw8F_J2fNUAN2afqb5qPhzQ at mail dot gmail dot com> <20130809152804 dot GA6579 at kam dot mff dot cuni dot cz> <CAAe5K+UcMevsDcXOeq5tu0+u-FrLVVWR6Wd20ZhBHNWdNsQ4Zw at mail dot gmail dot com> <CAAe5K+W+VEERrsaCCjCD=n40_MO2EPashDp5qnKoS8SLaSjBjQ at mail dot gmail dot com> <20130817204408 dot GA16557 at kam dot mff dot cuni dot cz> <CAAe5K+XGKvd+_8Ukp0kpOWvc2k165F=4fdemf-iDz+QkirLPmg at mail dot gmail dot com> <20130819150942 dot GA28264 at kam dot mff dot cuni dot cz> <CAAe5K+UnqBfxYrZxSkjRudq8NYni_9ih+t=us+2hH+UPsrwDLA at mail dot gmail dot com> <CAAe5K+UhCzfwm_WomE1yk+ET1tBiNT5svfn_LAc57MUSqJbnaQ at mail dot gmail dot com>
Hi,
With Martin we made script for testing the profiling failures.
First do
ld --verbose >~/script
then apply
--- /home/jh/script2 2013-08-31 17:59:11.000000000 +0200
+++ /home/jh/script 2013-08-31 17:39:40.000000000 +0200
@@ -1,12 +1,3 @@
-GNU ld (GNU Binutils for Debian) 2.20.1-system.20100303
- Supported emulations:
- elf_x86_64
- elf_i386
- i386linux
- elf_l1om
-using internal linker script:
-==================================================
-/* Script for -z combreloc: combine and sort reloc sections */
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
"elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
@@ -55,6 +46,7 @@
KEEP (*(.init))
} =0x90909090
.plt : { *(.plt) *(.iplt) }
+ .text.unlikely (NOLOAD) : { *(.text.unlikely .text.*_unlikely .text.unlikely.*) }
.text :
{
*(.text.unlikely .text.*_unlikely)
@@ -218,4 +210,3 @@
}
-==================================================
then create t.c as:
__attribute__ ((noinline))
t()
{
printf ("test\n");
}
main(int argc)
{
if (argc>1)
t();
return 0;
}
and dotests as:
for name in $*
do
rm a.out *.gcda 2>/dev/null
./xgcc -B ./ -Ofast -fprofile-generate $name --static 2>/dev/null
if [ -f a.out ]
then
./a.out >/dev/null 2>/dev/null || continue
./xgcc -B ./ -Ofast -fprofile-use -freorder-blocks-and-partition -Wl,-T,/home/jh/script --static $name 2>/dev/null
./a.out t >/dev/null 2>/dev/null || echo FAIL $name
else
echo skip $name
fi
done
Then run:
jh@gcc10:~/trunk/build/gcc$ sh dotests t.c
FAIL t.c
You should get FAIL if things are fine, because t.c depends behaviour on number
of command line parameters. If that fail you can run i.e.
jh@gcc10:~/trunk/build/gcc$ sh dotests ~/trunk/gcc/testsuite/gcc.c-torture/execute/*.c
skip /home/jh/trunk/gcc/testsuite/gcc.c-torture/execute/20000402-1.c
FAIL /home/jh/trunk/gcc/testsuite/gcc.c-torture/execute/20000422-1.c
FAIL /home/jh/trunk/gcc/testsuite/gcc.c-torture/execute/20000910-2.c
skip /home/jh/trunk/gcc/testsuite/gcc.c-torture/execute/20010329-1.c
Those with fail get cold section executed. When you run tehm again through dotests you can do gdb a.out
and see what function gets split incorrectly.
Honza