public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch] Fix anonymous code atoms problem on Darwin.
@ 2010-12-20 12:03 IainS
  2010-12-20 21:49 ` Richard Henderson
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: IainS @ 2010-12-20 12:03 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Henderson, Mike Stump, Jan Hubicka

[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]

Hi,

This problem became apparent during the resolution of PR46904/46916  
(we have had to switch off freorder-and-partition to avoid regression).

--

Darwin's toolchain will not allow us to have code fragments that are  
anonymous (i.e. isolated by section and preceded only by a local label).

The rule [as quoted by Mike] is:
All sections have zero or more atoms.  An atom is 1 or more bytes with  
a label (non-L) on the front of it.

function reordering or partitioning breaks this, manifesting in linker  
warnings and non-functional debug.

The following patch creates and calls a target hook after mid-function  
section switches that gives the target an opportunity to do whatever  
is necessary to avoid orphan code fragments.  The darwin  
implementation of the hook post-fixes the function name with _$hot$ or  
_$cold$ as appropriate.

OK for trunk?
Iain

gcc:

	* target.def (function_switched_text_sections): New Hook.
	* doc/tm.texi Regenerated.
	* doc/tm.texi.in (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
	New.
	* final.c (default_function_switched_text_sections): New.
	(final_scan_insn): Call function_switched_text_sections when a mid- 
function section
	change occurs.
	* output.h (default_function_switched_text_sections): Declare.
	* config/darwin-protos.h (darwin_function_switched_text_sections) :  
Likewise.
	* config/darwin.c (darwin_function_switched_text_sections): New.
	* config/darwin.h (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
	New.


[-- Attachment #2: 168084-code-atoms.txt --]
[-- Type: text/plain, Size: 6221 bytes --]

Index: gcc/target.def
===================================================================
--- gcc/target.def	(revision 168084)
+++ gcc/target.def	(working copy)
@@ -294,6 +294,17 @@ DEFHOOK
  section *, (tree decl, enum node_frequency freq, bool startup, bool exit),
  default_function_section)
 
+/* Output the assembler code for function exit.  */
+DEFHOOK
+(function_switched_text_sections,
+ "Used by the target to emit any assembler directives or additional\
+  labels needed when a function is partitioned between different\
+  sections.  Output should be written to @var{file}.  The function\
+  decl is available as @var{decl} and the new section is `cold' if\
+  @var{new_is_cold} is @code{true}.",
+ void, (FILE *file, tree decl, bool new_is_cold),
+ default_function_switched_text_sections)
+
 /* Return a mask describing how relocations should be treated when
    selecting sections.  Bit 1 should be set if global relocations
    should be placed in a read-write section; bit 0 should be set if
Index: gcc/doc/tm.texi
===================================================================
--- gcc/doc/tm.texi	(revision 168084)
+++ gcc/doc/tm.texi	(working copy)
@@ -7325,6 +7325,10 @@ at startup (from static constructors or it is @cod
 Return NULL if function should go to default text section.
 @end deftypefn
 
+@deftypefn {Target Hook} void TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS (FILE *@var{file}, tree @var{decl}, bool @var{new_is_cold})
+Used by the target to emit any assembler directives or additional  labels needed when a function is partitioned between different  sections.  Output should be written to @var{file}.  The function  decl is available as @var{decl} and the new section is `cold' if  @var{new_is_cold} is @code{true}.
+@end deftypefn
+
 @deftypevr {Target Hook} bool TARGET_HAVE_NAMED_SECTIONS
 This flag is true if the target supports @code{TARGET_ASM_NAMED_SECTION}.
 It must not be modified by command-line option processing.
Index: gcc/doc/tm.texi.in
===================================================================
--- gcc/doc/tm.texi.in	(revision 168084)
+++ gcc/doc/tm.texi.in	(working copy)
@@ -7298,6 +7298,8 @@ at startup (from static constructors or it is @cod
 Return NULL if function should go to default text section.
 @end deftypefn
 
+@hook TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS
+
 @hook TARGET_HAVE_NAMED_SECTIONS
 This flag is true if the target supports @code{TARGET_ASM_NAMED_SECTION}.
 It must not be modified by command-line option processing.
Index: gcc/final.c
===================================================================
--- gcc/final.c	(revision 168084)
+++ gcc/final.c	(working copy)
@@ -256,6 +256,13 @@ default_function_pro_epilogue (FILE *file ATTRIBUT
 {
 }
 
+void
+default_function_switched_text_sections (FILE *file ATTRIBUTE_UNUSED,
+					 tree decl ATTRIBUTE_UNUSED,
+					 bool new_is_cold ATTRIBUTE_UNUSED)
+{
+}
+
 /* Default target hook that outputs nothing to a stream.  */
 void
 no_asm_to_stream (FILE *file ATTRIBUTE_UNUSED)
