[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-22 Thread howarth at nitro dot med dot uc dot edu


--- Comment #45 from howarth at nitro dot med dot uc dot edu  2009-10-22 
12:57 ---
Fixed with r153057.


-- 

howarth at nitro dot med dot uc dot edu changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-21 Thread pogma at gcc dot gnu dot org


--- Comment #44 from pogma at gcc dot gnu dot org  2009-10-21 15:08 ---
Subject: Bug 41313

Author: pogma
Date: Wed Oct 21 15:07:59 2009
New Revision: 153057

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153057
Log:
2009-10-21  Jack Howarth  

PR c++/41313
* gcc/config/darwin10.h: Use default_emit_unwind_label.
* gcc/config/darwin.c: Disable -freorder-blocks-and-partition
when darwin_emit_unwind_label is used.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/darwin.c
trunk/gcc/config/darwin10.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-10 Thread howarth at nitro dot med dot uc dot edu


--- Comment #43 from howarth at nitro dot med dot uc dot edu  2009-10-11 
01:13 ---
Posted new revised patch to gcc-patches...

http://gcc.gnu.org/ml/gcc-patches/2009-10/msg00670.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-10 Thread howarth at nitro dot med dot uc dot edu


--- Comment #42 from howarth at nitro dot med dot uc dot edu  2009-10-11 
01:11 ---
Created an attachment (id=18782)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18782&action=view)
Revised fix for PR41313 with dual approach


-- 

howarth at nitro dot med dot uc dot edu changed:

   What|Removed |Added

  Attachment #18752|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-08 Thread howarth at nitro dot med dot uc dot edu


--- Comment #41 from howarth at nitro dot med dot uc dot edu  2009-10-08 
15:17 ---
Posted revised patch from Comment 40 to gcc-patches...

http://gcc.gnu.org/ml/gcc-patches/2009-10/msg00519.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-08 Thread howarth at nitro dot med dot uc dot edu


--- Comment #40 from howarth at nitro dot med dot uc dot edu  2009-10-08 
15:16 ---
Created an attachment (id=18752)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18752&action=view)
Fix PR41313 with dual approach


-- 

howarth at nitro dot med dot uc dot edu changed:

   What|Removed |Added

  Attachment #18718|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-05 Thread howarth at nitro dot med dot uc dot edu


--- Comment #39 from howarth at nitro dot med dot uc dot edu  2009-10-06 
02:19 ---
Mike,
Does darwin have named sections? If so, we can drop the check on
!targetm.have_named_sections.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-05 Thread howarth at nitro dot med dot uc dot edu


--- Comment #38 from howarth at nitro dot med dot uc dot edu  2009-10-06 
02:18 ---
Created an attachment (id=18718)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18718&action=view)
patch to handle unwind label and -freorder-blocks-and-partition control in
darwin.c


-- 

howarth at nitro dot med dot uc dot edu changed:

   What|Removed |Added

  Attachment #18703|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-05 Thread howarth at nitro dot med dot uc dot edu


--- Comment #37 from howarth at nitro dot med dot uc dot edu  2009-10-06 
02:05 ---
Opps. In both of the last patch...

+  if ((darwin_macosx_version_min && strverscmp(darwin_macosx_version_min,
"10.6") >= 0) || flag_reorder_blocks_and_partition)

should be

+  if (!(darwin_macosx_version_min && strverscmp(darwin_macosx_version_min,
"10.6") >= 0) && flag_reorder_blocks_and_partition)

of course.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-05 Thread howarth at nitro dot med dot uc dot edu


--- Comment #36 from howarth at nitro dot med dot uc dot edu  2009-10-06 
02:02 ---
This can be factored down to...

Index: gcc/config/darwin.c
===
--- gcc/config/darwin.c (revision 152481)
+++ gcc/config/darwin.c (working copy)
@@ -1454,7 +1454,7 @@
 {
   char *lab;

-  if (! for_eh)
+  if ((! for_eh) || (darwin_macosx_version_min &&
strverscmp(darwin_macosx_version_min, "10.6") >= 0))
 return;

   lab = concat (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), ".eh", NULL);