@@ -1841,6 +1848,9 @@ final_scan_insn (rtx insn, FILE *file, int optimiz
 	    debug_hooks->switch_text_section ();
 
 	  switch_to_section (current_function_section ());
+	  targetm.asm_out.function_switched_text_sections (asm_out_file,
+							   current_function_decl,
+							   in_cold_section_p);
 	  break;
 
 	case NOTE_INSN_BASIC_BLOCK:
Index: gcc/output.h
===================================================================
--- gcc/output.h	(revision 168084)
+++ gcc/output.h	(working copy)
@@ -417,6 +417,9 @@ extern const char *user_label_prefix;
 /* Default target function prologue and epilogue assembler output.  */
 extern void default_function_pro_epilogue (FILE *, HOST_WIDE_INT);
 
+/* Default target function switched text sections.  */
+extern void default_function_switched_text_sections (FILE *, tree, bool);
+
 /* Default target hook that outputs nothing to a stream.  */
 extern void no_asm_to_stream (FILE *);
 
Index: gcc/config/darwin-protos.h
===================================================================
--- gcc/config/darwin-protos.h	(revision 168084)
+++ gcc/config/darwin-protos.h	(working copy)
@@ -58,6 +58,8 @@ extern section *machopic_select_rtx_section (enum
 					     unsigned HOST_WIDE_INT);
 
 extern section *darwin_function_section (tree, enum node_frequency, bool, bool); 
+extern void darwin_function_switched_text_sections (FILE *, tree, bool);
+
 extern void darwin_unique_section (tree decl, int reloc);
 extern void darwin_asm_named_section (const char *, unsigned int, tree);
 extern void darwin_non_lazy_pcrel (FILE *, rtx);
Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c	(revision 168084)
+++ gcc/config/darwin.c	(working copy)
@@ -3066,4 +3047,22 @@ darwin_function_section (tree decl, enum node_freq
     }
 }
 
+/* When a function is partitioned between sections, we need to insert a label
+   at the start of each new chunk - so that it may become a valid 'atom' for
+   eh and debug purposes.  Without this the linker will emit warnings if one 
+   tries to add line location information (since the switched fragment will 
+   be anonymous).  */
+
+void
+darwin_function_switched_text_sections (FILE *fp, tree decl, bool new_is_cold)
+{
+  char buf[128];
+  snprintf (buf, 128, "%s%s",
+	    IDENTIFIER_POINTER (DECL_NAME (decl)),
+	    new_is_cold?"_$cold$":"_$hot$");
+  /* Make sure we pick up all the relevant quotes etc.  */
+  assemble_name_raw (fp, (const char *) buf);
+  fputs (":\n", fp);
+}
+
 #include "gt-darwin.h"
Index: gcc/config/darwin.h
===================================================================
--- gcc/config/darwin.h	(revision 168084)
+++ gcc/config/darwin.h	(working copy)
@@ -673,6 +673,10 @@ extern GTY(()) section * darwin_sections[NUM_DARWI
 #undef	TARGET_ASM_FUNCTION_SECTION
 #define TARGET_ASM_FUNCTION_SECTION darwin_function_section
 
+#undef	TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS
+#define TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS \
+	darwin_function_switched_text_sections
+
 #undef	TARGET_ASM_SELECT_RTX_SECTION
 #define TARGET_ASM_SELECT_RTX_SECTION machopic_select_rtx_section
 #undef  TARGET_ASM_UNIQUE_SECTION

[-- Attachment #3: Type: text/plain, Size: 3 bytes --]





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Patch] Fix anonymous code atoms problem on Darwin.
  2010-12-20 12:03 [Patch] Fix anonymous code atoms problem on Darwin IainS
@ 2010-12-20 21:49 ` Richard Henderson
  2010-12-23 20:50 ` Mike Stump
  2011-02-08  3:01 ` Mike Stump
  2 siblings, 0 replies; 10+ messages in thread
From: Richard Henderson @ 2010-12-20 21:49 UTC (permalink / raw)
  To: IainS; +Cc: GCC Patches, Mike Stump, Jan Hubicka

On 12/20/2010 03:07 AM, IainS wrote:
>     * target.def (function_switched_text_sections): New Hook.
>     * doc/tm.texi Regenerated.
>     * doc/tm.texi.in (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
>     New.
>     * final.c (default_function_switched_text_sections): New.
>     (final_scan_insn): Call function_switched_text_sections when a mid-function section
>     change occurs.
>     * output.h (default_function_switched_text_sections): Declare.
>     * config/darwin-protos.h (darwin_function_switched_text_sections) : Likewise.
>     * config/darwin.c (darwin_function_switched_text_sections): New.
>     * config/darwin.h (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
>     New.

Ok by me, assuming Mike is ok with it.


r~

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Patch] Fix anonymous code atoms problem on Darwin.
  2010-12-20 12:03 [Patch] Fix anonymous code atoms problem on Darwin IainS
  2010-12-20 21:49 ` Richard Henderson
@ 2010-12-23 20:50 ` Mike Stump
  2011-01-07 14:12   ` IainS
  2011-02-08  3:01 ` Mike Stump
  2 siblings, 1 reply; 10+ messages in thread
From: Mike Stump @ 2010-12-23 20:50 UTC (permalink / raw)
  To: IainS; +Cc: GCC Patches, Richard Henderson, Mike Stump, Jan Hubicka

On Dec 20, 2010, at 3:07 AM, IainS <developer@sandoe-acoustics.co.uk> wrote:
> This problem became apparent during the resolution of PR46904/46916 (we have had to switch off freorder-and-partition to avoid regression).

> The darwin implementation of the hook post-fixes the function name with _$hot$ or _$cold$ as appropriate.
> 
> OK for trunk?

Ok with one change, don't use $ in label names.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Patch] Fix anonymous code atoms problem on Darwin.
  2010-12-23 20:50 ` Mike Stump
@ 2011-01-07 14:12   ` IainS
  0 siblings, 0 replies; 10+ messages in thread
From: IainS @ 2011-01-07 14:12 UTC (permalink / raw)
  To: GCC Patches; +Cc: Mike Stump, Jan Hubicka

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]


On 23 Dec 2010, at 19:43, Mike Stump wrote:

> On Dec 20, 2010, at 3:07 AM, IainS <developer@sandoe- 
> acoustics.co.uk> wrote:
>> This problem became apparent during the resolution of PR46904/46916  
>> (we have had to switch off freorder-and-partition to avoid  
>> regression).
>
>> The darwin implementation of the hook post-fixes the function name  
>> with _$hot$ or _$cold$ as appropriate.
>>
>> OK for trunk?
>
> Ok with one change, don't use $ in label names.

ci r168571 - as attached,
includes a partial reversion of a previous patch (which disabled - 
freorder-and-partition).
  -freorder-and-partition is now active on Darwin >=  9.
Iain


[-- Attachment #2: 168562-partition-tst.txt --]
[-- Type: text/plain, Size: 10999 bytes --]

cat <<'EOF' |
LAST_UPDATED: Fri Jan  7 08:22:30 UTC 2011 (revision 168562)

Native configuration is i686-apple-darwin9

		=== g++ tests ===


Running target unix/-m32
UNRESOLVED: g++.dg/ext/label13.C compilation failed to produce executable
FAIL: g++.dg/torture/stackalign/eh-alloca-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-2.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-alloca-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-1.C  -O3 -g  execution test
FAIL: g++.dg/torture/stackalign/eh-vararg-2.C  -O3 -g  execution test

		=== g++ Summary for unix/-m32 ===

# of expected passes		26234
# of unexpected failures	6
# of expected failures		159
# of unresolved testcases	1
# of unsupported tests		179

Running target unix/-m64
UNRESOLVED: g++.dg/ext/label13.C compilation failed to produce executable

		=== g++ Summary for unix/-m64 ===

# of expected passes		26472
# of expected failures		159
# of unresolved testcases	1
# of unsupported tests		378

		=== g++ Summary ===

# of expected passes		52706
# of unexpected failures	6
# of expected failures		318
# of unresolved testcases	2
# of unsupported tests		557
/Volumes/ScratchCS/gcc-4-6-reghunt-build/gcc/testsuite/g++/../../g++  version 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 

		=== gcc tests ===


Running target unix/-m32
FAIL: gcc.c-torture/execute/20040811-1.c compilation,  -O3 -g 
UNRESOLVED: gcc.c-torture/execute/20040811-1.c execution,  -O3 -g 
FAIL: gcc.c-torture/execute/pr43220.c compilation,  -O3 -g 
UNRESOLVED: gcc.c-torture/execute/pr43220.c execution,  -O3 -g 
FAIL: gcc.c-torture/execute/vla-dealloc-1.c compilation,  -O3 -g 
UNRESOLVED: gcc.c-torture/execute/vla-dealloc-1.c execution,  -O3 -g 
XPASS: gcc.dg/tree-ssa/20040204-1.c scan-tree-dump-times optimized "link_error" 0
FAIL: gcc.target/i386/combine-mul.c scan-assembler-not 12345

		=== gcc Summary for unix/-m32 ===

# of expected passes		73632
# of unexpected failures	4
# of unexpected successes	1
# of expected failures		212
# of unresolved testcases	3
# of unsupported tests		1364

Running target unix/-m64
XPASS: gcc.dg/tree-ssa/20040204-1.c scan-tree-dump-times optimized "link_error" 0
FAIL: gcc.target/i386/combine-mul.c scan-assembler-not 12345

		=== gcc Summary for unix/-m64 ===

# of expected passes		73769
# of unexpected failures	1
# of unexpected successes	1
# of expected failures		213
# of unsupported tests		1741

		=== gcc Summary ===

# of expected passes		147401
# of unexpected failures	5
# of unexpected successes	2
# of expected failures		425
# of unresolved testcases	3
# of unsupported tests		3105
/Volumes/ScratchCS/gcc-4-6-reghunt-build/gcc/xgcc  version 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 

		=== gfortran tests ===


Running target unix/-m32
XPASS: gfortran.dg/pr25923.f90  -O  PR45505 (test for warnings, line 13)
XPASS: gfortran.dg/pr25923.f90  -O  PR45505 (test for bogus messages, line 22)

		=== gfortran Summary for unix/-m32 ===

# of expected passes		37483
# of unexpected successes	2
# of expected failures		48
# of unsupported tests		181

Running target unix/-m64

		=== gfortran Summary for unix/-m64 ===

# of expected passes		37726
# of expected failures		48
# of unsupported tests		65

		=== gfortran Summary ===

# of expected passes		75209
# of unexpected successes	2
# of expected failures		96
# of unsupported tests		246
/Volumes/ScratchCS/gcc-4-6-reghunt-build/gcc/testsuite/gfortran/../../gfortran  version 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 

		=== obj-c++ tests ===


Running target unix/-m32
UNRESOLVED: obj-c++.dg/try-catch-2.mm -fgnu-runtime compilation failed to produce executable
UNRESOLVED: obj-c++.dg/try-catch-9.mm -fgnu-runtime compilation failed to produce executable

		=== obj-c++ Summary for unix/-m32 ===

# of expected passes		2945
# of expected failures		2
# of unresolved testcases	2
# of unsupported tests		68

Running target unix/-m64
UNRESOLVED: obj-c++.dg/try-catch-2.mm -fgnu-runtime compilation failed to produce executable
UNRESOLVED: obj-c++.dg/try-catch-9.mm -fgnu-runtime compilation failed to produce executable
UNRESOLVED: obj-c++.dg/try-catch-2.mm -fnext-runtime compilation failed to produce executable
UNRESOLVED: obj-c++.dg/try-catch-9.mm -fnext-runtime compilation failed to produce executable

		=== obj-c++ Summary for unix/-m64 ===

# of expected passes		2780
# of expected failures		131
# of unresolved testcases	4
# of unsupported tests		73

		=== obj-c++ Summary ===

# of expected passes		5725
# of expected failures		133
# of unresolved testcases	6
# of unsupported tests		141
/Volumes/ScratchCS/gcc-4-6-reghunt-build/gcc/testsuite/obj-c++/../../g++  version 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 

		=== objc tests ===


Running target unix/-m32
XPASS: objc.dg-struct-layout-encoding-1/t026_main.m execution test

		=== objc Summary for unix/-m32 ===

# of expected passes		5890
# of unexpected successes	1
# of expected failures		6
# of unsupported tests		86

Running target unix/-m64
XPASS: objc.dg-struct-layout-encoding-1/t026_main.m execution test

		=== objc Summary for unix/-m64 ===

# of expected passes		4507
# of unexpected successes	1
# of expected failures		161
# of unsupported tests		102

		=== objc Summary ===

# of expected passes		10397
# of unexpected successes	2
# of expected failures		167
# of unsupported tests		188
/Volumes/ScratchCS/gcc-4-6-reghunt-build/gcc/xgcc  version 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 

		=== libffi tests ===


Running target unix/-m32

		=== libffi Summary for unix/-m32 ===

# of expected passes		1634
# of expected failures		10
# of unsupported tests		15

Running target unix/-m64

		=== libffi Summary for unix/-m64 ===

# of expected passes		1634
# of expected failures		10
# of unsupported tests		15

		=== libffi Summary ===

# of expected passes		3268
# of expected failures		20
# of unsupported tests		30
		=== libgomp tests ===


Running target unix/-m32

		=== libgomp Summary for unix/-m32 ===

# of expected passes		2522
# of unsupported tests		2

Running target unix/-m64

		=== libgomp Summary for unix/-m64 ===

# of expected passes		2522
# of unsupported tests		2

		=== libgomp Summary ===

# of expected passes		5044
# of unsupported tests		4
		=== libjava tests ===


Running target unix/-m32

		=== libjava Summary for unix/-m32 ===

# of expected passes		2574

Running target unix/-m64
FAIL: PR16923 run

		=== libjava Summary for unix/-m64 ===

# of expected passes		2573
# of unexpected failures	1
# of untested testcases		1

		=== libjava Summary ===

# of expected passes		5147
# of unexpected failures	1
# of untested testcases		1
		=== libstdc++ tests ===


Running target unix/-m32
FAIL: ext/mt_allocator/deallocate_global_thread-1.cc execution test
FAIL: ext/mt_allocator/deallocate_global_thread-3.cc execution test

		=== libstdc++ Summary for unix/-m32 ===

# of expected passes		6978
# of unexpected failures	2
# of expected failures		83
# of unsupported tests		651

Running target unix/-m64
FAIL: ext/mt_allocator/deallocate_global_thread-1.cc execution test
FAIL: ext/mt_allocator/deallocate_global_thread-3.cc execution test

		=== libstdc++ Summary for unix/-m64 ===

# of expected passes		6976
# of unexpected failures	2
# of expected failures		83
# of unsupported tests		652

		=== libstdc++ Summary ===

# of expected passes		13954
# of unexpected failures	4
# of expected failures		166
# of unsupported tests		1303

		=== libstdc++ Summary ===


Compiler version: 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) 
Platform: i686-apple-darwin9
configure flags: --prefix=/GCC/gcc-4-6-rh-install --target=i686-apple-darwin9 --host=i686-apple-darwin9 --build=i686-apple-darwin9 --enable-version-specific-runtime-libs --enable-threads --enable-checking=yes --program-suffix=-4.6trunk --with-libiconv-prefix=/usr --with-system-zlib --with-gmp=/GCC/multiprec-math/x86 --with-mpfr=/GCC/multiprec-math/x86 --with-mpc=/GCC/multiprec-math/x86 --enable-languages=c,lto,c++,objc,obj-c++,fortran,java CC=gcc-4.2 CXX=g++-4.2
EOF
Mail -s "Results for 4.6.0 20110107 (experimental) [trunk revision 168562] (GCC) testsuite on i686-apple-darwin9" gcc-testresults@gcc.gnu.org &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/g++/g++.sum /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/g++/g++.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gcc/gcc.sum /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gcc/gcc.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gfortran/gfortran.sum /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gfortran/gfortran.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/obj-c++/obj-c++.sum /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/obj-c++/obj-c++.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/objc/objc.sum /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/objc/objc.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libffi/testsuite/libffi.sum /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libffi/testsuite/libffi.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libgomp/testsuite/libgomp.sum /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libgomp/testsuite/libgomp.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libjava/testsuite/libjava.sum /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libjava/testsuite/libjava.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libstdc++-v3/testsuite/libstdc++.sum /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libstdc++-v3/testsuite/libstdc++.sum.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/g++/g++.log /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/g++/g++.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gcc/gcc.log /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gcc/gcc.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gfortran/gfortran.log /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/gfortran/gfortran.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/obj-c++/obj-c++.log /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/obj-c++/obj-c++.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/objc/objc.log /GCC/gcc-4-6-reghunt-build/./gcc/testsuite/objc/objc.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libffi/testsuite/libffi.log /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libffi/testsuite/libffi.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libgomp/testsuite/libgomp.log /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libgomp/testsuite/libgomp.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libjava/testsuite/libjava.log /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libjava/testsuite/libjava.log.sent &&
mv /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libstdc++-v3/testsuite/libstdc++.log /GCC/gcc-4-6-reghunt-build/./i686-apple-darwin9/libstdc++-v3/testsuite/libstdc++.log.sent &&
true

[-- Attachment #3: Type: text/plain, Size: 3 bytes --]





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Patch] Fix anonymous code atoms problem on Darwin.
  2010-12-20 12:03 [Patch] Fix anonymous code atoms problem on Darwin IainS
  2010-12-20 21:49 ` Richard Henderson
  2010-12-23 20:50 ` Mike Stump
@ 2011-02-08  3:01 ` Mike Stump
  2011-02-08  8:19   ` IainS
  2 siblings, 1 reply; 10+ messages in thread
From: Mike Stump @ 2011-02-08  3:01 UTC (permalink / raw)
  To: IainS; +Cc: GCC Patches

On Dec 20, 2010, at 3:07 AM, IainS wrote:
> This problem became apparent during the resolution of PR46904/46916 (we have had to switch off freorder-and-partition to avoid regression).

> gcc:
> 
> 	* target.def (function_switched_text_sections): New Hook.
> 	* doc/tm.texi Regenerated.
> 	* doc/tm.texi.in (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
> 	New.
> 	* final.c (default_function_switched_text_sections): New.
> 	(final_scan_insn): Call function_switched_text_sections when a mid-function section
> 	change occurs.
> 	* output.h (default_function_switched_text_sections): Declare.
> 	* config/darwin-protos.h (darwin_function_switched_text_sections) : Likewise.
> 	* config/darwin.c (darwin_function_switched_text_sections): New.
> 	* config/darwin.h (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
> 	New.

This posted patch does not match what was checked in r168571.  Could you please audit what was checked in and ensure it is as you wanted.  Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Patch] Fix anonymous code atoms problem on Darwin.
  2011-02-08  3:01 ` Mike Stump
@ 2011-02-08  8:19   ` IainS
  2011-02-08  9:14     ` IainS
  0 siblings, 1 reply; 10+ messages in thread
From: IainS @ 2011-02-08  8:19 UTC (permalink / raw)
  To: Mike Stump; +Cc: GCC Patches


On 8 Feb 2011, at 03:01, Mike Stump wrote:

> On Dec 20, 2010, at 3:07 AM, IainS wrote:
>> This problem became apparent during the resolution of PR46904/46916  
>> (we have had to switch off freorder-and-partition to avoid  
>> regression).
>
>> gcc:
>>
>> 	* target.def (function_switched_text_sections): New Hook.
>> 	* doc/tm.texi Regenerated.
>> 	* doc/tm.texi.in (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
>> 	New.
>> 	* final.c (default_function_switched_text_sections): New.
>> 	(final_scan_insn): Call function_switched_text_sections when a mid- 
>> function section
>> 	change occurs.
>> 	* output.h (default_function_switched_text_sections): Declare.
>> 	* config/darwin-protos.h  
>> (darwin_function_switched_text_sections) : Likewise.
>> 	* config/darwin.c (darwin_function_switched_text_sections): New.
>> 	* config/darwin.h (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
>> 	New.
>
> This posted patch does not match what was checked in r168571.  Could  
> you please audit what was checked in and ensure it is as you  
> wanted.  Thanks.

Yes, the commit matches what was intended.

(and as per the comment in http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00354.html 
  in this thread).

I attached the wrong file (test results instead of the diff) for the  
actual commit :-( sorry.

Looking at it with fresh eyes, I see that there is a comment that is  
incorrect (the code is as intended).
I'll fix that up - as below.

cheers
Iain

Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c (revision 169878)
+++ gcc/config/darwin.c (working copy)
@@ -2581,7 +2581,7 @@ darwin_override_options (void)
      global_options.x_flag_asynchronous_unwind_tables = 0;

     /* Disable -freorder-blocks-and-partition when unwind tables are  
being emitted
-      for Darwin < 10 (OSX 10.6).
+      for Darwin < 9 (OSX 10.5).
        The strategy is, "Unless the User has specifically set/unset  
an unwind flag
        we will switch off -freorder-blocks-and-partition when unwind  
tables will be
        generated".  If the User specifically sets flags... we assume  
(s)he knows

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Patch] Fix anonymous code atoms problem on Darwin.
  2011-02-08  8:19   ` IainS
@ 2011-02-08  9:14     ` IainS
  2011-02-08 13:35       ` IainS
  0 siblings, 1 reply; 10+ messages in thread
From: IainS @ 2011-02-08  9:14 UTC (permalink / raw)
  To: Mike Stump; +Cc: GCC Patches


On 8 Feb 2011, at 08:19, IainS wrote:

> On 8 Feb 2011, at 03:01, Mike Stump wrote:
>
>> On Dec 20, 2010, at 3:07 AM, IainS wrote:
>>> This problem became apparent during the resolution of  
>>> PR46904/46916 (we have had to switch off freorder-and-partition to  
>>> avoid regression).
>>
>>> gcc:
>>>
>>> 	* target.def (function_switched_text_sections): New Hook.
>>> 	* doc/tm.texi Regenerated.
>>> 	* doc/tm.texi.in (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
>>> 	New.
>>> 	* final.c (default_function_switched_text_sections): New.
>>> 	(final_scan_insn): Call function_switched_text_sections when a  
>>> mid-function section
>>> 	change occurs.
>>> 	* output.h (default_function_switched_text_sections): Declare.
>>> 	* config/darwin-protos.h  
>>> (darwin_function_switched_text_sections) : Likewise.
>>> 	* config/darwin.c (darwin_function_switched_text_sections): New.
>>> 	* config/darwin.h (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
>>> 	New.
>>
>> This posted patch does not match what was checked in r168571.   
>> Could you please audit what was checked in and ensure it is as you  
>> wanted.  Thanks.
>
> Yes, the commit matches what was intended.

scratch that, I'm obviously blind.....

I'll bootstrap this on *-darwin9  + i686-darwin8 right away.

Iain


--- gcc/config/darwin.c (revision 169878)
+++ gcc/config/darwin.c (working copy)
@@ -2581,7 +2581,7 @@ darwin_override_options (void)
      global_options.x_flag_asynchronous_unwind_tables = 0;

     /* Disable -freorder-blocks-and-partition when unwind tables are  
being emitted
-      for Darwin < 10 (OSX 10.6).
+      for Darwin < 9 (OSX 10.5).
        The strategy is, "Unless the User has specifically set/unset  
an unwind flag
        we will switch off -freorder-blocks-and-partition when unwind  
tables will be
        generated".  If the User specifically sets flags... we assume  
(s)he knows
@@ -2596,6 +2596,13 @@ darwin_override_options (void)
                 && !global_options_set.x_flag_non_call_exceptions)
            || (global_options.x_flag_asynchronous_unwind_tables
                 && ! 
global_options_set.x_flag_asynchronous_unwind_tables)))
+    {
+      inform (input_location,
+               "-freorder-blocks-and-partition does not work with  
exceptions "
+               "on this architecture");
+      flag_reorder_blocks_and_partition = 0;
+      flag_reorder_blocks = 1;
+    }

    if (flag_mkernel || flag_apple_kext)
      {


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Patch] Fix anonymous code atoms problem on Darwin.
  2011-02-08  9:14     ` IainS
@ 2011-02-08 13:35       ` IainS
  2011-02-08 20:50         ` Mike Stump
  0 siblings, 1 reply; 10+ messages in thread
From: IainS @ 2011-02-08 13:35 UTC (permalink / raw)
  To: Mike Stump; +Cc: GCC Patches


On 8 Feb 2011, at 09:14, IainS wrote:
> On 8 Feb 2011, at 08:19, IainS wrote:
>
>> On 8 Feb 2011, at 03:01, Mike Stump wrote:
>>
>>> On Dec 20, 2010, at 3:07 AM, IainS wrote:
>>>> This problem became apparent during the resolution of  
>>>> PR46904/46916 (we have had to switch off freorder-and-partition  
>>>> to avoid regression).
>>>
>>>> gcc:
>>>>
>>>> 	* target.def (function_switched_text_sections): New Hook.
>>>> 	* doc/tm.texi Regenerated.
>>>> 	* doc/tm.texi.in (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
>>>> 	New.
>>>> 	* final.c (default_function_switched_text_sections): New.
>>>> 	(final_scan_insn): Call function_switched_text_sections when a  
>>>> mid-function section
>>>> 	change occurs.
>>>> 	* output.h (default_function_switched_text_sections): Declare.
>>>> 	* config/darwin-protos.h  
>>>> (darwin_function_switched_text_sections) : Likewise.
>>>> 	* config/darwin.c (darwin_function_switched_text_sections): New.
>>>> 	* config/darwin.h (TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS)
>>>> 	New.
>>>
>>> This posted patch does not match what was checked in r168571.   
>>> Could you please audit what was checked in and ensure it is as you  
>>> wanted.  Thanks.
>>
>> Yes, the commit matches what was intended.
>
> scratch that, I'm obviously blind.....
>
> I'll bootstrap this on *-darwin9  + i686-darwin8 right away.

it bootstrapped and does what's intended on *-darwin9 and i686-darwin8.

one endeavors to split composite patches properly, in this case I must  
have accidentally deleted a hunk.
apologies for a careless mistake :(

OK to commit this to correct it?
Iain

> --- gcc/config/darwin.c (revision 169878)
> +++ gcc/config/darwin.c (working copy)
> @@ -2581,7 +2581,7 @@ darwin_override_options (void)
>     global_options.x_flag_asynchronous_unwind_tables = 0;
>
>    /* Disable -freorder-blocks-and-partition when unwind tables are  
> being emitted
> -      for Darwin < 10 (OSX 10.6).
> +      for Darwin < 9 (OSX 10.5).
>       The strategy is, "Unless the User has specifically set/unset  
> an unwind flag
>       we will switch off -freorder-blocks-and-partition when unwind  
> tables will be
>       generated".  If the User specifically sets flags... we assume  
> (s)he knows
> @@ -2596,6 +2596,13 @@ darwin_override_options (void)
>                && !global_options_set.x_flag_non_call_exceptions)
>           || (global_options.x_flag_asynchronous_unwind_tables
>                && ! 
> global_options_set.x_flag_asynchronous_unwind_tables)))
> +    {
> +      inform (input_location,
> +               "-freorder-blocks-and-partition does not work with  
> exceptions "
> +               "on this architecture");
> +      flag_reorder_blocks_and_partition = 0;
> +      flag_reorder_blocks = 1;
> +    }
>
>   if (flag_mkernel || flag_apple_kext)
>     {
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Patch] Fix anonymous code atoms problem on Darwin.
  2011-02-08 13:35       ` IainS
@ 2011-02-08 20:50         ` Mike Stump
  2011-02-12 11:21           ` IainS
  0 siblings, 1 reply; 10+ messages in thread
From: Mike Stump @ 2011-02-08 20:50 UTC (permalink / raw)
  To: IainS; +Cc: GCC Patches

On Feb 8, 2011, at 5:35 AM, IainS wrote:
> OK to commit this to correct it?

Ok, if the indentation level is good...  If you use emacs, just hit tab on each of the lines in question...

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Patch] Fix anonymous code atoms problem on Darwin.
  2011-02-08 20:50         ` Mike Stump
@ 2011-02-12 11:21           ` IainS
  0 siblings, 0 replies; 10+ messages in thread
From: IainS @ 2011-02-12 11:21 UTC (permalink / raw)
  To: GCC Patches; +Cc: Mike Stump

[-- Attachment #1: Type: text/plain, Size: 407 bytes --]


On 8 Feb 2011, at 20:49, Mike Stump wrote:

> On Feb 8, 2011, at 5:35 AM, IainS wrote:
>> OK to commit this to correct it?
>
> Ok, if the indentation level is good...  If you use emacs, just hit  
> tab on each of the lines in question...

I fixed the over-length comment lines, incorrect indenting of the last  
three if clauses  ...
...  and added the missed hunk.

committed as attached, r170069.
Iain


[-- Attachment #2: 170068-darwinc-corrections.txt --]
[-- Type: text/plain, Size: 2644 bytes --]

Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 170068)
+++ gcc/ChangeLog	(working copy)
@@ -1,5 +1,11 @@
 2011-02-12  Iain Sandoe  <iains@gcc.gnu.org>
 
+	* config/darwin.c (darwin_override_options): Add a hunk missed
+	from the commit of r168571.  Trim comment line lengths and 
+	correct indents of the preceding block.
+
+2011-02-12  Iain Sandoe  <iains@gcc.gnu.org>
+
 	* gcc.c (driver_handle_option): Concatenate the argument to -F with
 	the switch.
 
Index: gcc/config/darwin.c
===================================================================
--- gcc/config/darwin.c	(revision 170068)
+++ gcc/config/darwin.c	(working copy)
@@ -2580,22 +2580,29 @@ darwin_override_options (void)
       && !TARGET_64BIT)
     global_options.x_flag_asynchronous_unwind_tables = 0;
 
-   /* Disable -freorder-blocks-and-partition when unwind tables are being emitted
-      for Darwin < 10 (OSX 10.6).  
-      The strategy is, "Unless the User has specifically set/unset an unwind flag
-      we will switch off -freorder-blocks-and-partition when unwind tables will be
-      generated".  If the User specifically sets flags... we assume (s)he knows
-      why...  */
+   /* Disable -freorder-blocks-and-partition when unwind tables are being
+      emitted for Darwin < 9 (OSX 10.5).
+      The strategy is, "Unless the User has specifically set/unset an unwind
+      flag we will switch off -freorder-blocks-and-partition when unwind tables
+      will be generated".  If the User specifically sets flags... we assume
+      (s)he knows why...  */
    if (generating_for_darwin_version < 9
        && global_options_set.x_flag_reorder_blocks_and_partition
        && ((global_options.x_flag_exceptions 		/* User, c++, java */
 	    && !global_options_set.x_flag_exceptions) 	/* User specified... */
 	   || (global_options.x_flag_unwind_tables
-		&& !global_options_set.x_flag_unwind_tables)
+	       && !global_options_set.x_flag_unwind_tables)
 	   || (global_options.x_flag_non_call_exceptions
-		&& !global_options_set.x_flag_non_call_exceptions)
+	       && !global_options_set.x_flag_non_call_exceptions)
 	   || (global_options.x_flag_asynchronous_unwind_tables
-		&& !global_options_set.x_flag_asynchronous_unwind_tables)))
+	       && !global_options_set.x_flag_asynchronous_unwind_tables)))
+    {
+      inform (input_location,
+	      "-freorder-blocks-and-partition does not work with exceptions "
+	      "on this architecture");
+      flag_reorder_blocks_and_partition = 0;
+      flag_reorder_blocks = 1;
+    }
 
   if (flag_mkernel || flag_apple_kext)
     {

[-- Attachment #3: Type: text/plain, Size: 3 bytes --]





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-02-12 10:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-20 12:03 [Patch] Fix anonymous code atoms problem on Darwin IainS
2010-12-20 21:49 ` Richard Henderson
2010-12-23 20:50 ` Mike Stump
2011-01-07 14:12   ` IainS
2011-02-08  3:01 ` Mike Stump
2011-02-08  8:19   ` IainS
2011-02-08  9:14     ` IainS
2011-02-08 13:35       ` IainS
2011-02-08 20:50         ` Mike Stump
2011-02-12 11:21           ` IainS

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).