@@ -1697,6 +1697,19 @@
   if (dwarf_strict < 0) 
 dwarf_strict = 1;

+  if ((darwin_macosx_version_min && strverscmp(darwin_macosx_version_min,
"10.6") >= 0) || flag_reorder_blocks_and_partition)
+{
+  if (flag_exceptions ||
+ flag_unwind_tables ||
+ !targetm.have_named_sections)
+   {
+ 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)
 {
   /* -mkernel implies -fapple-kext for C++ */


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-05 Thread howarth at nitro dot med dot uc dot edu


--- Comment #35 from howarth at nitro dot med dot uc dot edu  2009-10-06 
00:51 ---
Testing...

Index: gcc/config/darwin.c
===
--- gcc/config/darwin.c (revision 152480)
+++ gcc/config/darwin.c (working copy)
@@ -1454,7 +1454,7 @@
 {
   char *lab;

-  if (! for_eh)
+  if ((! for_eh) || (darwin_macosx_version_min &&
strverscmp(darwin_macosx_version_min, "10.6") >= 0))
 return;

   lab = concat (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), ".eh", NULL);
@@ -1697,6 +1697,19 @@
   if (dwarf_strict < 0) 
 dwarf_strict = 1;

+  if (!(darwin_macosx_version_min && strverscmp(darwin_macosx_version_min,
"10.6") >= 0) && flag_reorder_blocks_and_partition)
+{
+  if (flag_exceptions ||
+ (flag_unwind_tables && !targetm.unwind_tables_default) ||
+ (!targetm.have_named_sections || (flag_unwind_tables &&
targetm.unwind_tables_default)))
+   {
+ 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)
 {
   /* -mkernel implies -fapple-kext for C++ */


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-05 Thread howarth at nitro dot med dot uc dot edu


--- Comment #34 from howarth at nitro dot med dot uc dot edu  2009-10-05 
23:25 ---
Actually, I just noticed that with the latest patch we still fail...

gcc.dg/tree-prof/pr34999.c

Executing on host:
/sw/src/fink.build/gcc45-4.4.999-20091003/darwin_objdir/gcc/xgcc
-B/sw/src/fink.build/gcc45-4.4.999-20091003/darwin_objdir/gcc/
/sw/src/fink.build/gcc45-4.4.999-20091003/gcc-4.5-20091003/gcc/testsuite/gcc.dg/tree-prof/pr34999.c
  -O2 -freorder-blocks-and-partition -fprofile-use -D_PROFILE_USE  -lm   -o
/sw/src/fink.build/gcc45-4.4.999-20091003/darwin_objdir/gcc/testsuite/gcc/pr34999.x02
   (timeout = 300)
/var/tmp//ccTlWKzV.s:219:FATAL:Symbol _main.eh already defined.
compiler exited with status 1
output is:
/var/tmp//ccTlWKzV.s:219:FATAL:Symbol _main.eh already defined.

FAIL: gcc.dg/tree-prof/pr34999.c compilation,  -fprofile-use -D_PROFILE_USE
UNRESOLVED: gcc.dg/tree-prof/pr34999.c execution,-fprofile-use
-D_PROFILE_USE

I'll take a look at perhaps just setting...

flag_reorder_blocks_and_partition = 0;
flag_reorder_blocks = 1;

 in darwin.c's overrides when targeting <10.6 and adjusting
darwin_emit_unwind() to not emit labels when targeting >=10.6.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-05 Thread mrs at apple dot com


--- Comment #33 from mrs at apple dot com  2009-10-05 21:16 ---
I'm fine with the latest patch.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-05 Thread mrs at apple dot com


--- Comment #32 from mrs at apple dot com  2009-10-05 20:55 ---
I suspect the other case is simply:

if (flag_exceptions)
  flag_reorder_blocks_and_partition = 0;

be added, just like the code for flag_unwind_tables.  I suspect this, as the
testcase is *.C.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-05 Thread howarth at nitro dot med dot uc dot edu


--- Comment #31 from howarth at nitro dot med dot uc dot edu  2009-10-05 
18:05 ---
(In reply to comment #12)
> It is unclear what those labels are good for, but if darwin is to support
> hot/cold partitioning and FDEs covering it, the emit unwind_label hook (which
> is apparently darwin specific only) should be passed also the SECOND variable
> and create different label name for the second FDE for the same function (if
> function starts in hot section, then the second one is covering the cold
> section, and vice versa).
> The patch in #c11 would just mean you'd keep older versions broken.
> 

Jakub,
   Do you mean that we need to pass 'second' from gcc/ira-int.h?

  /* Allocnos connected by the copy.  The first allocno should have
 smaller order number than the second one.  */
  ira_allocno_t first, second;

to darwin_emit_unwind_label()? Also, what would we use to detect whether the
first and second FDE's came from hot or cold sections?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-04 Thread howarth at nitro dot med dot uc dot edu


--- Comment #30 from howarth at nitro dot med dot uc dot edu  2009-10-04 
16:38 ---
Created an attachment (id=18703)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18703&action=view)
Patch to revert to pre-r150553 behavior on darwin


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-02 Thread howarth at nitro dot med dot uc dot edu


--- Comment #29 from howarth at nitro dot med dot uc dot edu  2009-10-02 
22:09 ---
Jakub,
Is there any reason why we can't have...

Index: opts.c
===
--- opts.c  (revision 152346)
+++ opts.c  (working copy)
@@ -1039,7 +1039,7 @@

   if (flag_exceptions && flag_reorder_blocks_and_partition
   && (USING_SJLJ_EXCEPTIONS
-#ifdef TARGET_UNWIND_INFO
+#if defined (TARGET_UNWIND_INFO) || defined (DWARF2_UNWIND_INFO)
  || 1
 #endif
 ))
@@ -1056,7 +1056,7 @@
   if (flag_unwind_tables && ! targetm.unwind_tables_default
   && flag_reorder_blocks_and_partition
   && (USING_SJLJ_EXCEPTIONS
-#ifdef TARGET_UNWIND_INFO
+#if defined (TARGET_UNWIND_INFO) || defined (DWARF2_UNWIND_INFO)
  || 1
 #endif
 ))
@@ -1075,7 +1075,7 @@
   && (!targetm.have_named_sections
  || (flag_unwind_tables && targetm.unwind_tables_default
  && (USING_SJLJ_EXCEPTIONS
-#ifdef TARGET_UNWIND_INFO
+#if defined (TARGET_UNWIND_INFO)  || defined (DWARF2_UNWIND_INFO)
  || 1
 #endif
 

I suspect this should unbreak darwin.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313



[Bug c++/41313] r150553 causes g++.dg/tree-prof/partition1.C compilation and execution test failures on *-apple-darwin*

2009-10-02 Thread howarth at nitro dot med dot uc dot edu


--- Comment #28 from howarth at nitro dot med dot uc dot edu  2009-10-02 
14:08 ---
On reflection, I think the change Mike proposed for darwin.c in Comment 13
fails because it flag_reorder_blocks never gets set to 1 by that patch. I don't
know how I could implement the three variations of setting that which occur in
opts.c from within the overrides of darwin.c. Those cases in opts.c are listed
as...

  /* The optimization to partition hot and cold basic blocks into separate
 sections of the .o and executable files does not work (currently)
 with exception handling.  This is because there is no support for
 generating unwind info.  If flag_exceptions is turned on we need to
 turn off the partitioning optimization.  */

  /* If user requested unwind info, then turn off the partitioning
 optimization.  */

  /* If the target requested unwind info, then turn off the partitioning
 optimization with a different message.  Likewise, if the target does not
 support named sections.  */

Would it be as simple as duplicating those three variations of the conditional
within the overrides of darwin.c to duplicate their behavior? It seem much
better to fix the breakage in opts.c caused by r150553.


-- 

howarth at nitro dot med dot uc dot edu changed:

   What|Removed |Added

Summary|g++.dg/tree-|r150553 causes g++.dg/tree-
   |prof/partition1.C   |prof/partition1.C
   |compilation and execution   |compilation and execution
   |test failures on *-apple-   |test failures on *-apple-
   |darwin* |darwin*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41313