[wwwdocs] Buildstat update for 4.4

2011-06-03 Thread Tom G. Christensen
Latest results for 4.4.x.

-tgc

Testresults for 4.4.6:
  alphaev68-dec-osf5.1a
  hppa2.0w-hp-hpux11.11
  hppa64-hp-hpux11.11
  sparc-sun-solaris2.7
Index: buildstat.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.4/buildstat.html,v
retrieving revision 1.22
diff -u -r1.22 buildstat.html
--- buildstat.html  1 May 2011 20:45:24 -   1.22
+++ buildstat.html  3 Jun 2011 07:40:37 -
@@ -34,6 +34,7 @@
 alphaev68-dec-osf5.1a
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg00074.html";>4.4.6,
 http://gcc.gnu.org/ml/gcc-testresults/2010-12/msg01338.html";>4.4.5,
 http://gcc.gnu.org/ml/gcc-testresults/2010-07/msg01437.html";>4.4.4,
 http://gcc.gnu.org/ml/gcc-testresults/2009-07/msg03093.html";>4.4.1
@@ -142,6 +143,7 @@
 hppa2.0w-hp-hpux11.11
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg00201.html";>4.4.6,
 http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg02383.html";>4.4.4,
 http://gcc.gnu.org/ml/gcc-testresults/2010-01/msg02240.html";>4.4.3,
 http://gcc.gnu.org/ml/gcc-testresults/2009-11/msg02163.html";>4.4.2,
@@ -164,6 +166,7 @@
 hppa64-hp-hpux11.11
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg00400.html";>4.4.6,
 http://gcc.gnu.org/ml/gcc-testresults/2010-05/msg02914.html";>4.4.4,
 http://gcc.gnu.org/ml/gcc-testresults/2010-01/msg02364.html";>4.4.3,
 http://gcc.gnu.org/ml/gcc-testresults/2009-11/msg02261.html";>4.4.2,
@@ -365,6 +368,7 @@
 sparc-sun-solaris2.7
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-06/msg00145.html";>4.4.6
 http://gcc.gnu.org/ml/gcc-testresults/2009-07/msg00420.html";>4.4.0
 
 


[wwwdocs] Buildstat update for 4.5

2011-06-03 Thread Tom G. Christensen
Latest results for 4.5.x

-tgc

Testresults for 4.5.3:
  armv7l-unknown-linux-gnueabi
  hppa2.0w-hp-hpux11.00
  hppa2.0w-hp-hpux11.11
  hppa64-hp-hpux11.00
  hppa64-hp-hpux11.11
  i386-pc-solaris2.8
  i686-pc-linux-gnu (2)
  ia64-unknown-linux-gnu
  sparc-sun-solaris2.8
  x86_64-unknown-linux-gnu (2)
Index: buildstat.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.5/buildstat.html,v
retrieving revision 1.10
diff -u -r1.10 buildstat.html
--- buildstat.html  1 May 2011 23:21:49 -   1.10
+++ buildstat.html  3 Jun 2011 07:37:58 -
@@ -56,6 +56,14 @@
 
 
 
+armv7l-unknown-linux-gnueabi
+ 
+Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-06/msg00094.html";>4.5.3
+
+
+
+
 hppa-unknown-linux-gnu
  
 Test results:
@@ -67,6 +75,7 @@
 hppa2.0w-hp-hpux11.00
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg01358.html";>4.5.3,
 http://gcc.gnu.org/ml/gcc-testresults/2010-09/msg01008.html";>4.5.1
 
 
@@ -75,6 +84,7 @@
 hppa2.0w-hp-hpux11.11
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg00527.html";>4.5.3,
 http://gcc.gnu.org/ml/gcc-testresults/2010-12/msg01679.html";>4.5.2
 
 
@@ -83,6 +93,7 @@
 hppa64-hp-hpux11.00
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg01736.html";>4.5.3,
 http://gcc.gnu.org/ml/gcc-testresults/2010-09/msg01432.html";>4.5.1
 
 
@@ -91,6 +102,7 @@
 hppa64-hp-hpux11.11
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg00817.html";>4.5.3,
 http://gcc.gnu.org/ml/gcc-testresults/2010-12/msg01818.html";>4.5.2
 
 
@@ -117,6 +129,7 @@
 i386-pc-solaris2.8
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg00795.html";>4.5.3,
 http://gcc.gnu.org/ml/gcc-testresults/2010-12/msg01977.html";>4.5.2,
 http://gcc.gnu.org/ml/gcc-testresults/2010-12/msg01703.html";>4.5.2,
 http://gcc.gnu.org/ml/gcc-testresults/2010-08/msg01024.html";>4.5.1,
@@ -167,6 +180,8 @@
 i686-pc-linux-gnu
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg01584.html";>4.5.3,
+http://gcc.gnu.org/ml/gcc-testresults/2011-06/msg8.html";>4.5.3,
 http://gcc.gnu.org/ml/gcc-testresults/2011-01/msg02007.html";>4.5.2,
 http://gcc.gnu.org/ml/gcc-testresults/2010-12/msg01763.html";>4.5.2,
 http://gcc.gnu.org/ml/gcc-testresults/2010-12/msg01587.html";>4.5.2,
@@ -184,6 +199,7 @@
 ia64-unknown-linux-gnu
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg01590.html";>4.5.3,
 http://gcc.gnu.org/ml/gcc-testresults/2010-12/msg01388.html";>4.5.2,
 http://gcc.gnu.org/ml/gcc-testresults/2010-07/msg02982.html";>4.5.1
 
@@ -263,6 +279,7 @@
 sparc-sun-solaris2.8
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg00833.html";>4.5.3,
 http://gcc.gnu.org/ml/gcc-testresults/2011-01/msg01684.html";>4.5.2,
 http://gcc.gnu.org/ml/gcc-testresults/2010-12/msg01975.html";>4.5.2,
 http://gcc.gnu.org/ml/gcc-testresults/2010-12/msg01701.html";>4.5.2,
@@ -342,6 +359,8 @@
 x86_64-unknown-linux-gnu
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg01586.html";>4.5.3,
+http://gcc.gnu.org/ml/gcc-testresults/2011-06/msg00018.html";>4.5.3,
 http://gcc.gnu.org/ml/gcc-testresults/2011-02/msg00873.html";>4.5.2,
 http://gcc.gnu.org/ml/gcc-testresults/2011-02/msg00429.html";>4.5.2,
 http://gcc.gnu.org/ml/gcc-testresults/2010-07/msg02969.html";>4.5.1,


[wwwdocs] Buildstat update for 4.6

2011-06-03 Thread Tom G. Christensen
Latest results for 4.6.x

-tgc

Testresults for 4.6.0:
  i686-pc-linux-gnu
  x86_64-unknown-linux-gnu
Index: buildstat.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.6/buildstat.html,v
retrieving revision 1.3
diff -u -r1.3 buildstat.html
--- buildstat.html  2 May 2011 08:53:22 -   1.3
+++ buildstat.html  3 Jun 2011 07:40:26 -
@@ -106,6 +106,7 @@
 i686-pc-linux-gnu
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg03610.html";>4.6.0,
 http://gcc.gnu.org/ml/gcc-testresults/2011-04/msg00440.html";>4.6.0,
 http://gcc.gnu.org/ml/gcc-testresults/2011-04/msg00064.html";>4.6.0,
 http://gcc.gnu.org/ml/gcc-testresults/2011-03/msg03104.html";>4.6.0,
@@ -202,6 +203,7 @@
 x86_64-unknown-linux-gnu
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg03091.html";>4.6.0,
 http://gcc.gnu.org/ml/gcc-testresults/2011-04/msg00445.html";>4.6.0,
 http://gcc.gnu.org/ml/gcc-testresults/2011-03/msg03102.html";>4.6.0,
 http://gcc.gnu.org/ml/gcc-testresults/2011-03/msg02754.html";>4.6.0


[wwwdocs] Buildstat update for 4.3

2011-06-03 Thread Tom G. Christensen
Latest results for 4.3.x.

-tgc

Testresults for 4.3.5:
  sparc-sun-solaris2.7
Index: buildstat.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.3/buildstat.html,v
retrieving revision 1.34
diff -u -r1.34 buildstat.html
--- buildstat.html  7 Oct 2010 01:53:03 -   1.34
+++ buildstat.html  3 Jun 2011 07:11:16 -
@@ -484,6 +484,7 @@
 sparc-sun-solaris2.7
  
 Test results:
+http://gcc.gnu.org/ml/gcc-testresults/2011-05/msg03066.html";>4.3.5,
 http://gcc.gnu.org/ml/gcc-testresults/2009-09/msg01055.html";>4.3.4,
 http://gcc.gnu.org/ml/gcc-testresults/2009-01/msg03291.html";>4.3.3,
 http://gcc.gnu.org/ml/gcc-testresults/2008-11/msg00470.html";>4.3.2


Re: [patch] add -Wdelete-non-virtual-dtor

2011-06-03 Thread Jonathan Wakely
On 3 June 2011 02:55, Jason Merrill wrote:
> On 06/02/2011 06:02 PM, Jonathan Wakely wrote:
>>
>> +             if (!dtor || !DECL_VINDEX (dtor))
>
> Do we really want to warn about the case where the class has no/trivial
> destructor?

I think so.  Definitely if it's an abstract class, since it's
definitely undefined behaviour.  The user might have forgotten to
define the destructor, so the warning would draw their attention to
it.

For example:

struct abc { virtual void f() = 0; };
struct interface : abc { virtual ~interface(); };
void f(abc* p) { delete p; }

The intended use might be to destroy such objects through a pointer to
interface, but f() has been defined to take the wrong type.

>> +                 bool abstract = false;
>> +                 for (x = TYPE_METHODS (type); x; x = DECL_CHAIN (x))
>> +                   if (DECL_PURE_VIRTUAL_P (x))
>> +                     {
>> +                       abstract = true;
>> +                       break;
>> +                     }
>> +                 if (abstract)
>
> Just check CLASSTYPE_PURE_VIRTUALS.

Thanks, I'll retest with that change ...


Re: [Patch ARM] Unbreak bootstrap for --with-fpu=neon.

2011-06-03 Thread Ramana Radhakrishnan

On 01/06/11 18:27, Ramana Radhakrishnan wrote:

2011-05-31  Ramana Radhakrishnan

* config/arm/neon.md (orndi3_neon): Actually split it.


This is what I committed in the end after a round of testing.

Ramana

Index: gcc/config/arm/neon.md
===
--- gcc/config/arm/neon.md  (revision 174596)
+++ gcc/config/arm/neon.md  (working copy)
@@ -801,17 +801,44 @@
   [(set_attr "neon_type" "neon_int_1")]
 )
 
-(define_insn "orndi3_neon"
-  [(set (match_operand:DI 0 "s_register_operand" "=w,?=&r,?&r")
-   (ior:DI (not:DI (match_operand:DI 2 "s_register_operand" "w,0,r"))
-   (match_operand:DI 1 "s_register_operand" "w,r,0")))]
+;; TODO: investigate whether we should disable 
+;; this and bicdi3_neon for the A8 in line with the other
+;; changes above. 
+(define_insn_and_split "orndi3_neon"
+  [(set (match_operand:DI 0 "s_register_operand" "=w,?&r,?&r,?&r")
+   (ior:DI (not:DI (match_operand:DI 2 "s_register_operand" "w,0,0,r"))
+   (match_operand:DI 1 "s_register_operand" "w,r,r,0")))]
   "TARGET_NEON"
   "@
vorn\t%P0, %P1, %P2
#
+   #
#"
-  [(set_attr "neon_type" "neon_int_1,*,*")
-   (set_attr "length" "*,8,8")]
+  "reload_completed && 
+   (TARGET_NEON && !(IS_VFP_REGNUM (REGNO (operands[0]"
+  [(set (match_dup 0) (ior:SI (not:SI (match_dup 2)) (match_dup 1)))
+   (set (match_dup 3) (ior:SI (not:SI (match_dup 4)) (match_dup 5)))]
+  "
+  {
+if (TARGET_THUMB2)
+  {
+operands[3] = gen_highpart (SImode, operands[0]);
+operands[0] = gen_lowpart (SImode, operands[0]);
+operands[4] = gen_highpart (SImode, operands[2]);
+operands[2] = gen_lowpart (SImode, operands[2]);
+operands[5] = gen_highpart (SImode, operands[1]);
+operands[1] = gen_lowpart (SImode, operands[1]);
+  }
+else
+  {
+emit_insn (gen_one_cmpldi2 (operands[0], operands[2]));
+emit_insn (gen_iordi3 (operands[0], operands[1], operands[0]));
+DONE;
+  }
+  }"
+  [(set_attr "neon_type" "neon_int_1,*,*,*")
+   (set_attr "length" "*,16,8,8")
+   (set_attr "arch" "any,a,t2,t2")]
 )
 
 (define_insn "bic3_neon"


Re: Add missing ChangeLog entry

2011-06-03 Thread Nathan Sidwell

On 06/02/11 18:13, Ian Lance Taylor wrote:


Works for me, but please add an @xref{Spec Files} (you might need a
document in there too, not sure) as a pointer to where the spec format
is documented.


ok, this is what I committed, cribbing from the rs6000 xref in the same file.

nathan

--
Nathan Sidwell

2011-06-03  Nathan Sidwell  

* doc/install.texi (Options specification): Document --with-specs.

Index: doc/install.texi
===
--- doc/install.texi(revision 174597)
+++ doc/install.texi(working copy)
@@ -771,6 +771,19 @@
 on other configuration options, and differs between cross and native
 configurations.
 
+@item --with-specs=@var{specs}
+Specify additional command line driver SPECS.
+This can be useful if you need to turn on a non-standard feature by
+default without modifying the compiler's source code, for instance
+@option{--with-specs=%@{!fcommon:%@{!fno-common:-fno-common@}@}}.
+@ifnothtml
+@xref{Spec Files,, Specifying subprocesses and the switches to pass to them,
+gcc, Using the GNU Compiler Collection (GCC)},
+@end ifnothtml
+@ifhtml
+See ``Spec Files'' in the main manual
+@end ifhtml
+
 @end table
 
 @item --program-prefix=@var{prefix}


Re: [PATCH, ARM] Cortex-A5 tuning [2/2] - tweak instruction conditionalisation

2011-06-03 Thread Richard Earnshaw

On Thu, 2011-06-02 at 17:41 +0100, Julian Brown wrote:
> On Wed, 01 Jun 2011 17:00:30 +0100
> Richard Earnshaw  wrote:
> 
> > 
> > On Wed, 2011-06-01 at 16:49 +0100, Julian Brown wrote:
> > > This patch tweaks the behaviour of arm_final_prescan_insn when
> > > tuning for Cortex-A5 cores, since branches are cheaper than long
> > > sequences of conditionalised instructions on those processors. As
> > > posted in the previous patch, this provides a measurable increase
> > > in performance on a popular embedded benchmark.
> > > 
> > > (I didn't use the tuning infrastructure for this one, though it
> > > could easily be changed to do so, now I come to think of it.)
> >
> > I would much prefer that this was done through the tuning
> > infrastructure.  If one core likes it this way, there's a strong
> > chance of another one coming along that has similar preferences.
> 
> How does this version look? I've left the size-optimisation case the
> same (max_insns_skipped=6), but added a "tunable" integer to the
> tune_params structure allowing the speed-optimisation case to be varied
> according to the chosen target tuning.
> 
> To maintain existing semantics, this means duplicating the "fastmul"
> structure for the StrongARM (XScale also used the StrongARM
> setting, but already has its own tuning structure).
> 
> Minimally re-tested. OK to apply?
> 
> Thanks,
> 
> Julian
> 
> ChangeLog
> 
> gcc/
> * config/arm/arm-cores.def (strongarm, strongarm110, strongarm1100)
> (strongarm1110): Use strongarm tuning.
> * config/arm/arm-protos.h (tune_params): Add max_insns_skipped
> field.
> * config/arm/arm.c (arm_strongarm_tune): New.
> (arm_slowmul_tune, arm_fastmul_tune, arm_xscale_tune, arm_9e_tune)
> (arm_v6t2_tune, arm_cortex_tune, arm_cortex_a5_tune)
> (arm_cortex_a9_tune, arm_fa726te_tune): Add max_insns_skipped field
> setting, using previous defaults or 1 for Cortex-A5.
> (arm_option_override): Set max_insns_skipped from current tuning.

OK.

R.




Re: fix left-over debug insns in DCE

2011-06-03 Thread Eric Botcazou
> Hmm...  Maybe it could, I'm not sure.  The problem is that DCE removes
> insns, and then DF associates remaining uses in debug insns to earlier
> DEFs.  Adjusting debug insns in DCE is right per the VTA design motto:
> decide as if debug insns weren't there, adjust them as you would adjust
> non-debug insns.  This code borrowed from DF into DCE is the “adjust”
> bit.

But DCE isn't the only pass that removes insns.  Does the same logic need to be 
replicated in all passes that do?  On the other hand, these passes call into 
DF when they remove insns, so DF is a central place here.

> Err...  These depend on the interface changes of functions defined
> within DF to work.

No, they don't, I can compile them independently.

-- 
Eric Botcazou


Re: [patch] Fix PR tree-optimization/49038

2011-06-03 Thread Richard Guenther
On Thu, Jun 2, 2011 at 6:06 PM, Ira Rosen  wrote:
> On 26 May 2011 10:52, Ira Rosen  wrote:
>> Hi,
>>
>> The vectorizer supports strided loads with gaps, e.g., when only a[4i]
>> and a[4i+2] are accessed, it generates a vector load a[4i:4i+3], i.e.,
>> creating an access to a[4i+3], which doesn't exist in the scalar code.
>> This access maybe invalid as described in the PR.
>>
>> This patch creates an epilogue loop (with at least one iteration) for
>> such cases.
>>
>> Bootstrapped and tested on powerpc64-suse-linux.
>> Applied to trunk. I'll prepare patches for 4.5 and 4.6 next week.
>>
>
> Here are the patches. Bootstrapped and tested on x86_64-suse-linux
> (4.5) and on powerpc64-suse-linux (4.6).
> OK to apply?

Ok.

Thanks,
Richard.

> Thanks,
> Ira
>
>
> 4.6 ChangeLog:
>
>                 PR tree-optimization/49038
>                 * tree-vect-loop-manip.c (vect_generate_tmps_on_preheader):
>                 Ensure at least one epilogue iteration if required by data
>                 accesses with gaps.
>                 * tree-vectorizer.h (struct _loop_vec_info): Add new field
>                 to mark loops that require peeling for gaps.
>                 * tree-vect-loop.c (new_loop_vec_info): Initialize new field.
>                 (vect_get_known_peeling_cost): Take peeling for gaps into
>                 account.
>                 (vect_transform_loop): Generate epilogue if required by data
>                 access with gaps.
>                 * tree-vect-data-refs.c (vect_analyze_group_access): Mark the
>                 loop as requiring an epilogue if there are gaps in the end of
>                 the strided group.
>
> 4.5 ChangeLog:
>
>                 PR tree-optimization/49038
>                 * tree-vect-loop-manip.c (vect_generate_tmps_on_preheader):
>                 Ensure at least one epilogue iteration if required by data
>                 accesses with gaps.
>                 * tree-vectorizer.h (struct _loop_vec_info): Add new field
>                 to mark loops that require peeling for gaps.
>                 * tree-vect-loop.c (new_loop_vec_info): Initialize new field.
>                 (vect_estimate_min_profitable_iters): Take peeling for gaps 
> into
>                 account.
>                 (vect_transform_loop): Generate epilogue if required by data
>                 access with gaps.
>                 * tree-vect-data-refs.c (vect_analyze_group_access): Mark the
>                 loop as requiring an epilogue if there are gaps in the end of
>                 the strided group.
>
> 4.6 and 4.5 testsuite/ChangeLog:
>
>                 PR tree-optimization/49038
>                 * gcc.dg/vect/vect-strided-u8-i8-gap4-unknown.c: New test.
>                 * gcc.dg/vect/pr49038.c: New test.
>


Re: [PR 48333] avoid -fcompare-debug errors from builtins in MEM attrs

2011-06-03 Thread Richard Guenther
On Fri, Jun 3, 2011 at 4:17 AM, Alexandre Oliva  wrote:
> Ping?  This fixes a case in which -g might change the executable code,
> exposed with bootstrap-debug-lean.
>
> On Apr  2, 2011, Alexandre Oliva  wrote:
>
>>       PR debug/48333
>>       * calls.c (emit_call_1): Prefer the __builtin declaration of
>>       builtin functions.
>
> http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00114.html

Ok.

Thanks,
Richard.

> --
> Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
> You must be the change you wish to see in the world. -- Gandhi
> Be Free! -- http://FSFLA.org/   FSF Latin America board member
> Free Software Evangelist      Red Hat Brazil Compiler Engineer
>


Re: PING: PATCH: PR target/46770: Use .init_array/.fini_array sections

2011-06-03 Thread Richard Guenther
On Fri, Jun 3, 2011 at 6:31 AM, H.J. Lu  wrote:
> On Wed, May 18, 2011 at 8:57 AM, H.J. Lu  wrote:
>> On Tue, Apr 26, 2011 at 6:05 AM, H.J. Lu  wrote:
>>> On Thu, Mar 31, 2011 at 7:57 AM, H.J. Lu  wrote:
 On Mon, Mar 21, 2011 at 11:40 AM, H.J. Lu  wrote:
> On Mon, Mar 14, 2011 at 12:28 PM, H.J. Lu  wrote:
>> On Thu, Jan 27, 2011 at 2:40 AM, Richard Guenther
>>  wrote:
>>> On Thu, Jan 27, 2011 at 12:12 AM, H.J. Lu  wrote:
 On Tue, Dec 14, 2010 at 05:20:48PM -0800, H.J. Lu wrote:
> This patch uses .init_array/.fini_array sections instead of
> .ctors/.dtors sections if mixing .init_array/.fini_array and
> .ctors/.dtors sections with init_priority works.
>
> It removes .ctors/.ctors sections from executables and DSOes, which 
> will
> remove one function call at startup time from each executable and DSO.
> It should reduce image size and improve system startup time.
>
> If a platform with a working .init_array/.fini_array support needs a
> different .init_array/.fini_array implementation, it can set
> use_initfini_array to no.
>
> Since .init_array/.fini_array is a target feature. 
> --enable-initfini-array
> is default to no unless the native run-time test is passed.
>
> To pass the native run-time test, a linker with SORT_BY_INIT_PRIORITY
> support is required.  The binutils patch is available at
>
> http://sourceware.org/ml/binutils/2010-12/msg00466.html

 Linker patch has been checked in.

>
> This patch passed 32bit/64bit regression test on Linux/x86-64.  Any
> comments?
>

 This updated patch fixes build on Linux/ia64 and should work on others.
 Any comments?
>>>
>>> Yes.  This is stage1 material.
>>>
>>
>> Here is the updated patch.  OK for trunk?
>>
>> Thanks.
>>
>>
>> --
>> H.J.
>> 
>> 2011-03-14  H.J. Lu  
>>
>>        PR target/46770
>>        * acinclude.m4 (gcc_AC_INITFINI_ARRAY): Removed.
>>
>>        * config.gcc (use_initfini_array): New variable.
>>        Use initfini-array.o if supported.
>>
>>        * crtstuff.c: Don't generate .ctors nor .dtors sections if
>>        NO_CTORS_DTORS_SECTIONS is defined.
>>
>>        * configure.ac: Remove gcc_AC_INITFINI_ARRAY.  Add
>>        --enable-initfini-array and check if .init_array can be used with
>>        .ctors.
>>
>>        * configure: Regenerated.
>>
>>        * config/initfini-array.c: New.
>>        * config/initfini-array.h: Likewise.
>>        * config/t-initfini-array: Likewise.
>>
>>        * config/arm/arm.c (arm_asm_init_sections): Call
>>        elf_initfini_array_init_sections if NO_CTORS_DTORS_SECTIONS
>>        is defined.
>>        * config/avr/avr.c (avr_asm_init_sections): Likewise.
>>        * config/ia64/ia64.c (ia64_asm_init_sections): Likewise.
>>        * config/mep/mep.c (mep_asm_init_sections): Likewise.
>>        * config/microblaze/microblaze.c 
>> (microblaze_elf_asm_init_sections):
>>        Likewise.
>>        * config/rs6000/rs6000.c (rs6000_elf_asm_init_sections): Likewise.
>>        * config/stormy16/stormy16.c (xstormy16_asm_init_sections):
>>        Likewise.
>>        * config/v850/v850.c (v850_asm_init_sections): Likewise.
>>
>
> PING:
>
> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00760.html
>

 Any comments?  Any objections?

>>>
>>> Here is the patch updated for the current trunk.  OK for trunk?
>>>
>>
>> PING,.
>
> Hi Richard,
>
> You commented my patch was stage 1 material:
>
> http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01989.html
>
> Is my patch:
>
> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00760.html
>
> OK for trunk?

I can't approve the configury changes and would like to defer
to target maintainers for the target specific changes.  That said,
I'm not familiar enough with the area of the patch.  But yes,
it's stage1 now - so if anyone else wants to approve this patch...

Richard.

> Thanks.
>
>
> --
> H.J.
>


Re: [PATCH, rs6000] Fix REG_CLASS_CONTENTS

2011-06-03 Thread Pat Haugen

On 05/31/2011 02:18 PM, David Edelsohn wrote:

On Tue, May 31, 2011 at 12:08 PM, Pat Haugen
  wrote:

>  The following patch fixes an issue I noticed where vr0..vr2 were
>  inadvertently included in NON_FLOAT_REGS.
>
>  Bootstrap/regtest on powerpc64-linux with no new regressions. Ok for trunk?
>
>  -Pat
>
>
>  2011-05-31  Pat Haugen
>
>  * config/rs6000/rs6000.h (REG_CLASS_CONTENTS): Remove vr0..vr2 from
>  NON_FLOAT_REGS.

Okay.



I should have asked before, ok for 4.6 also after bootstrap/regtest?

-Pat



[patch, libgfortran] Wrong rounding results with -m32

2011-06-03 Thread jerry DeLisle

Hi,

The attached patch, which includes test cases, fixes this bug by eliminating the 
code which used floating point instructions to determine the 'r' value as 
outlined in the Fortran standard under G formatting.


Essentially, the code now examines the d and e values to determine the number of 
digits before and after the decimal point and whether or not to display the 'E' 
exponent symbol.  Adjustments are made for various corner cases, including when 
rounding has resulted in a carry. (see PR for details of the trials)


This patch is intrusive.  It results in a minor performance improvement. It 
eliminates a bit of code.


Regression tested on x86-64.

OK for trunk? then later back port to 4.6 after some proving time?

Jerry

2011-06-03  Jerry DeLisle 

PR libgfortran/48906
* write.c (write_d, write_e, write_f, write_en, write_es, write_real,
write_real_g0): Eliminate compensating flag for precision adjustment.
* io/write_float.def (output_float): Add new comments. Add two new
variables lblank and tblank for keeping track of required leading and
trailing blanks. Add new code for the FMT_G case to determine digits
before and after the decimal point. Update error messages. Reorder
some of the existing code, separating portions handling formatting and
portions doing the actual output.
(CALCULATE_EXP): Delete this macro.
(OUTPUT_FLOAT): Delete this macro.
(write_float): Eliminate precision compensating flag.
Index: gcc/testsuite/gfortran.dg/pr20755.f
===
--- gcc/testsuite/gfortran.dg/pr20755.f	(revision 174320)
+++ gcc/testsuite/gfortran.dg/pr20755.f	(working copy)
@@ -5,8 +5,8 @@
   character*30 s
   
   write (s,2000) 0.0, 0.02
-  if (s .ne. "0.00   2.000E-02") call abort
+  if (s .ne. "0.00   0.200E-01") call abort
   write (s,2000) 0.01, 0.02
-  if (s .ne. "   1.000E-02   2.000E-02") call abort
+  if (s .ne. "   0.100E-01   0.200E-01") call abort
  2000 format (1PG12.3,G12.3)
   end
Index: gcc/testsuite/gfortran.dg/char4_iunit_1.f03
===
--- gcc/testsuite/gfortran.dg/char4_iunit_1.f03	(revision 174320)
+++ gcc/testsuite/gfortran.dg/char4_iunit_1.f03	(working copy)
@@ -24,7 +24,7 @@ program char4_iunit_1
   write(string, *) .true., .false. , .true.
   if (string .ne. 4_" T F T") call abort
   write(string, *) 1.2345e-06, 4.2846e+10_8
-  if (string .ne. 4_"   1.23450002E-06   4284600.00  ") call abort
+  if (string .ne. 4_"  1.234500019E-06   4284600.00  ") call abort
   write(string, *) nan, inf
   if (string .ne. 4_"  NaN Infinity") call abort
   write(string, '(10x,f3.1,3x,f9.1)') nan, inf
Index: gcc/testsuite/gfortran.dg/fmt_g0_6.f08
===
--- gcc/testsuite/gfortran.dg/fmt_g0_6.f08	(revision 174320)
+++ gcc/testsuite/gfortran.dg/fmt_g0_6.f08	(working copy)
@@ -57,7 +57,7 @@ contains
 do dec = d, 0, -1
 lower = 10.0_RT ** (d - 1 - dec) - r * 10.0_RT ** (- dec - 1)
 upper = 10.0_RT ** (d - dec) - r * 10.0_RT ** (- dec)
-if (lower <= mag .and. mag < upper) then
+if (lower < mag .and. mag <= upper) then
 write(fmt_f, "('R', a, ',F', i0, '.', i0, ',', i0, 'X')") roundmode, w - n, dec, n
 exit
 end if
Index: libgfortran/io/write.c
===
--- libgfortran/io/write.c	(revision 174320)
+++ libgfortran/io/write.c	(working copy)
@@ -1155,35 +1155,35 @@ write_z (st_parameter_dt *dtp, const fnode *f, con
 void
 write_d (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
 {
-  write_float (dtp, f, p, len, 0);
+  write_float (dtp, f, p, len);
 }
 
 
 void
 write_e (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
 {
-  write_float (dtp, f, p, len, 0);
+  write_float (dtp, f, p, len);
 }
 
 
 void
 write_f (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
 {
-  write_float (dtp, f, p, len, 0);
+  write_float (dtp, f, p, len);
 }
 
 
 void
 write_en (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
 {
-  write_float (dtp, f, p, len, 0);
+  write_float (dtp, f, p, len);
 }
 
 
 void
 write_es (st_parameter_dt *dtp, const fnode *f, const char *p, int len)
 {
-  write_float (dtp, f, p, len, 0);
+  write_float (dtp, f, p, len);
 }
 
 
@@ -1476,7 +1476,7 @@ write_real (st_parameter_dt *dtp, const char *sour
   int org_scale = dtp->u.p.scale_factor;
   dtp->u.p.scale_factor = 1;
   set_fnode_default (dtp, &f, length);
-  write_float (dtp, &f, source , length, 1);
+  write_float (dtp, &f, source , length);
   dtp->u.p.scale_factor = org_scale;
 }
 
@@ -1487,19 +1487,11 @@ void
 write_real_g0 (st_parameter_dt *dtp, con

Re: PING: PATCH: PR target/46770: Use .init_array/.fini_array sections

2011-06-03 Thread H.J. Lu
On Fri, Jun 3, 2011 at 5:31 AM, Richard Guenther
 wrote:
> On Fri, Jun 3, 2011 at 6:31 AM, H.J. Lu  wrote:
>> On Wed, May 18, 2011 at 8:57 AM, H.J. Lu  wrote:
>>> On Tue, Apr 26, 2011 at 6:05 AM, H.J. Lu  wrote:
 On Thu, Mar 31, 2011 at 7:57 AM, H.J. Lu  wrote:
> On Mon, Mar 21, 2011 at 11:40 AM, H.J. Lu  wrote:
>> On Mon, Mar 14, 2011 at 12:28 PM, H.J. Lu  wrote:
>>> On Thu, Jan 27, 2011 at 2:40 AM, Richard Guenther
>>>  wrote:
 On Thu, Jan 27, 2011 at 12:12 AM, H.J. Lu  wrote:
> On Tue, Dec 14, 2010 at 05:20:48PM -0800, H.J. Lu wrote:
>> This patch uses .init_array/.fini_array sections instead of
>> .ctors/.dtors sections if mixing .init_array/.fini_array and
>> .ctors/.dtors sections with init_priority works.
>>
>> It removes .ctors/.ctors sections from executables and DSOes, which 
>> will
>> remove one function call at startup time from each executable and 
>> DSO.
>> It should reduce image size and improve system startup time.
>>
>> If a platform with a working .init_array/.fini_array support needs a
>> different .init_array/.fini_array implementation, it can set
>> use_initfini_array to no.
>>
>> Since .init_array/.fini_array is a target feature. 
>> --enable-initfini-array
>> is default to no unless the native run-time test is passed.
>>
>> To pass the native run-time test, a linker with SORT_BY_INIT_PRIORITY
>> support is required.  The binutils patch is available at
>>
>> http://sourceware.org/ml/binutils/2010-12/msg00466.html
>
> Linker patch has been checked in.
>
>>
>> This patch passed 32bit/64bit regression test on Linux/x86-64.  Any
>> comments?
>>
>
> This updated patch fixes build on Linux/ia64 and should work on 
> others.
> Any comments?

 Yes.  This is stage1 material.

>>>
>>> Here is the updated patch.  OK for trunk?
>>>
>>> Thanks.
>>>
>>>
>>> --
>>> H.J.
>>> 
>>> 2011-03-14  H.J. Lu  
>>>
>>>        PR target/46770
>>>        * acinclude.m4 (gcc_AC_INITFINI_ARRAY): Removed.
>>>
>>>        * config.gcc (use_initfini_array): New variable.
>>>        Use initfini-array.o if supported.
>>>
>>>        * crtstuff.c: Don't generate .ctors nor .dtors sections if
>>>        NO_CTORS_DTORS_SECTIONS is defined.
>>>
>>>        * configure.ac: Remove gcc_AC_INITFINI_ARRAY.  Add
>>>        --enable-initfini-array and check if .init_array can be used with
>>>        .ctors.
>>>
>>>        * configure: Regenerated.
>>>
>>>        * config/initfini-array.c: New.
>>>        * config/initfini-array.h: Likewise.
>>>        * config/t-initfini-array: Likewise.
>>>
>>>        * config/arm/arm.c (arm_asm_init_sections): Call
>>>        elf_initfini_array_init_sections if NO_CTORS_DTORS_SECTIONS
>>>        is defined.
>>>        * config/avr/avr.c (avr_asm_init_sections): Likewise.
>>>        * config/ia64/ia64.c (ia64_asm_init_sections): Likewise.
>>>        * config/mep/mep.c (mep_asm_init_sections): Likewise.
>>>        * config/microblaze/microblaze.c 
>>> (microblaze_elf_asm_init_sections):
>>>        Likewise.
>>>        * config/rs6000/rs6000.c (rs6000_elf_asm_init_sections): 
>>> Likewise.
>>>        * config/stormy16/stormy16.c (xstormy16_asm_init_sections):
>>>        Likewise.
>>>        * config/v850/v850.c (v850_asm_init_sections): Likewise.
>>>
>>
>> PING:
>>
>> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00760.html
>>
>
> Any comments?  Any objections?
>

 Here is the patch updated for the current trunk.  OK for trunk?

>>>
>>> PING,.
>>
>> Hi Richard,
>>
>> You commented my patch was stage 1 material:
>>
>> http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01989.html
>>
>> Is my patch:
>>
>> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00760.html
>>
>> OK for trunk?
>
> I can't approve the configury changes and would like to defer
> to target maintainers for the target specific changes.  That said,
> I'm not familiar enough with the area of the patch.  But yes,
> it's stage1 now - so if anyone else wants to approve this patch...

My first attempt:

http://gcc.gnu.org/ml/gcc-patches/2010-12/msg00589.html

only affects x86.  I changed it to generic based on the
feedbacks.  But other target maintainers show no interests.
Should I make it x86 only first?  Each target can enable it
if needed.

Thanks.

-- 
H.J.


[PATCH] Fix fold_stmt ICE (PR c++/49264)

2011-06-03 Thread Jakub Jelinek
Hi!

If memcpy is folded into an assignment, that assignment can be for C++
folded into nothing (if it is copying of 1 byte from or to empty C++ class).
gimple-fold.c was changed to handle that case in some spots, but not all,
particularly if that memcpy is the last stmt in a basic block (which can
happen e.g. during inlining), gsi_stmt (*gsi) in fold_stmt_1 will ICE.
The gimple-fold.c hunks fix this (and also make sure that even when it
isn't the last stmt in a bb, we won't try to fold lhs of next stmt
if it folded/gimplified into nothing).  With that fix the testcase ICEs
shortly afterwards, the tree-inline.c hunk is supposed to fix that.
I'd use cgraph_remove_edge there, but I'd have to handle all clones too,
so I'm calling cgraph_update_edges_for_call_stmt with a dummy stmt
instead (perhaps NULL could be used instead with adjustment of the
cgraph_update_edges_for_call_stmt{,_node} routines?).
The cgraph.c change is just in case the edge isn't there, we'd do useless
work and crash while doing that.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/4.6?

2011-06-03  Jakub Jelinek  

PR c++/49264
* gimple-fold.c (fold_stmt_1): Don't try to fold *& on the lhs
if stmt folded into nothing.
* tree-inline.c (fold_marked_statements): If a builtin at the
end of a bb folded into nothing, just update cgraph edges
and move to next bb.
* cgraph.c (cgraph_update_edges_for_call_stmt_node): Don't compute
count and frequency if new_call is NULL.

* g++.dg/opt/pr49264.C: New test.

--- gcc/gimple-fold.c.jj2011-05-24 23:34:28.0 +0200
+++ gcc/gimple-fold.c   2011-06-03 09:13:34.0 +0200
@@ -1577,6 +1577,11 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, 
   bool changed = false;
   gimple stmt = gsi_stmt (*gsi);
   unsigned i;
+  gimple_stmt_iterator gsinext = *gsi;
+  gimple next_stmt;
+
+  gsi_next (&gsinext);
+  next_stmt = gsi_end_p (gsinext) ? NULL : gsi_stmt (gsinext);
 
   /* Fold the main computation performed by the statement.  */
   switch (gimple_code (stmt))
@@ -1665,10 +1670,19 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, 
 default:;
 }
 
+  /* If stmt folds into nothing and it was the last stmt in a bb,
+ don't call gsi_stmt.  */
+  if (gsi_end_p (*gsi))
+{
+  gcc_assert (next_stmt == NULL);
+  return changed;
+}
+
   stmt = gsi_stmt (*gsi);
 
-  /* Fold *& on the lhs.  */
-  if (gimple_has_lhs (stmt))
+  /* Fold *& on the lhs.  Don't do this if stmt folded into nothing,
+ as we'd changing the next stmt.  */
+  if (gimple_has_lhs (stmt) && stmt != next_stmt)
 {
   tree lhs = gimple_get_lhs (stmt);
   if (lhs && REFERENCE_CLASS_P (lhs))
--- gcc/tree-inline.c.jj2011-06-02 10:15:20.0 +0200
+++ gcc/tree-inline.c   2011-06-03 09:29:15.0 +0200
@@ -4108,6 +4108,14 @@ fold_marked_statements (int first, struc
  if (fold_stmt (&gsi))
{
  gimple new_stmt;
+ /* If a builtin at the end of a bb folded into nothing,
+the following loop won't work.  */
+ if (gsi_end_p (gsi))
+   {
+ cgraph_update_edges_for_call_stmt (old_stmt, old_decl,
+gimple_build_nop 
());
+ break;
+   }
  if (gsi_end_p (i2))
i2 = gsi_start_bb (BASIC_BLOCK (first));
  else
--- gcc/cgraph.c.jj 2011-05-11 19:39:03.0 +0200
+++ gcc/cgraph.c2011-06-03 09:40:02.0 +0200
@@ -1277,7 +1277,7 @@ cgraph_update_edges_for_call_stmt_node (
  frequency = e->frequency;
  cgraph_remove_edge (e);
}
-  else
+  else if (new_call)
{
  /* We are seeing new direct call; compute profile info based on BB.  
*/
  basic_block bb = gimple_bb (new_stmt);
--- gcc/testsuite/g++.dg/opt/pr49264.C.jj   2011-06-03 09:35:50.0 
+0200
+++ gcc/testsuite/g++.dg/opt/pr49264.C  2011-06-03 08:50:33.0 +0200
@@ -0,0 +1,19 @@
+// PR c++/49264
+// { dg-do compile }
+// { dg-options "-O2" }
+
+struct B { };
+struct A { char a[sizeof (B) + 1]; } a;
+
+static inline void
+foo (const B &b)
+{
+  __builtin_memcpy (&a, &b, sizeof (b));
+}
+
+void
+bar ()
+{
+  B c;
+  foo (c);
+}

Jakub


[PATCH] Only run pr48377.c testcase on i?86/x86_64

2011-06-03 Thread Jakub Jelinek
Hi!

This limits this testcase to i?86/x86_64 (moving to gcc.target/ would
be harder because it relies on all the weirdo vectorization options to be
passed), because apparently on strict alignment targets we don't handle
aligned (1) non-aggregates correctly.  Or should it be instead xfailed
just on selected strict-aligned targets?

2011-06-03  Jakub Jelinek  

PR tree-optimization/48377
* gcc.dg/vect/pr48377.c: Only run the test to i?86/x86_64.

--- gcc/testsuite/gcc.dg/vect/pr48377.c.jj  2011-05-02 18:39:10.0 
+0200
+++ gcc/testsuite/gcc.dg/vect/pr48377.c 2011-06-03 13:19:53.0 +0200
@@ -1,4 +1,5 @@
 /* PR tree-optimization/48377 */
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
 
 typedef unsigned int U __attribute__((__aligned__ (1), __may_alias__));
 

Jakub


[wwwdocs] Document new pth-icm branch

2011-06-03 Thread Diego Novillo
Since we are not sure whether pre-tokenized headers are worth
adding at all (the performance gains are minimal), Gabriel has
started removing that code and the parser instrumentation code we
had in the pph branch.

This will simplify branch maintenance wrt merges, but we are
still not sure whether we will do anything with PTH.  So, I have
created a sub-branch (pth-icm) to hold that code for now.

This patch adds documentation for it.

Committed to wwwdocs.


Diego.

Index: svn.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/svn.html,v
retrieving revision 1.161
diff -u -d -u -p -r1.161 svn.html
--- svn.html27 Apr 2011 14:51:51 -  1.161
+++ svn.html3 Jun 2011 13:58:10 -
@@ -495,6 +495,18 @@ the command svn log --stop-on-copy
   href="mailto:cr...@google.com";>Lawrence Crowl.  Patches should be
   prefixed with [pph] in the subject line.
 
+  pth-icm
+  This is a sub-branch of the pph branch.  It
+  implements
+  http://gcc.gnu.org/wiki/pph#Pre-Tokenized_Headers_.28PTH.29";>
+  Pre-Tokenized Headers for C++.  Additionally, it contains
+  instrumentation code in the C++ parser that was used in an
+  incremental compiler model (icm) to study the effects of an
+  incremental compiler cache for a compiler server. The branch is
+  maintained by mailto:dnovi...@google.com";>Diego Novillo
+  and mailto:cr...@google.com";>Lawrence Crowl.  Patches
+  should be prefixed with [pph] in the subject line.
+
 
 
 Distribution Branches


Re: [PR debug/47590] rework md option overriding to delay var-tracking

2011-06-03 Thread Alexandre Oliva
On Jun  2, 2011, Alexandre Oliva  wrote:

> Right you are, though it looks like leaving the @hook lines out makes no
> difference.  Anyhow, here's the patch I'm checking in.

Trunk is now fixed, is the patch ok for the 4.6 branch too?

> for  gcc/ChangeLog
> from  Alexandre Oliva  

>   PR debug/47590
>   * target.def (delay_sched2, delay_vartrack): New.
>   * doc/tm.texi.in: Update.
>   * doc/tm.texi: Rebuild.
>   * sched-rgn.c (gate_handle_sched2): Fail if delay_sched2.
>   * var-tracking.c (gate_handle_var_tracking): Likewise.
>   * config/bfin/bfin.c (bfin_flag_schedule_insns2): Drop.
>   (bfin_flag_var_tracking): Drop.
>   (output_file_start): Don't save and override flag_var_tracking.
>   (bfin_option_override): Ditto flag_schedule_insns_after_reload.
>   (bfin_reorg): Test original variables.
>   (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define.
>   * config/ia64/ia64.c (ia64_flag_schedule_insns2): Drop.
>   (ia64_flag_var_tracking): Drop.
>   (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define.
>   (ia64_file_start): Don't save and override flag_var_tracking.
>   (ia64_override_options_after_change): Ditto
>   flag_schedule_insns_after_reload.
>   (ia64_reorg): Test original variables.
>   * config/picochip/picochip.c (picochip_flag_schedule_insns2): Drop.
>   (picochip_flag_var_tracking): Drop.
>   (TARGET_DELAY_SCHED2, TARGET_DELAY_VARTRACK): Define.
>   (picochip_option_override): Don't save and override
>   flag_schedule_insns_after_reload.
>   (picochip_asm_file_start): Ditto flag_var_tracking.
>   (picochip_reorg): Test original variables.
>   * config/spu/spu.c (spu_flag_var_tracking): Drop.
>   (TARGET_DELAY_VARTRACK): Define.
>   (spu_var_tracking): New.
>   (spu_machine_dependent_reorg): Call it.
>   (asm_file_start): Don't save and override flag_var_tracking.


-- 
Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist  Red Hat Brazil Compiler Engineer


don't dump decl_uid with TDF_NOUID

2011-06-03 Thread Alexandre Oliva
A recent change introduced decl_uid in the “;; Function ” header in dump
files.  This breaks -fcompare-debug (and bootstrap-debug-lean), because
decl uids aren't kept in sync between -g and non-g compilations.

This patch rearranges the header so that decl_uid is omitted when
dumping with NOUID, and it prints the header for the -fcompare-debug
final dump with NOUID.

Regstrapped on x86_64-linux-gnu and i686-linux-gnu.  Ok?

for  gcc/ChangeLog
from  Alexandre Oliva  

	* tree-pretty-print.c (dump_function_header): Add flags.
	Don't dump decl_uid with nouid.
	* tree-pretty-print.h (dump_function_header): Adjust.
	* final.c (rest_of_clean_state): Pass dump_flags on, with nouid.
	* passes.c (pass_init_dump_file): Pass dump_flags on.
	* tree-cfg.c (gimple_dump_cfg): Pass flags on.

Index: gcc/tree-pretty-print.c
===
--- gcc/tree-pretty-print.c.orig	2011-06-03 00:11:42.155149610 -0300
+++ gcc/tree-pretty-print.c	2011-06-03 00:23:42.369499744 -0300
@@ -3018,7 +3018,7 @@ pp_base_tree_identifier (pretty_printer 
function dump.  */
 
 void
-dump_function_header (FILE *dump_file, tree fdecl)
+dump_function_header (FILE *dump_file, tree fdecl, int flags)
 {
   const char *dname, *aname;
   struct cgraph_node *node = cgraph_get_node (fdecl);
@@ -3032,11 +3032,13 @@ dump_function_header (FILE *dump_file, t
   else
 aname = "";
 
+  fprintf (dump_file, "\n;; Function %s (%s, funcdef_no=%d",
+	   dname, aname, fun->funcdef_no);
+  if (!(flags & TDF_NOUID))
+fprintf (dump_file, ", decl_uid=%d", DECL_UID (fdecl));
   if (node)
 {
-  fprintf (dump_file, "\n;; Function %s (%s, funcdef_no=%d, decl_uid=%d, cgraph_uid=%d)",
-   dname, aname, fun->funcdef_no, DECL_UID(fdecl), node->uid);
-  fprintf (dump_file, "%s\n\n",
+  fprintf (dump_file, ", cgraph_uid=%d)%s\n\n", node->uid,
node->frequency == NODE_FREQUENCY_HOT
? " (hot)"
: node->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED
@@ -3046,6 +3048,5 @@ dump_function_header (FILE *dump_file, t
: "");
 }
   else
-fprintf (dump_file, "\n;; Function %s (%s, funcdef_no=%d, decl_uid = %d)",
- dname, aname, fun->funcdef_no, DECL_UID(fdecl));
+fprintf (dump_file, ")\n\n");
 }
Index: gcc/tree-pretty-print.h
===
--- gcc/tree-pretty-print.h.orig	2011-06-03 00:23:22.350625260 -0300
+++ gcc/tree-pretty-print.h	2011-06-03 00:26:25.826492765 -0300
@@ -50,7 +50,7 @@ extern void debug_generic_expr (tree);
 extern void debug_generic_stmt (tree);
 extern void debug_tree_chain (tree);
 extern void percent_K_format (text_info *);
-extern void dump_function_header (FILE *, tree);
+extern void dump_function_header (FILE *, tree, int);
 
 /* In toplev.c  */
 extern bool default_tree_printer (pretty_printer *, text_info *, const char *,
Index: gcc/final.c
===
--- gcc/final.c.orig	2011-06-03 00:23:22.615623595 -0300
+++ gcc/final.c	2011-06-03 00:23:33.156557448 -0300
@@ -4361,10 +4361,11 @@ rest_of_clean_state (void)
 	}
   else
 	{
-	  dump_function_header (final_output, current_function_decl);
 	  flag_dump_noaddr = flag_dump_unnumbered = 1;
 	  if (flag_compare_debug_opt || flag_compare_debug)
 	dump_flags |= TDF_NOUID;
+	  dump_function_header (final_output, current_function_decl,
+dump_flags);
 	  final_insns_dump_p = true;
 
 	  for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
Index: gcc/passes.c
===
--- gcc/passes.c.orig	2011-06-03 00:23:22.875621962 -0300
+++ gcc/passes.c	2011-06-03 00:52:59.536068338 -0300
@@ -1638,7 +1638,7 @@ pass_init_dump_file (struct opt_pass *pa
   dump_file_name = get_dump_file_name (pass->static_pass_number);
   dump_file = dump_begin (pass->static_pass_number, &dump_flags);
   if (dump_file && current_function_decl)
-dump_function_header (dump_file, current_function_decl);
+dump_function_header (dump_file, current_function_decl, dump_flags);
   return initializing_dump;
 }
   else
Index: gcc/tree-cfg.c
===
--- gcc/tree-cfg.c.orig	2011-06-03 00:23:23.161620166 -0300
+++ gcc/tree-cfg.c	2011-06-03 00:57:20.777549758 -0300
@@ -2052,7 +2052,7 @@ gimple_dump_cfg (FILE *file, int flags)
 {
   if (flags & TDF_DETAILS)
 {
-  dump_function_header (file, current_function_decl);
+  dump_function_header (file, current_function_decl, flags);
   fprintf (file, ";; \n%d basic blocks, %d edges, last basic block %d.\n\n",
 	   n_basic_blocks, n_edges, last_basic_block);
 


-- 
Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Softwar

Re: __sync_swap* with acq/rel/full memory barrier semantics

2011-06-03 Thread Richard Henderson
On 06/02/2011 02:52 PM, Aldy Hernandez wrote:
> On 06/02/11 14:25, Jakub Jelinek wrote:
> 
>>> +case MEMMODEL_SEQ_CST:
>>> +  op = sync_mem_exchange_seq_cst_optab;
>>> +  break;
>>> +case MEMMODEL_ACQUIRE:
>>> +  op = sync_mem_exchange_acq_optab;
>>> +  break;
>>> +case MEMMODEL_RELEASE:
>>> +  op = sync_mem_exchange_rel_optab;
>>> +  break;
>>> +case MEMMODEL_ACQ_REL:
>>> +  op = sync_mem_exchange_acq_rel_optab;
>>> +  break;
>>
>> Wouldn't it be better to pass the model (as an extra CONST_INT
>> operand) to the expanders?  Targets where atomic instructions always act
>> as full barriers could just ignore that argument, other could decide what
>> to do based on the value.
> 
> *shrug* I don't care.  Whatever everyone agrees on.

Let's do that.  Many of the targets will be expanding these to
a somewhat longer sequence at some stage, and they'll all be
95% identical.  The extra operand ought to make for less
boiler-plate code.


r~


Re: [PATCH] Fix ICE in expand_cse_reciprocals (PR tree-optimization/42078)

2011-06-03 Thread Alexandre Oliva
According to http://gcc.gnu.org/ml/gcc-patches/2009-11/msg01082.html
on Nov 20, 2009, Alexandre Oliva  wrote:

> On Nov 19, 2009, Richard Guenther  wrote:
>> In fact this exchanging of the LHS (or rather invalidating of the
>> SSA name value) should be a helper function that knows
>> the implementation details and avoids going through releasing
>> and allocating the name.

> Okie dokie, here's a sequence of patches that implements helper
> functions for this sort of stuff.

> The first patch introduces machinery to propagate “dying” DEFs into
> debug stmts, while replacing them with other SSA_NAMEs.

This is already in.

> The second extends it so as to enable the old LHS to be redefined
> e.g. in terms of the new LHS.  IIRC this may be useful in some other
> transformations that, in the process of introducing VTA, I changed from
> modifying stmts in place to inserting new stmts and removing others.  I
> haven't looked for them yet.

> The third uses this new feature for the case at hand, while avoiding
> computing the reciprocal expression if we know it won't be used.

Updated versions of these follow.  Regstrapped on x86_64-linux-gnu and
i686-linux-gnu.  Ok to install?

for  gcc/ChangeLog
from  Alexandre Oliva  

	PR tree-optimization/42078
	* gimple.h (gimple_replace_lhs_wants_value): New.
	(gimple_replace_lhs): Add value.
	* gimple.c (gimple_replace_lhs): Likewise.  Pass it on.
	* tree-flow.h (insert_debug_temp_for_var_def): Add value.
	* tree-ssa.c (insert_debug_temp_for_var_def): Likewise.  Use it.
	(insert_debug_temps_for_defs): Pass NULL value.
	* tree-ssanames.c (release_ssa_name): Likewise.
	* tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise.
	* gcc/tree-ssa-reassoc.c (repropagate_negates): Likewise.

Index: gcc/gimple.h
===
--- gcc/gimple.h.orig	2011-06-02 23:26:12.564872257 -0300
+++ gcc/gimple.h	2011-06-03 01:28:09.413126700 -0300
@@ -886,7 +886,7 @@ void gimple_assign_set_rhs_with_ops_1 (g
    tree, tree, tree);
 tree gimple_get_lhs (const_gimple);
 void gimple_set_lhs (gimple, tree);
-void gimple_replace_lhs (gimple, tree);
+void gimple_replace_lhs (gimple, tree, tree);
 gimple gimple_copy (gimple);
 void gimple_set_modified (gimple, bool);
 void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *, tree *);
@@ -2451,6 +2451,14 @@ gimple_has_lhs (gimple stmt)
 	  && gimple_call_lhs (stmt) != NULL_TREE));
 }
 
+/* Return true if it might be useful to pass a VALUE to
+   gimple_replace_lhs ().  */
+static inline bool
+gimple_replace_lhs_wants_value (void)
+{
+  return MAY_HAVE_DEBUG_STMTS;
+}
+
 
 /* Return the code of the predicate computed by conditional statement GS.  */
 
Index: gcc/gimple.c
===
--- gcc/gimple.c.orig	2011-06-02 23:26:12.562872251 -0300
+++ gcc/gimple.c	2011-06-03 01:28:09.534126597 -0300
@@ -2133,10 +2133,10 @@ gimple_set_lhs (gimple stmt, tree lhs)
expression with a different value.
 
This will update any annotations (say debug bind stmts) referring
-   to the original LHS, so that they use the RHS instead.  This is
-   done even if NLHS and LHS are the same, for it is understood that
-   the RHS will be modified afterwards, and NLHS will not be assigned
-   an equivalent value.
+   to the original LHS, so that they use VALUE or the RHS instead.
+   This is done even if NLHS and LHS are the same, for it is
+   understood that the RHS will be modified afterwards, and NLHS will
+   not be assigned an equivalent value.
 
Adjusting any non-annotation uses of the LHS, if needed, is a
responsibility of the caller.
@@ -2148,15 +2148,20 @@ gimple_set_lhs (gimple stmt, tree lhs)
copying and removing.  */
 
 void
-gimple_replace_lhs (gimple stmt, tree nlhs)
+gimple_replace_lhs (gimple stmt, tree nlhs, tree value)
 {
+  /* If the conditions in which this function uses VALUE change,
+ adjust gimple_replace_lhs_wants_value().  */
+  gcc_assert (gimple_replace_lhs_wants_value ()
+	  == MAY_HAVE_DEBUG_STMTS);
+
   if (MAY_HAVE_DEBUG_STMTS)
 {
   tree lhs = gimple_get_lhs (stmt);
 
   gcc_assert (SSA_NAME_DEF_STMT (lhs) == stmt);
 
-  insert_debug_temp_for_var_def (NULL, lhs);
+  insert_debug_temp_for_var_def (NULL, lhs, value);
 }
 
   gimple_set_lhs (stmt, nlhs);
Index: gcc/tree-flow.h
===
--- gcc/tree-flow.h.orig	2011-06-02 23:26:53.941986549 -0300
+++ gcc/tree-flow.h	2011-06-03 01:28:55.486087124 -0300
@@ -553,7 +553,7 @@ typedef bool (*walk_use_def_chains_fn) (
 extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool);
 
 void insert_debug_temps_for_defs (gimple_stmt_iterator *);
-void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree);
+void insert_debug_temp_for_var_def (gimple_stmt_iterator *, tree, tree);
 void reset_debug_uses (gimple);
 void release_defs_bitset (bitmap toremove);

Re: [build] Move MD_UNWIND_SUPPORT to toplevel libgcc

2011-06-03 Thread Rainer Orth
Paolo Bonzini  writes:

> On 05/30/2011 05:43 PM, Rainer Orth wrote:
>> +md-unwind-support.h: config.status
>> +if test -n "$(md_unwind_header)"; then \
>> +  echo "#include \"config/$(md_unwind_header)\"">  $@; \
>> +else \
>> +  :>  $@; \
>> +fi
>
> Can you add a default file md-unwind-none.h and use
>
> AC_CONFIG_LINKS([md-unwind-support.h:$md_unwind_header])
>
> instead of this (and instead of AC_SUBST'ing the variable)?

Sure, done in the revised patch below.

>> -libgcc-eh-objects += $(addsuffix $(objext),$(basename $(notdir 
>> $(LIB2ADDEHSTATIC
>> -libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir 
>> $(LIB2ADDEHSHARED
>> +libgcc-eh-static-objects := $(addsuffix $(objext),$(basename $(notdir 
>> $(LIB2ADDEHSTATIC
>> +libgcc-eh-shared-objects := $(addsuffix _s$(objext),$(basename $(notdir 
>> $(LIB2ADDEHSHARED
>> +
>> +$(libgcc-eh-static-objects) $(libgcc-eh-shared-objects): md-unwind-support.h
>> +
>> +libgcc-eh-objects += $(libgcc-eh-static-objects)
>> +libgcc-s-objects += $(libgcc-eh-shared-objects)
>
> These changes to the dependencies should not be necessary, libgcc does
> automatic dependency tracking.

I suppose it was necessary before when md-unwind-support.h didn't exist
at build time, so dependency generation failed  With the new scheme
using AC_CONFIG_LINKS, they are indeed unnecessary.

> Also a good start, though.  Thanks for this work.

Apart from those changes, the patch addresses the PowerPC Darwin and
Windows32 issues as suggested:

* rs6000/darwin-unwind.h is wrapped in !__LP64__, while removing the
  need for the !DARWIN_LIBSYSTEM_HAS_UNWIND test (only defined on Darwin
  9 and up) by using the file only for PowerPC Darwin < 9.

* i386/w32-unwind.h is wrapped in !__MINGW64__.

Bootstrapped without regressions on i386-pc-solaris2.11.

Ok for mainline?

Thanks.
Rainer


2011-05-29  Rainer Orth  

gcc:
* config/alpha/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/alpha/osf5.h (MD_UNWIND_SUPPORT): Remove.
* config/alpha/vms.h (MD_UNWIND_SUPPORT): Remove.
* config/bfin/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/bfin/uclinux.h (MD_UNWIND_SUPPORT): Remove.
* config/i386/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/i386/linux64.h (MD_UNWIND_SUPPORT): Remove.
* config/i386/sol2.h (MD_UNWIND_SUPPORT): Remove.
* config/i386/mingw32.h (MD_UNWIND_SUPPORT): Remove.
* config/ia64/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/ia64/vms.h (MD_UNWIND_SUPPORT): Remove.
* config/m68k/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/mips/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/pa/pa-hpux.h (MD_UNWIND_SUPPORT): Remove.
* config/pa/pa32-linux.h (MD_UNWIND_SUPPORT): Remove.
* config/rs6000/darwin.h (MD_UNWIND_SUPPORT): Remove.
* config/rs6000/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/rs6000/linux64.h (MD_UNWIND_SUPPORT): Remove.
* config/s390/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/s390/tpf.h (MD_UNWIND_SUPPORT): Remove.
* config/sh/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/sparc/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/sparc/linux64.h (MD_UNWIND_SUPPORT): Remove.
* config/sparc/sol2.h (MD_UNWIND_SUPPORT): Remove.
* config/xtensa/linux.h (MD_UNWIND_SUPPORT): Remove.
* config/alpha/linux-unwind.h: Move to ../libgcc/config/alpha.
* config/alpha/osf5-unwind.h: Move to ../libgcc/config/alpha.
* config/alpha/vms-unwind.h: Move to ../libgcc/config/alpha.
* config/bfin/linux-unwind.h: Move to ../libgcc/config/bfin.
* config/i386/linux-unwind.h: Move to ../libgcc/config/i386.
* config/i386/sol2-unwind.h: Move to ../libgcc/config/i386.
* config/i386/w32-unwind.h: Move to ../libgcc/config/i386.
* config/ia64/linux-unwind.h: Move to ../libgcc/config/ia64.
* config/ia64/vms-unwind.h: Move to ../libgcc/config/ia64.
* config/m68k/linux-unwind.h: Move to ../libgcc/config/m68k.
* config/mips/linux-unwind.h: Move to ../libgcc/config/mips.
* config/pa/hpux-unwind.h: Move to ../libgcc/config/pa.
* config/pa/linux-unwind.h: Move to ../libgcc/config/pa.
* config/rs6000/darwin-unwind.h: Move to ../libgcc/config/rs6000.
* config/rs6000/linux-unwind.h: Move to ../libgcc/config/rs6000.
* config/s390/linux-unwind.h: Move to ../libgcc/config/s390.
* config/s390/tpf-unwind.h: Move to ../libgcc/config/s390.
* config/sh/linux-unwind.h: Move to ../libgcc/config/sh.
* config/sparc/linux-unwind.h: Move to ../libgcc/config/sparc.
* config/sparc/sol2-unwind.h: Move to ../libgcc/config/sparc.
* config/xtensa/linux-unwind.h: Move to ../libgcc/config/xtensa.
* config/darwin9.h (DARWIN_LIBSYSTEM_HAS_UNWIND): Remove.
* system.h (MD_UNWIND_SUPPORT): Poison.
* doc/tm.texi.

Re: [vta, graphite?] propagate degenerate phi nodes into debug stmts

2011-06-03 Thread Alexandre Oliva
According to http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00999.html
on Nov 19, 2009, Richard Guenther  wrote:

> On Thu, Nov 19, 2009 at 4:05 AM, Alexandre Oliva  wrote:
>> On Nov 17, 2009, Richard Guenther  wrote:
>> 
> This looks odd.  SSA DEF operand iteration should walk the PHI defs
> as well, so the change should not be necessary.
>> 
 I thought so, too, but by the time we get there, the operands of the PHI
 stmt have already been disconnected.
>> 
>>> It shouldn't be.  Please try to figure out why instead.
>> 
>> Gotta use a different FOR_EACH macro to handle PHI nodes.
>> 
>> s/FOR_EACH_SSA_DEF_OPERAND/FOR_EACH_PHI_OR_STMT_DEF/ fixed it.
>> 
>> In order to make sure no other such mistakes had been made in GCC, I
>> added an assertion check in the iterator initializer and adjusted the
>> uses of GIMPLE_PHI nodes that triggered the assertion, but that would
>> have done nothing whatsoever in its absence.  I haven't looked into
>> whether doing nothing is correct.
>> 
>> Should I check this in?

> I think we should rather let num_ssa_operands and delink_stmt_imm_use
> ICE on PHIs, but I'd rather do this in stage1 - can you queue this
> patch until then?

You meant 4.6 stage1, but I missed it.  How's it for 4.7 stage1?
Regstrapped on x86_64-linux-gnu and i686-linux-gnu.

for  gcc/ChangeLog
from  Alexandre Oliva  

	* tree-flow-inline.h (op_iter_init): Reject GIMPLE_PHI stmts.
	(num_ssa_operands): Skip GIMPLE_PHI.
	(delink_stmt_imm_use): Likewise.

Index: gcc/tree-flow-inline.h
===
--- gcc/tree-flow-inline.h.orig	2010-06-10 07:20:02.0 -0300
+++ gcc/tree-flow-inline.h	2010-06-10 15:17:51.0 -0300
@@ -716,9 +716,11 @@ clear_and_done_ssa_iter (ssa_op_iter *pt
 static inline void
 op_iter_init (ssa_op_iter *ptr, gimple stmt, int flags)
 {
-  /* We do not support iterating over virtual defs or uses without
+  /* PHI nodes require a different iterator initialization path.  We
+ do not support iterating over virtual defs or uses without
  iterating over defs or uses at the same time.  */
-  gcc_checking_assert ((!(flags & SSA_OP_VDEF) || (flags & SSA_OP_DEF))
+  gcc_checking_assert (gimple_code (stmt) != GIMPLE_PHI
+		   && (!(flags & SSA_OP_VDEF) || (flags & SSA_OP_DEF))
 		   && (!(flags & SSA_OP_VUSE) || (flags & SSA_OP_USE)));
   ptr->defs = (flags & (SSA_OP_DEF|SSA_OP_VDEF)) ? gimple_def_ops (stmt) : NULL;
   if (!(flags & SSA_OP_VDEF)
@@ -847,8 +849,9 @@ num_ssa_operands (gimple stmt, int flags
   tree t;
   int num = 0;
 
-  FOR_EACH_SSA_TREE_OPERAND (t, stmt, iter, flags)
-num++;
+  if (gimple_code (stmt) != GIMPLE_PHI)
+FOR_EACH_SSA_TREE_OPERAND (t, stmt, iter, flags)
+  num++;
   return num;
 }
 
@@ -860,7 +863,8 @@ delink_stmt_imm_use (gimple stmt)
ssa_op_iter iter;
use_operand_p use_p;
 
-   if (ssa_operands_active ())
+   if (ssa_operands_active ()
+   && gimple_code (stmt) != GIMPLE_PHI)
  FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
delink_imm_use (use_p);
 }


-- 
Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist  Red Hat Brazil Compiler Engineer


Re: [PATCH] LTO and cache-preloading of FE dependent nodes

2011-06-03 Thread H.J. Lu
On Tue, May 31, 2011 at 6:15 AM, Richard Guenther  wrote:
>
> This patch, now that Micha made us less dependent on preloading
> exactly the same from each FE, gets rid of two hacks regarding
> to the frontend (and option) dependent char_type_node and
> boolean_type_node.  It does so by first decoupling canonical type
> registering from cache-preloading and restrict it to lto1, and
> second by exempting nodes from the preloading that are known
> to cause problems because they differ semantically between
> frontends.
>
> Queued for testing (depends on one prerequesite I think which is
> in testing currently).
>
> Diego, this was the patch I had in mind - does this look reasonable
> to you?
>
> In general I'm working towards identifying what global trees are
> initialized solely dependent on target info and which ones are
> really frontend dependent.
>
> Thanks,
> Richard.
>
> 2011-05-31  Richard Guenther  
>
>        * tree.c (free_lang_data): Do not reset boolean_type_node nor
>        char_type_node.
>        * lto-streamer.c (lto_record_common_node): Take node pointer,
>        do not register types.
>        (lto_preload_common_nodes): Explicitly skip preloading nodes
>        that differ between frontends.
>
>        lto/
>        * lto-lang.c (lto_register_canonical_types): New function.
>        (lto_init): Register common nodes with the canonical type machinery.
>        Do not play tricks with char_type_node.
>

This caused:

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


H.J.


[lto] Unify decl and type registration (issue4515186)

2011-06-03 Thread Diego Novillo

As discussed in http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00063.html,
this patch moves decl registration in symbol tables to the LTO front
end.  It makes type and symbol registration happen at the same time in
uniquify_nodes.

Tested with LTO profiledbootstrap on x86_64.  Committed to trunk.


Diego.


2011-06-03  Diego Novillo  

* lto-streamer-in.c (get_resolution): Move to lto/lto.c.
(lto_register_var_decl_in_symtab): Likewise.
(lto_register_function_decl_in_symtab): Likewise.
(lto_read_tree): Move VAR_DECL and FUNCTION_DECL registration
logic to lto_read_decls.

lto/ChangeLog

* lto.c (get_resolution): Move from lto-streamer-in.c.
(lto_register_var_decl_in_symtab): Likewise.
(lto_register_function_decl_in_symtab): Likewise.
(uniquify_nodes): Call lto_register_var_decl and
lto_register_function_decl_in_symtab after reading a new
VAR_DECL or FUNCTION_DECL.

diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index 88966f2..a0c5509 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -1533,31 +1533,6 @@ lto_input_constructors_and_inits (struct 
lto_file_decl_data *file_data,
 }
 
 
-/* Return the resolution for the decl with index INDEX from DATA_IN. */
-
-static enum ld_plugin_symbol_resolution
-get_resolution (struct data_in *data_in, unsigned index)
-{
-  if (data_in->globals_resolution)
-{
-  ld_plugin_symbol_resolution_t ret;
-  /* We can have references to not emitted functions in
-DECL_FUNCTION_PERSONALITY at least.  So we can and have
-to indeed return LDPR_UNKNOWN in some cases.   */
-  if (VEC_length (ld_plugin_symbol_resolution_t,
- data_in->globals_resolution) <= index)
-   return LDPR_UNKNOWN;
-  ret = VEC_index (ld_plugin_symbol_resolution_t,
-  data_in->globals_resolution,
-  index);
-  return ret;
-}
-  else
-/* Delay resolution finding until decl merging.  */
-return LDPR_UNKNOWN;
-}
-
-
 /* Unpack all the non-pointer fields of the TS_BASE structure of
expression EXPR from bitpack BP.  */
 
@@ -2473,117 +2448,6 @@ lto_input_tree_pointers (struct lto_input_block *ib, 
struct data_in *data_in,
 }
 
 
-/* Register DECL with the global symbol table and change its
-   name if necessary to avoid name clashes for static globals across
-   different files.  */
-
-static void
-lto_register_var_decl_in_symtab (struct data_in *data_in, tree decl)
-{
-  tree context;
-
-  /* Variable has file scope, not local. Need to ensure static variables
- between different files don't clash unexpectedly.  */
-  if (!TREE_PUBLIC (decl)
-  && !((context = decl_function_context (decl))
-  && auto_var_in_fn_p (decl, context)))
-{
-  /* ??? We normally pre-mangle names before we serialize them
-out.  Here, in lto1, we do not know the language, and
-thus cannot do the mangling again. Instead, we just
-append a suffix to the mangled name.  The resulting name,
-however, is not a properly-formed mangled name, and will
-confuse any attempt to unmangle it.  */
-  const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
-  char *label;
-
-  ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl));
-  SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label));
-  rest_of_decl_compilation (decl, 1, 0);
-
-  VEC_safe_push (tree, gc, lto_global_var_decls, decl);
-}
-
-  /* If this variable has already been declared, queue the
- declaration for merging.  */
-  if (TREE_PUBLIC (decl))
-{
-  unsigned ix;
-  if (!lto_streamer_cache_lookup (data_in->reader_cache, decl, &ix))
-   gcc_unreachable ();
-  lto_symtab_register_decl (decl, get_resolution (data_in, ix),
-   data_in->file_data);
-}
-}
-
-
-
-/* Register DECL with the global symbol table and change its
-   name if necessary to avoid name clashes for static globals across
-   different files.  DATA_IN contains descriptors and tables for the
-   file being read.  */
-
-static void
-lto_register_function_decl_in_symtab (struct data_in *data_in, tree decl)
-{
-  /* Need to ensure static entities between different files
- don't clash unexpectedly.  */
-  if (!TREE_PUBLIC (decl))
-{
-  /* We must not use the DECL_ASSEMBLER_NAME macro here, as it
-may set the assembler name where it was previously empty.  */
-  tree old_assembler_name = decl->decl_with_vis.assembler_name;
-
-  /* FIXME lto: We normally pre-mangle names before we serialize
-them out.  Here, in lto1, we do not know the language, and
-thus cannot do the mangling again. Instead, we just append a
-suffix to the mangled name.  The resulting name, however, is
-not a properly-formed mangled name, and will confuse any
-attempt to unmangle it.  */
-  const char *name = IDENTIFI

don't force debug insns after their PREV_INSNs

2011-06-03 Thread Alexandre Oliva
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=677681 can be
“fixed” by disabling the artificial dependency of a debug insn on its
previous insn.

Debug insns will often depend on their prevs anyway, in a use/def
relationship, but if the def was (re)moved or the use was reset, this
artificial dep helped keep the debug insn “in place”.

Being a very imperfect heuristic, it's not clear that it helps more than
it harms.  Thoughts?  Regstrapped on x86_64-linux-gnu and
i686-linux-gnu.

for  gcc/ChangeLog
from  Alexandre Oliva  

	* sched-deps.c (sched_analyze_insn): Don't force debug insns
	to follow their original predecessors.

Index: gcc/sched-deps.c
===
--- gcc/sched-deps.c.orig	2011-02-24 09:54:12.016654388 -0300
+++ gcc/sched-deps.c	2011-02-24 09:55:48.456918435 -0300
@@ -2816,7 +2816,7 @@ sched_analyze_insn (struct deps_desc *de
 	 additional analysis can modify the generated code.  */
   prev = PREV_INSN (insn);
-
-  if (prev && NONDEBUG_INSN_P (prev))
-	add_dependence (insn, prev, REG_DEP_ANTI);
 }
   else


-- 
Alexandre Oliva, freedom fighterhttp://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist  Red Hat Brazil Compiler Engineer


[build] Remove LIB2ADDEHDEP

2011-06-03 Thread Rainer Orth
When checking in the Solaris toplevel libgcc patch on wednesday, I
notice that I still had LIB2ADDEH and LIB2ADDEHDEP in gcc/config/t-sol2.

The latter is completely unused now that libgcc does automatic
dependency generation and I had already removed it in
libgcc/config/t-sol2.  This patch removes it completely.

I also noticed that the move of LIB2ADDEH to libgcc should have made the
variable unnecessary in gcc and was about to remove it on checkin
(seemed obvious at the time), but fortunately I didn't because it
completely broke Solaris 11 EH:

libgcc/Makefile.in completely ignores LIB2ADDEH with --enable-shared,
but only looks at LIB2ADDEHSTATIC and LIB2ADDEHSHARED.  Those variables
are only set in libgcc.mvars from gcc/Makefile.in, and if you remove
them from gcc/config, hell breaks loose ;-(  In the Solaris 11 case, we
need unwind-dw2-fde-glibc.c, but miss it because the LIB2ADDEH default
in gcc/Makefile.in doesn't include it.  I also noticed that
libgcc/config/t-sol2 LIB2ADDEH incorrectly refers to $(srcdir), not
$(gcc_srcdir), and omits emutls.c, which is added behind the scenes by
gcc/Makefile.in.  This patch corrects this.

Bootstrapped without regressions on i386-pc-solaris2.11, ok for
mainline?  I suppose this is obvious.

To get rid of this mess, it seems like we should move all EH-related
stuff to libgcc.  There are several things to do:

* We have mainly two variants of LIB2ADDEH, one (the default) with

  unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c unwind-c.c

  the other, which uses dl_iterate_phdr, with

  unwind-dw2.c unwind-dw2-fde-glibc.c unwind-sjlj.c unwind-c.c

  There's considerable duplication here right now, so I'd move them to
  t-eh-dw2 and t-eh-dw2-dip (dip is short for dl_iterate_phdr;
  unwind-dw2-fde-glibc.c is a misnomer here since the function is
  available on non-glibc systems like FreeBSD and Solaris).

  The special cases can still be dealt with in target-specific t-* files
  in libgcc.

* The gcc/unwind* files and gcc/emutls.c can move, too.

* LIB2ADDEH* handling in gcc/Makefile.in must be moved to
  libgcc/Makefile.in instead.

If this seems like a sensible plan, I can start working on that.

Thanks.
Rainer


2011-06-02  Rainer Orth  

gcc:
* Makefile.in (LIB2ADDEHDEP): Remove.
* config/arm/t-bpabi (LIB2ADDEHDEP): Remove.
* config/arm/t-symbian (LIB2ADDEHDEP): Remove.
* config/picochip/t-picochip (LIB2ADDEHDEP): Remove.
* config/t-darwin (LIB2ADDEHDEP): Remove.
* config/t-freebsd (LIB2ADDEHDEP): Remove.
* config/t-linux (LIB2ADDEHDEP): Remove.

libgcc:
* config/s390/t-tpf (LIB2ADDEHDEP): Remove.
* config/t-sol2 (LIB2ADDEH): Use gcc_srcdir, add emutls.c.

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -744,7 +744,6 @@ LIB2ADDEH = $(srcdir)/unwind-dw2.c $(src
$(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
 LIB2ADDEHSTATIC = $(LIB2ADDEH)
 LIB2ADDEHSHARED = $(LIB2ADDEH)
-LIB2ADDEHDEP = $(UNWIND_H) unwind-pe.h unwind.inc unwind-dw2-fde.h unwind-dw2.h
 
 # Don't build libunwind by default.
 LIBUNWIND =
diff --git a/gcc/config/arm/t-bpabi b/gcc/config/arm/t-bpabi
--- a/gcc/config/arm/t-bpabi
+++ b/gcc/config/arm/t-bpabi
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -29,7 +29,6 @@ UNWIND_H = $(srcdir)/config/arm/unwind-a
 LIB2ADDEH = $(srcdir)/config/arm/unwind-arm.c \
   $(srcdir)/config/arm/libunwind.S \
   $(srcdir)/config/arm/pr-support.c $(srcdir)/unwind-c.c
-LIB2ADDEHDEP = $(UNWIND_H) $(srcdir)/config/$(LIB1ASMSRC)
 
 # Add the BPABI names.
 SHLIB_MAPFILES += $(srcdir)/config/arm/libgcc-bpabi.ver
diff --git a/gcc/config/arm/t-symbian b/gcc/config/arm/t-symbian
--- a/gcc/config/arm/t-symbian
+++ b/gcc/config/arm/t-symbian
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005, 2006, 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -33,7 +33,6 @@ LIB1ASMFUNCS += \
 # Include the gcc personality routine
 UNWIND_H = $(srcdir)/config/arm/unwind-arm.h
 LIB2ADDEH = $(srcdir)/unwind-c.c $(srcdir)/config/arm/pr-support.c
-LIB2ADDEHDEP = $(UNWIND_H)
 
 # Include half-float helpers.
 LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/arm/fp16.c
diff --git a/gcc/config/picochip/t-picochip b/gcc/config/picochip/t-picochip
--- a/gcc/config/picochip/t-picochip
+++ b/gcc/config/picochip/t-picochip
@@ -1,4 +1,4 @@
-# Copyright (C) 2008 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -45,7 +45,6 @@ LIB1ASMSRC = picochip/libgccExtras/fake_
 
 # Turn off the building of exception handling libraries.
 LIB2ADDEH =
-LIB2ADDEHDEP =
 
 # Turn off ranlib on target libraries.
 RANLIB_FOR_TARGET = cat
diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin
--- a/gc

Re: [PATCH] c-pragma: adding a data field to pragma_handler

2011-06-03 Thread Pierre Vittet

Thank you for your answer!

I send you a new patch
I have corrected the errors you raised.

I have make my patch compatible with the old use of c_register_pragma 
and c_register_pragma_with_expansion.


I don't know what is the best solution, maybe changing every call 
c_register_pragma allows to keep a more clear code. I can do it, if you 
think it is better.


I have successfully compiled gcc with my patch and I have tried it with 
a modified version of gcc/testsuite/g++.dg/plugin/pragma_plugin.c.


Pierre Vittet

On 02/06/2011 19:51, Tom Tromey wrote:

"Pierre" == Pierre  writes:


Pierre>  I have changed this handler in order to accept a second parameter
Pierre>  which is a void *, allowing to give extra datas to the handler. I
Pierre>  think this data field might be of general use: we can have condition
Pierre>  or data at register time that we want to express in the handler. I
Pierre>  guess this is a common way to pass data to an handler function.

I can't approve or reject this patch, but the idea seems reasonable
enough to me.

Pierre>  I would like your opinion on this patch! Thanks!

It has a number of formatting issues.

Pierre>  +typedef void (*pragma_handler)(struct cpp_reader *, void * );

No space after the final "*".

Pierre>  +/* Internally use to keep the data of the handler.  */
Pierre>  +struct internal_pragma_handler_d{

Space before the "{".

Pierre>  +  pragma_handler handler;
Pierre>  +  void * data;

No space.  Lots of instances of this.

Pierre>   /* A vector of registered pragma callbacks.  */
Pierre>  +/*This is never freed as we need it during the whole execution */

Coalesce the two comments.  The comment formatting is wrong, see GNU
standards.

Pierre> ns_name.space = space;
Pierre> ns_name.name = name;
Pierre>  +
Pierre> VEC_safe_push (pragma_ns_name, heap, 
registered_pp_pragmas,&ns_name);

Gratuitous newline addition.

Pierre>  +  ihandler->handler = handler;
Pierre>  +  ihandler->data = data;

I didn't see anything that initialized ihandler.

Pierre>  +  VEC_safe_push (internal_pragma_handler, heap, 
registered_pragmas,
Pierre>  +&ihandler);

I think you wanted just `internal_pragma_handler ihandler', no "*", for
the definition.

Pierre>  +c_register_pragma (const char *space, const char *name, 
pragma_handler handler,
Pierre>  +   void * data)

There are lots of calls to this that you did not update.
Do a recursive grep to see.

One way to avoid a massive change is to add a new "overload" that passes
in the data to c_register_pragma_1; and then change the "legacy"
functions to pass NULL.

I don't know if that approach is ok (it is typical in gdb...), so if
not, you have to update all callers.

Tom



Index: gcc/c-family/c-pragma.c
===
--- gcc/c-family/c-pragma.c (revision 174521)
+++ gcc/c-family/c-pragma.c (working copy)
@@ -53,7 +53,7 @@ typedef struct GTY(()) align_stack {
 
 static GTY(()) struct align_stack * alignment_stack;
 
-static void handle_pragma_pack (cpp_reader *);
+static void handle_pragma_pack (cpp_reader *, void * data);
 
 /* If we have a "global" #pragma pack() in effect when the first
#pragma pack(push,) is encountered, this stores the value of
@@ -133,7 +133,7 @@ pop_alignment (tree id)
#pragma pack (pop)
#pragma pack (pop, ID) */
 static void
-handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
+handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy), void * ARG_UNUSED (data))
 {
   tree x, id = 0;
   int align = -1;
@@ -247,7 +247,7 @@ DEF_VEC_ALLOC_O(pending_weak,gc);
 static GTY(()) VEC(pending_weak,gc) *pending_weaks;
 
 static void apply_pragma_weak (tree, tree);
-static void handle_pragma_weak (cpp_reader *);
+static void handle_pragma_weak (cpp_reader *, void * data);
 
 static void
 apply_pragma_weak (tree decl, tree value)
@@ -334,7 +334,7 @@ maybe_apply_pending_pragma_weaks (void)
 
 /* #pragma weak name [= value] */
 static void
-handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy))
+handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy), void * ARG_UNUSED (data))
 {
   tree name, value, x, decl;
   enum cpp_ttype t;
@@ -411,11 +411,12 @@ DEF_VEC_ALLOC_O(pending_redefinition,gc);
 
 static GTY(()) VEC(pending_redefinition,gc) *pending_redefine_extname;
 
-static void handle_pragma_redefine_extname (cpp_reader *);
+static void handle_pragma_redefine_extname (cpp_reader *, void * data);
 
 /* #pragma redefine_extname oldname newname */
 static void
-handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy))
+handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy),
+void * ARG_UNUSED (data))
 {
   tree oldname, newname, decl, x;
   enum cpp_ttype t;
@@ -481,7 +482,8 @@ static GTY(()) tree pragma_extern_prefix;
 
 /* #pragma extern_prefix "prefix" */
 static void
-handle_pragma_extern_prefix (cpp_reader * ARG_UNUSED (dummy))
+handle_pragma_extern_prefix (cpp_reader *

Re: [build] Move MD_UNWIND_SUPPORT to toplevel libgcc

2011-06-03 Thread Paolo Bonzini

On 06/03/2011 04:35 PM, Rainer Orth wrote:

Apart from those changes, the patch addresses the PowerPC Darwin and
Windows32 issues as suggested:

* rs6000/darwin-unwind.h is wrapped in !__LP64__, while removing the
   need for the !DARWIN_LIBSYSTEM_HAS_UNWIND test (only defined on Darwin
   9 and up) by using the file only for PowerPC Darwin<  9.

* i386/w32-unwind.h is wrapped in !__MINGW64__.

Bootstrapped without regressions on i386-pc-solaris2.11.


Please give time to Kai and someone from Darwin (CCed Mike and 
Dominique) to test it and approve it.  The .h changes are trivial, so I 
think I can otherwise approve it.


Paolo


Re: [build] Move ENABLE_EXECUTE_STACK to toplevel libgcc

2011-06-03 Thread Rainer Orth
Paolo Bonzini  writes:

>> Seems like a plan, but I didn't go in this direction since I couldn't
>> test anything like this.
>
> As long as you test the general configury on 1-2 platforms, it's not any
> less tested than what you have now.

Unfortunately, that's not true: my original patch just moved the
existing ENABLE_EXECUTE_STACK definitions to new headers in libgcc and
used them as is.  The revised one below consolidates them into two new
files, only one of them has been tested so far.

>> The various __enable_execute_stack
>> implementations differ in minor ways that would have to be autoconf'ed.
>
> Just select them by $host.

Ok, I've done that.

>> One other caveat: I don't know if I like grouping the configure support
>> for the enable-execute-stack.c variants together or would rather keep
>> all configuration for a single platform (or OS) together.  Probably a
>> matter of taste.
>
> In case it wasn't clear, I was proposing the latter.

I suppose you mean the former, i.e. grouping them together and not
setting enable_execute_stack in the existing host cases?

>> Another question: should we keep the variants in libgcc/config (like
>> your config/enable-execute-stack-mprotect.c) or at the toplevel (like
>> enable-execute-stack-empty.c)?  At the moment I see a mixture of files
>> at the libgcc toplevel and others in config.
>
> I would put them under config/ unless they are platform-independent.

Ok, done.

>> I'd thought about it, but refrained since HAVE_ENABLE_EXECUTE_STACK
>> affects only three cpus.  Currently, our documentation of libgcc
>> configury and macros used is close to non-existant.  That's probably for
>> someone who has implemented this stuff.
>
> True, OTOH HAVE_ENABLE_EXECUTE_STACK is a target macro, and those are well
> documented.  Just say that it has to be defined if libgcc provides a
> non-trivial implementation of __enable_execute_stack; it doesn't need to
> delve into how to hack libgcc.

Will do when I submit the final patch.  Right now, I've got a plan and a
draft where I'm looking for comments.

>>> you can make the above work, that would be great as an example of how to
>>> move stuff to the libgcc toplevel directory.
>>
>> I'll give it a try, but it might take over the weekend.
>
> Take your time, we're in stage1 now.

We had a public holiday yesterday :-)

So here we go: I'm including only the libgcc part of the patch, the rest
is unchanged.

The patch is only lightly tested so far, i.e. bootstrapped on
i386-pc-solaris2.8 and i386-pc-solaris2.11.

The existing variants (listed by the previous libgcc headers) are:

  alpha/osf5-lib.h  mprotect
addr & page, end + TRAMPOLINE_SIZE
  darwin-lib.h  mprotect
addr & page, end + TARGET_64BIT ? 48 : 40
rs6000_trampoline_size, cannot use
trampoline size which is a function call
  freebsd-lib.h mprotect
addr, TRAMPOLINE_SIZE, why no & page?
check_enabling via sysctlbyname
  i386/mingw32-lib.hVirtualProtect
  netbsd-lib.h  mprotect
addr & page, end + TRAMPOLINE_SIZE
pagesize via __sysctl
  openbsd-lib.h mprotect
addr & page, end + TRAMPOLINE_SIZE
  sol2-lib.hmprotect
addr & page, end + TRAMPOLINE_SIZE
check_enabling via sysconf

mingw32 is completely separate, while the others have much in common,
namely the use of mprotect to enable stack RWX permissions.

But there are also considerable differences:

* Except for Darwin, the code uses TRAMPOLINE_SIZE.  This only exists in
  the backend headers.  While it could be duplicated somewhere in the
  libgcc configury, I'd rather propose that gcc define
  __TRAMPOLINE_SIZE__ (in gcc/c-family/c-cppbuiltin.c (c_cpp_builtins)
  to avoid this.  On PowerPC Darwin, one cannot use TRAMPOLINE_SIZE
  definition right now since the macro calls the rs6000_trampoline_size
  function in rs6000/rs6000.c.  This would be solved nicely by
  __TRAMPOLINE_SIZE__.

* FreeBSD and Solaris use a check_enabling function to check if
  __enable_execute_stack needs to run at all.  Initially, I had
  enable-execute-stack-{freebsd, netbsd, sol2}.c, all including a common
  enable-execute-stack-mprotect.c to avoid code duplication.  I now
  consider that ugly and hard to read, and merged everything into a
  common enable-execute-stack-mprotect.c below.  Right now, the file
  uses __FreeBSD__, __NetBSD__, and __sun__ && __svr4__ to select the
  right code, but this could be autoconf'ed if desired.  There are a
  couple of FIXME comments in the code.

* NetBSD is extremely careful to avoid namespace pollution and uses
  private __sysctl (declared privately) to avoid 

Re: [PATCH] c-pragma: adding a data field to pragma_handler

2011-06-03 Thread Basile Starynkevitch
On Fri, 03 Jun 2011 17:31:25 +0200
Pierre Vittet  wrote:

> Thank you for your answer!
> 
> I send you a new patch
> I have corrected the errors you raised.
> 
> I have make my patch compatible with the old use of c_register_pragma 
> and c_register_pragma_with_expansion.

I find the patch quite interesting, but I cannot approve it.

 void
+c_register_pragma_with_expansion_and_data (const char *space, const char *name,
+  
pragma_handler_2arg handler,
+   void * data)

Perhaps there are some spaces (vs tabs) issues here.

Cheers
-- 
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basilestarynkevitchnet mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***


Re: PING^2 [PATCH] Support for AMD64 targets running GNU/kFreeBSD

2011-06-03 Thread Robert Millan
Actually, please consider this patch instead.  It's the same but fixes a
mistake in ld.so pathname.

2011/6/2 Robert Millan :
> Hi,
>
> 2011/5/21 Joseph S. Myers :
>> Please send a patch against *current trunk* and CC *relevant target
>> architecture maintainers*.  linux*.h headers are no longer used on
>> non-Linux targets (since my 2011-04-28 patch - on which I CC:ed you) so
>> this patch version is no longer appropriate.  I think you'll want to make
>> gnu-user64.h use GNU_USER_LINK_EMULATION32 and GNU_USER_LINK_EMULATION64
>> similarly to how gnu-user.h uses GNU_USER_LINK_EMULATION.
>
> Thanks for the tip.  Here's an update to current trunk.
>
> --
> Robert Millan
>



-- 
Robert Millan
2011-06-02  Robert Millan  

* config/i386/kfreebsd-gnu.h: Resync with `config/i386/linux.h'.
* config/kfreebsd-gnu.h (GNU_USER_DYNAMIC_LINKER): Resync with
`config/linux.h'.

* config/i386/kfreebsd-gnu64.h: New file.
* config.gcc (x86_64-*-kfreebsd*-gnu): Replace `i386/kfreebsd-gnu.h'
with `i386/kfreebsd-gnu64.h'.

* config/i386/linux64.h (GNU_USER_LINK_EMULATION32)
(GNU_USER_LINK_EMULATION64): New macros.
* config/i386/gnu-user64.h (LINK_SPEC): Rely on
`GNU_USER_LINK_EMULATION32' and `GNU_USER_LINK_EMULATION64' instead
of hardcoding `elf_i386' and `elf_x86_64'.

Index: gcc/config/i386/kfreebsd-gnu64.h
===
--- gcc/config/i386/kfreebsd-gnu64.h(revision 0)
+++ gcc/config/i386/kfreebsd-gnu64.h(revision 0)
@@ -0,0 +1,26 @@
+/* Definitions for AMD x86-64 running kFreeBSD-based GNU systems with ELF 
format
+   Copyright (C) 2011
+   Free Software Foundation, Inc.
+   Contributed by Robert Millan.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+.  */
+
+#define GNU_USER_LINK_EMULATION32 "elf_i386_fbsd"
+#define GNU_USER_LINK_EMULATION64 "elf_x86_64_fbsd"
+
+#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-kfreebsd-x86-64.so.1"
Index: gcc/config/i386/kfreebsd-gnu.h
===
--- gcc/config/i386/kfreebsd-gnu.h  (revision 174566)
+++ gcc/config/i386/kfreebsd-gnu.h  (working copy)
@@ -1,5 +1,5 @@
 /* Definitions for Intel 386 running kFreeBSD-based GNU systems with ELF format
-   Copyright (C) 2004, 2007, 2011
+   Copyright (C) 2011
Free Software Foundation, Inc.
Contributed by Robert Millan.
 
@@ -19,11 +19,5 @@
 along with GCC; see the file COPYING3.  If not see
 .  */
 
-#undef GNU_USER_LINK_EMULATION
 #define GNU_USER_LINK_EMULATION "elf_i386_fbsd"
-
-#undef GNU_USER_DYNAMIC_LINKER32
-#define GNU_USER_DYNAMIC_LINKER32 "/lib/ld.so.1"
-
-#undef GNU_USER_DYNAMIC_LINKER64
-#define GNU_USER_DYNAMIC_LINKER64 "/lib/ld-kfreebsd-x86-64.so.1"
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
Index: gcc/config/i386/linux64.h
===
--- gcc/config/i386/linux64.h   (revision 174566)
+++ gcc/config/i386/linux64.h   (working copy)
@@ -24,6 +24,9 @@
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 .  */
 
+#define GNU_USER_LINK_EMULATION32 "elf_i386"
+#define GNU_USER_LINK_EMULATION64 "elf_x86_64"
+
 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
 #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
 
Index: gcc/config/i386/gnu-user64.h
===
--- gcc/config/i386/gnu-user64.h(revision 174566)
+++ gcc/config/i386/gnu-user64.h(working copy)
@@ -69,7 +69,8 @@
  %{!mno-sse2avx:%{mavx:-msse2avx}} %{msse2avx:%{!mavx:-msse2avx}}"
 
 #undef LINK_SPEC
-#define LINK_SPEC "%{" SPEC_64 ":-m elf_x86_64} %{" SPEC_32 ":-m elf_i386} \
+#define LINK_SPEC "%{" SPEC_64 ":-m " GNU_USER_LINK_EMULATION64 "} \
+   %{" SPEC_32 ":-m " GNU_USER_LINK_EMULATION32 "} \
   %{shared:-shared} \
   %{!shared: \
 %{!static: \
Index: gcc/config/kfreebsd-gnu.h
===
--- gcc/config/kfreebsd-gnu.h   (revision 174566)
+++ gcc/config/kfreebsd-gnu.h   (working copy)
@@ -19,7 +19,6 @@
 along with GCC; see the file COPYING3.  If not see
 .  */
 
-#undef GNU_USER_TARGET_OS_CPP_BUILTINS
 #define GNU_USER_T

Re: [build] Move ENABLE_EXECUTE_STACK to toplevel libgcc

2011-06-03 Thread Paolo Bonzini

On 06/03/2011 05:45 PM, Rainer Orth wrote:

Paolo Bonzini  writes:


>>  Seems like a plan, but I didn't go in this direction since I couldn't
>>  test anything like this.

>
>  As long as you test the general configury on 1-2 platforms, it's not any
>  less tested than what you have now.

Unfortunately, that's not true: my original patch just moved the
existing ENABLE_EXECUTE_STACK definitions to new headers in libgcc and
used them as is.  The revised one below consolidates them into two new
files, only one of them has been tested so far.


Yes, I wasn't expecting to go to this length.  But thanks for doing it.


>>  One other caveat: I don't know if I like grouping the configure support
>>  for the enable-execute-stack.c variants together or would rather keep
>>  all configuration for a single platform (or OS) together.  Probably a
>>  matter of taste.

>
>  In case it wasn't clear, I was proposing the latter.

I suppose you mean the former, i.e. grouping them together and not
setting enable_execute_stack in the existing host cases?


I meant doing it in config.host, because I was expecting you to keep all 
implementations in separate *.c files, even for all the mprotect 
variants, but I agree your patch is better.



Will do when I submit the final patch.  Right now, I've got a plan and a
draft where I'm looking for comments.


Makes sense.


* Except for Darwin, the code uses TRAMPOLINE_SIZE.  This only exists in
   the backend headers.  While it could be duplicated somewhere in the
   libgcc configury, I'd rather propose that gcc define
   __TRAMPOLINE_SIZE__ (in gcc/c-family/c-cppbuiltin.c (c_cpp_builtins)
   to avoid this.  On PowerPC Darwin, one cannot use TRAMPOLINE_SIZE
   definition right now since the macro calls the rs6000_trampoline_size
   function in rs6000/rs6000.c.  This would be solved nicely by
   __TRAMPOLINE_SIZE__.


Good idea.


* FreeBSD and Solaris use a check_enabling function to check if
   __enable_execute_stack needs to run at all.  Initially, I had
   enable-execute-stack-{freebsd, netbsd, sol2}.c, all including a common
   enable-execute-stack-mprotect.c to avoid code duplication.  I now
   consider that ugly and hard to read, and merged everything into a
   common enable-execute-stack-mprotect.c below.  Right now, the file
   uses __FreeBSD__, __NetBSD__, and __sun__&&  __svr4__ to select the
   right code, but this could be autoconf'ed if desired.  There are a
   couple of FIXME comments in the code.


Please avoid putting the ((constructor)) in common code.  You can put

static int i = 1;

in the #else case, and leave

static int i;

in common code.


* NetBSD is extremely careful to avoid namespace pollution and uses
   private __sysctl (declared privately) to avoid using getpagesize.
   Either this is an issue, and we might do something similar on all
   platforms, or it's not and we should avoid special-casing NetBSD
   here.


Perhaps it has to do with getpagesize not being available for old 
versions of NetBSD.  No idea, but I'd leave it as is.



* FreeBSD uses the unmodified address passed to __enable_execute_stack
   to call mprocted, while all others round both address and size to a
   pagesize boundary.  I cannot imagine that FreeBSD supports
   byte-granularity mprotect, so this seems an oversight.


Agreed.


* Windows32 calls abort when VirtualProtect fails.  With the exception
   of Darwin and NetBSD, all others call perror, which seems to be
   frowned upon.  We should be consistent here.


I think it should either abort() or do nothing, consistently across all 
platforms.



* gcc/config/i386/mingw32.h has

#ifdef IN_LIBGCC2
#include
#endif

   I strongly suspect that this is only to declare VirtualQuery and
   VirtualProtect and can go if ENABLE_EXECUTE_STACK is removed?


Yes, it should go.


* Finally, __enable_execute_stack is only used on those NetBSD targets
that actually define HAVE_ENABLE_EXECUTE_STACK, while OpenBSD uses it
everywhere.  config.host could be simplyfied if NetBSD behaved the
same.


I would add it to all NetBSDs, and perhaps all FreeBSDs too?  Do you 
know why SPARC is special?


Paolo


Re: [build] Remove LIB2ADDEHDEP

2011-06-03 Thread Paolo Bonzini

On 06/03/2011 05:11 PM, Rainer Orth wrote:

Bootstrapped without regressions on i386-pc-solaris2.11, ok for
mainline?  I suppose this is obvious.



The patch is okay, I'll look at the rest next week.

Paolo


Re: don't dump decl_uid with TDF_NOUID

2011-06-03 Thread Xinliang David Li
Looks good to me, but you need an OK from a maintainer.

Thanks,

David

On Fri, Jun 3, 2011 at 7:17 AM, Alexandre Oliva  wrote:
> A recent change introduced decl_uid in the “;; Function ” header in dump
> files.  This breaks -fcompare-debug (and bootstrap-debug-lean), because
> decl uids aren't kept in sync between -g and non-g compilations.
>
> This patch rearranges the header so that decl_uid is omitted when
> dumping with NOUID, and it prints the header for the -fcompare-debug
> final dump with NOUID.
>
> Regstrapped on x86_64-linux-gnu and i686-linux-gnu.  Ok?
>
>
>
>
> --
> Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
> You must be the change you wish to see in the world. -- Gandhi
> Be Free! -- http://FSFLA.org/   FSF Latin America board member
> Free Software Evangelist      Red Hat Brazil Compiler Engineer
>
>


[PATCH][PING][Revised] fix --enable-build-with-cxx on darwin]

2011-06-03 Thread Jack Howarth
   Could someone commit this patch, which was already approved in

http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00411.html

The absence of this patch in gcc trunk prevents --enable-build-with-cxx 
from working on darwin. Thanks in advance.
  Jack

- Forwarded message from Jack Howarth  -

X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bromo.med.uc.edu
X-Spam-Level: 
X-Spam-Status: No, score=-1.5 required=4.4 tests=AWL,BAYES_00,
DNS_FROM_OPENWHOIS,FH_DATE_PAST_20XX,RCVD_IN_DNSWL_MED autolearn=no
version=3.2.5
X-Original-To: howa...@bromo.med.uc.edu
Delivered-To: howa...@bromo.med.uc.edu
X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 
tests=AWL,BAYES_00,TW_CX,T_RP_MATCHES_RCVD
Date: Thu, 5 May 2011 08:58:26 -0400
From: Jack Howarth 
To: gcc-patches@gcc.gnu.org
Subject: [PATCH][Revised] fix --enable-build-with-cxx on darwin
User-Agent: Mutt/1.5.18 (2008-05-17)
Mailing-List: contact gcc-patches-h...@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: 
List-Unsubscribe: 

List-Archive: 
List-Post: 
List-Help: 
Delivered-To: mailing list gcc-patches@gcc.gnu.org

Currently the bootstrap with --enable-build-with-cxx is broken due to compiler 
errors of the form
"error: converting 'false' to pointer type 'varpool_node*' 
[-Werror=conversion-null]". The attached
patch changes the last remaing instance of false to NULL and restores the 
--enable-build-with-cxx bootstrap.
Tested on x86_64-apple-darwin10. Okay for gcc trunk?
Jack

2011-05-05  Jack Howarth 

* gcc/varpool.c (varpool_extra_name_alias): Likewise.

Index: gcc/varpool.c
===
--- gcc/varpool.c   (revision 173423)
+++ gcc/varpool.c   (working copy)
@@ -676,7 +676,7 @@ varpool_extra_name_alias (tree alias, tr
 
 #ifndef ASM_OUTPUT_DEF
   /* If aliases aren't supported by the assembler, fail.  */
-  return false;
+  return NULL;
 #endif
 
   gcc_assert (TREE_CODE (decl) == VAR_DECL);

- End forwarded message -


Re: [build] Move MD_UNWIND_SUPPORT to toplevel libgcc

2011-06-03 Thread Kai Tietz
Ok, windows part of the patch is ok.

Thanks,
Kai


Re: [PR debug/47590] rework md option overriding to delay var-tracking

2011-06-03 Thread Bernd Schmidt
On 06/03/2011 04:11 PM, Alexandre Oliva wrote:

> Trunk is now fixed, is the patch ok for the 4.6 branch too?

As far as I'm concerned, sure.


Bernd



How to patch fixincludes/Makefile for Interix?

2011-06-03 Thread Douglas B Rupp


I've been working on a resurrection patch for Interix, one remaining 
problem is fixincludes/fixincl.c must be compiled on native Interix with 
-D_ALL_SOURCE in order to find the getpagesize prototype.


This works (taking some liberties with diff...):

fixincludes/Makefile.in
-FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES)
+FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES) -D_ALL_SOURCE

Obviously unacceptable in general.
Fixincludes ignores a config/mh-interix, so adding
FIXINC_CFLAGS += -D_ALL_SOURCE doesn't work.

What is the correct solution? Any advice would be greatly appreciated.


libobjc: remove deprecated API (patch 4)

2011-06-03 Thread Nicola Pero
This patch removes -forward:: from Object.  I was planning to do this later, 
but the
previous patch (patch 3) removed -doesNotRecognize:, which was used in the 
default
implementation of -forward::, which generates some ugly warnings when 
compiling.  
Removing -forward:: removes the warnings.

Please note that at this stage the runtime may still invoke -forward:: if you 
have it 
implemented in your own class, and have not installed a custom forwarding 
routine.  
There are testcases in the GCC testsuite that test this.  This will all go away 
later, 
and will require removing the testcases, but at the same time I'd like to add 
new 
testcases for __objc_msg_forward and __objc_msg_forward2, which are the actual 
hooks 
used in practice by users of libobjc, but which currently are not really tested.

For now, this patch just removes [Object -forward::], which is deprecated, and 
makes 
libobjc compile again without warnings.

Committed to trunk.

Thanks

Index: sendmsg.c
===
--- sendmsg.c   (revision 174593)
+++ sendmsg.c   (working copy)
@@ -936,9 +936,12 @@ __objc_block_forward (id rcv, SEL op, ...)
 }
 
 
-/* This function is installed in the dispatch table for all methods
-   which are not implemented.  Thus, it is called when a selector is
-   not recognized.  */
+/* This function is called for methods which are not implemented,
+   unless a custom forwarding routine has been installed.  Please note
+   that most serious users of libobjc (eg, GNUstep base) do install
+   their own forwarding routines, and hence this is never actually
+   used.  But, if no custom forwarding routine is installed, this is
+   called when a selector is not recognized.  */
 static retval_t
 __objc_forward (id object, SEL sel, arglist_t args)
 {
Index: ChangeLog
===
--- ChangeLog   (revision 174594)
+++ ChangeLog   (working copy)
@@ -1,5 +1,11 @@
 2011-06-03  Nicola Pero  
 
+   * Object.m ([-forward::]): Removed.
+   * objc/deprecated/Object.h ([-forward::]): Removed.
+   * sendmsg.c (__objc_forward): Updated comments.
+   
+2011-06-03  Nicola Pero  
+
* Makefile.in (OBJC_H): Removed objc-list.h.
(OBJC_DEPRECATED_H): Removed objc-list.h.
* objc/objc-list.h: File removed.
Index: Object.m
===
--- Object.m(revision 174593)
+++ Object.m(working copy)
@@ -248,12 +248,6 @@ see the files COPYING3 and COPYING.RUNTIME respect
 :class_get_class_method(self->isa, aSel)));
 }
 
-- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame
-{
-  (void) argFrame; /* UNUSED */
-  return (retval_t)[self doesNotRecognize: aSel];
-}
-
 - (retval_t)performv:(SEL)aSel :(arglist_t)argFrame
 {
   return objc_msg_sendv(self, aSel, argFrame);
Index: objc/deprecated/Object.h
===
--- objc/deprecated/Object.h(revision 174593)
+++ objc/deprecated/Object.h(working copy)
@@ -49,7 +49,6 @@
 - (struct objc_method_description *)descriptionForMethod:(SEL)aSel;
 
 /* Forwarding */
-- (retval_t)forward:(SEL)aSel :(arglist_t)argFrame;
 - (retval_t)performv:(SEL)aSel :(arglist_t)argFrame;
 
 /* Posing */





Re: PING: PATCH: PR target/46770: Use .init_array/.fini_array sections

2011-06-03 Thread Michael Eager

On 06/03/2011 05:31 AM, Richard Guenther wrote:

On Fri, Jun 3, 2011 at 6:31 AM, H.J. Lu  wrote:

On Wed, May 18, 2011 at 8:57 AM, H.J. Lu  wrote:

On Tue, Apr 26, 2011 at 6:05 AM, H.J. Lu  wrote:

On Thu, Mar 31, 2011 at 7:57 AM, H.J. Lu  wrote:

On Mon, Mar 21, 2011 at 11:40 AM, H.J. Lu  wrote:

On Mon, Mar 14, 2011 at 12:28 PM, H.J. Lu  wrote:

On Thu, Jan 27, 2011 at 2:40 AM, Richard Guenther
  wrote:

On Thu, Jan 27, 2011 at 12:12 AM, H.J. Lu  wrote:

On Tue, Dec 14, 2010 at 05:20:48PM -0800, H.J. Lu wrote:

This patch uses .init_array/.fini_array sections instead of
.ctors/.dtors sections if mixing .init_array/.fini_array and
.ctors/.dtors sections with init_priority works.

It removes .ctors/.ctors sections from executables and DSOes, which will
remove one function call at startup time from each executable and DSO.
It should reduce image size and improve system startup time.

If a platform with a working .init_array/.fini_array support needs a
different .init_array/.fini_array implementation, it can set
use_initfini_array to no.

Since .init_array/.fini_array is a target feature. --enable-initfini-array
is default to no unless the native run-time test is passed.

To pass the native run-time test, a linker with SORT_BY_INIT_PRIORITY
support is required.  The binutils patch is available at

http://sourceware.org/ml/binutils/2010-12/msg00466.html


Linker patch has been checked in.



This patch passed 32bit/64bit regression test on Linux/x86-64.  Any
comments?



This updated patch fixes build on Linux/ia64 and should work on others.
Any comments?


Yes.  This is stage1 material.



Here is the updated patch.  OK for trunk?

Thanks.


--
H.J.

2011-03-14  H.J. Lu

PR target/46770
* acinclude.m4 (gcc_AC_INITFINI_ARRAY): Removed.

* config.gcc (use_initfini_array): New variable.
Use initfini-array.o if supported.

* crtstuff.c: Don't generate .ctors nor .dtors sections if
NO_CTORS_DTORS_SECTIONS is defined.

* configure.ac: Remove gcc_AC_INITFINI_ARRAY.  Add
--enable-initfini-array and check if .init_array can be used with
.ctors.

* configure: Regenerated.

* config/initfini-array.c: New.
* config/initfini-array.h: Likewise.
* config/t-initfini-array: Likewise.

* config/arm/arm.c (arm_asm_init_sections): Call
elf_initfini_array_init_sections if NO_CTORS_DTORS_SECTIONS
is defined.
* config/avr/avr.c (avr_asm_init_sections): Likewise.
* config/ia64/ia64.c (ia64_asm_init_sections): Likewise.
* config/mep/mep.c (mep_asm_init_sections): Likewise.
* config/microblaze/microblaze.c (microblaze_elf_asm_init_sections):
Likewise.
* config/rs6000/rs6000.c (rs6000_elf_asm_init_sections): Likewise.
* config/stormy16/stormy16.c (xstormy16_asm_init_sections):
Likewise.
* config/v850/v850.c (v850_asm_init_sections): Likewise.



PING:

http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00760.html



Any comments?  Any objections?



Here is the patch updated for the current trunk.  OK for trunk?



PING,.


Hi Richard,

You commented my patch was stage 1 material:

http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01989.html

Is my patch:

http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00760.html

OK for trunk?


I can't approve the configury changes and would like to defer
to target maintainers for the target specific changes.  That said,
I'm not familiar enough with the area of the patch.  But yes,
it's stage1 now - so if anyone else wants to approve this patch...


Microblaze change OK.

--
Michael Eagerea...@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


Re: How to patch fixincludes/Makefile for Interix?

2011-06-03 Thread Bruce Korb
Hi Doug,

On Fri, Jun 3, 2011 at 10:00 AM, Douglas B Rupp  wrote:
>
> I've been working on a resurrection patch for Interix, one remaining problem
> is fixincludes/fixincl.c must be compiled on native Interix with
> -D_ALL_SOURCE in order to find the getpagesize prototype.
>
> This works (taking some liberties with diff...):
>
> fixincludes/Makefile.in
> -FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES)
> +FIXINC_CFLAGS = -DHAVE_CONFIG_H $(INCLUDES) -D_ALL_SOURCE
>
> Obviously unacceptable in general.

Obviously.

> Fixincludes ignores a config/mh-interix, so adding
> FIXINC_CFLAGS += -D_ALL_SOURCE doesn't work.
>
> What is the correct solution? Any advice would be greatly appreciated.

Without digging into makefile magic, it would seem to me that
you'd want to jigger Makefile.in to source $(top_srcdir)/config/mh-$(target)
and use FIXINC_CPPFLAGS (this being a pre-processor flag).


[pph] Removing unused timevars following pph instrumentation removal patch (issue4568053)

2011-06-03 Thread Gabriel Charette
Removed the 3 PPH timevars used in pph instrumentation. Those are not used
anymore following the instrumentation removal patch.

Bootstrap build and regression testing were successful.

2011-06-03  Gabriel Charette  

* timevar.def (TV_PPH_CACHE_IN): Remove.
(TV_PPH_CACHE_OUT): Remove.
(TV_PPH_MANAGE): Remove.

Index: timevar.def
===
--- timevar.def (revision 174568)
+++ timevar.def (working copy)
@@ -69,11 +69,6 @@
 DEFTIMEVAR (TV_PTH_SKIP_TOKENS   , "PTH skip cached tokens")
 DEFTIMEVAR (TV_PTH_INIT  , "PTH initialization")
 
-/* Time spent handling PPH state.  */
-DEFTIMEVAR (TV_PPH_CACHE_IN  , "PPH cache in")
-DEFTIMEVAR (TV_PPH_CACHE_OUT , "PPH cache out")
-DEFTIMEVAR (TV_PPH_MANAGE, "PPH bookkeeping")
-
 DEFTIMEVAR (TV_CGRAPH, "callgraph construction")
 DEFTIMEVAR (TV_CGRAPHOPT , "callgraph optimization")
 DEFTIMEVAR (TV_VARPOOL   , "varpool construction")

--
This patch is available for review at http://codereview.appspot.com/4568053


Re: Initialize INSN_COND (was: C6X port 5/11: Track predication conditions more accurately)

2011-06-03 Thread Steve Ellcey
On Thu, 2011-06-02 at 15:30 -0700, Steve Ellcey wrote:
> On Thu, 2011-06-02 at 15:29 +0400, Alexander Monakov wrote:
> > Bernd,
> > 
> > The problem is INSN_COND should be reset when initializing a new deps
> > structure, otherwise instructions may get stale conditions from other
> > previously analyzed instructions.  Presuming that sd_init_insn is the
> > proper place for that, I'll test the following patch.
> > 
> > 
> > 2011-06-02  Alexander Monakov  
> > 
> > * sched-deps.c (sd_init_insn): Initialize INSN_COND.
> > * sel-sched.c (move_op): Use correct type for 'res'.  Verify that
> > code_motion_path_driver returned 0 or 1.
> 
> I tested this patch on my IA64 HP-UX box and did not see any
> regressions.  It fixed the problem I was having.
> 
> Steve Ellcey
> s...@cup.hp.com

Alexander, It may have spoke too soon.  Last night's testing showed a
regression that I didn't see yesterday.

gfortran.dg/array_constructor_9.f90 is failing on IA64 HP-UX in 32 bit
mode but not in 64 bit mode.  It is also not failing on IA64 Linux.

It fails with the options:

-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions
or

-O3 -fomit-frame-pointer -funroll-loops

The failure mode is:


array_constructor_9.f90: In function 'gen':
array_constructor_9.f90:14:0: internal compiler error: in 
code_motion_path_driver, at sel-sched.c:6573
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.


Note that I am using r174594 sources with your patch *AND* with the patch
Bernd proposed for PR 48673 
(http://gcc.gnu.org/ml/gcc-patches/2011-05/msg02470.html).
So this regression may be due to the other change.  I will look into it some
more to see if I can figure out which change is causing this regression.  I did 
not
see any other regressions.

Steve Ellcey
s...@cup.hp.com



Re: Use i386/crtfastmath.c on Solaris 2/x86

2011-06-03 Thread Rainer Orth
Richard Henderson  writes:

> On 06/01/2011 07:51 AM, Rainer Orth wrote:
>> +  /* Set PC to the instruction after the faulting one to skip over it,
>> + otherwise we enter an infinite loop.  4 is the size of the stmxcsr
>> + instruction.  */
> ...
>> +  /* We need a single SSE instruction here so the handler can safely 
>> skip
>> + over it.  */
>> +  __asm__ volatile ("movss %xmm2,%xmm1");
>
> The comment referencing stmxcsr doesn't match the movss code.
> It's still a 4 byte opcode, so the code still works.
>
> I do wonder if using "movaps %xmm0,%xmm0" might be cleaner,
> to avoid clobbering a register, even if that register is
> surely dead anyway.  That's a 3 byte opcode though, so the
> handler would need updating.

Here's what I installed after regtesting completed on
i386-pc-solaris2.{8, 11}.

Thanks.
Rainer


2011-06-02  Richard Henderson  
Rainer Orth  

gcc:
* config/i386/crtfastmath.c [!__x86_64__ && __sun__ && __svr4__]
(sigill_hdlr): Correct insn, insn size.
(set_fast_math) [!__x86_64__ && __sun__ && __svr4__]: Use movaps.

gcc/testsuite:
* lib/target-supports.exp (check_sse_os_support_available): Use
movaps.

libgfortran.
* config/fpu-387.h [__sun__ && __svr4__] (sigill_hdlr): Correct
insn, insn size.
(has_sse) [!__x86_64__ && __sun__ && __svr4__]: Use movaps.

diff --git a/gcc/config/i386/crtfastmath.c b/gcc/config/i386/crtfastmath.c
--- a/gcc/config/i386/crtfastmath.c
+++ b/gcc/config/i386/crtfastmath.c
@@ -30,7 +30,7 @@
 #include "cpuid.h"
 #endif
 
-#if !defined __x86_64 && defined __sun__ && defined __svr4__
+#if !defined __x86_64__ && defined __sun__ && defined __svr4__
 #include 
 #include 
 
@@ -43,9 +43,9 @@ sigill_hdlr (int sig __attribute((unused
 {
   sigill_caught = 1;
   /* Set PC to the instruction after the faulting one to skip over it,
- otherwise we enter an infinite loop.  4 is the size of the stmxcsr
+ otherwise we enter an infinite loop.  3 is the size of the movaps
  instruction.  */
-  ucp->uc_mcontext.gregs[EIP] += 4;
+  ucp->uc_mcontext.gregs[EIP] += 3;
   setcontext (ucp);
 }
 #endif
@@ -83,7 +83,7 @@ set_fast_math (void)
 
   /* We need a single SSE instruction here so the handler can safely skip
 over it.  */
-  __asm__ volatile ("movss %xmm2,%xmm1");
+  __asm__ volatile ("movaps %xmm0,%xmm0");
 
   sigaction (SIGILL, &oact, NULL);
 
diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -1059,7 +1059,7 @@ proc check_sse_os_support_available { } 
check_runtime_nocache sse_os_support_available {
int main ()
{
-   __asm__ volatile ("movss %xmm2,%xmm1");
+   __asm__ volatile ("movaps %xmm0,%xmm0");
return 0;
}
} "-msse"
diff --git a/libgfortran/config/fpu-387.h b/libgfortran/config/fpu-387.h
--- a/libgfortran/config/fpu-387.h
+++ b/libgfortran/config/fpu-387.h
@@ -1,5 +1,5 @@
 /* FPU-related code for x86 and x86_64 processors.
-   Copyright 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright 2005, 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
Contributed by Francois-Xavier Coudert 
 
 This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -40,9 +40,9 @@ sigill_hdlr (int sig __attribute((unused
 {
   sigill_caught = 1;
   /* Set PC to the instruction after the faulting one to skip over it,
- otherwise we enter an infinite loop.  4 is the size of the stmxcsr
+ otherwise we enter an infinite loop.  3 is the size of the movaps
  instruction.  */
-  ucp->uc_mcontext.gregs[EIP] += 4;
+  ucp->uc_mcontext.gregs[EIP] += 3;
   setcontext (ucp);
 }
 #endif
@@ -73,7 +73,7 @@ has_sse (void)
 
   /* We need a single SSE instruction here so the handler can safely skip
 over it.  */
-  __asm__ volatile ("movss %xmm2,%xmm1");
+  __asm__ volatile ("movaps %xmm0,%xmm0");
 
   sigaction (SIGILL, &oact, NULL);
 


-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: [PATCH, ARM] Fix ABI for double-precision helpers on single-float-only CPUs

2011-06-03 Thread Julian Brown
On Thu, 02 Jun 2011 16:35:01 +0100
Richard Earnshaw  wrote:

> I see Paul has already approved this, but I've just spotted one
> potential problem that might cause latent bugs sometime in the future.
> 
> The code to register the libcalls is only run once, the first time we
> try to look up a libcall.  If we ever end up allowing dynamic changing
> of CPU and optimization options, not registering the other libcalls
> will lead to subtle problems at run time.  I suggest that these
> functions be unconditionally added along with the other libcalls.

Done.

> I also don't understand why all the tests are needed in
> arm_init_cumulative_args?  Surely arm_libcall_uses_aapcs_base() will
> already have run that test.

I did some archaeology to try to figure out why things were like that
(the patch was written a while ago) -- and yeah, it looks like it's
completely unnecessary to have those tests in arm_init_cumulative_args.
That bit of code was refactored a while ago, and it looks like the
patch wasn't ever updated properly. My mistake!

I'm re-testing the attached version.

Thanks,

Julian

ChangeLog

gcc/
* config/arm/arm.c (arm_libcall_uses_aapcs_base): Use correct ABI
for double-precision helper functions in hard-float mode if only
single-precision arithmetic is supported in hardware.commit 8084248e648e3276b91a957f667c299f84e1
Author: Julian Brown 
Date:   Fri Jun 3 04:34:23 2011 -0700

VFP ABI fix for double-precision helpers on single-only processors.

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 057f9ba..a1d009b 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -3345,6 +3345,28 @@ arm_libcall_uses_aapcs_base (const_rtx libcall)
 		   convert_optab_libfunc (sfix_optab, DImode, SFmode));
   add_libcall (libcall_htab,
 		   convert_optab_libfunc (ufix_optab, DImode, SFmode));
+
+  /* Values from double-precision helper functions are returned in core
+	 registers if the selected core only supports single-precision
+	 arithmetic, even if we are using the hard-float ABI.  The same is
+	 true for single-precision helpers, but we will never be using the
+	 hard-float ABI on a CPU which doesn't support single-precision
+	 operations in hardware.  */
+  add_libcall (libcall_htab, optab_libfunc (add_optab, DFmode));
+  add_libcall (libcall_htab, optab_libfunc (sdiv_optab, DFmode));
+  add_libcall (libcall_htab, optab_libfunc (smul_optab, DFmode));
+  add_libcall (libcall_htab, optab_libfunc (neg_optab, DFmode));
+  add_libcall (libcall_htab, optab_libfunc (sub_optab, DFmode));
+  add_libcall (libcall_htab, optab_libfunc (eq_optab, DFmode));
+  add_libcall (libcall_htab, optab_libfunc (lt_optab, DFmode));
+  add_libcall (libcall_htab, optab_libfunc (le_optab, DFmode));
+  add_libcall (libcall_htab, optab_libfunc (ge_optab, DFmode));
+  add_libcall (libcall_htab, optab_libfunc (gt_optab, DFmode));
+  add_libcall (libcall_htab, optab_libfunc (unord_optab, DFmode));
+  add_libcall (libcall_htab, convert_optab_libfunc (sext_optab, DFmode,
+			SFmode));
+  add_libcall (libcall_htab, convert_optab_libfunc (trunc_optab, SFmode,
+			DFmode));
 }
 
   return libcall && htab_find (libcall_htab, libcall) != NULL;


Re: Initialize INSN_COND

2011-06-03 Thread Alexander Monakov


On Thu, 2 Jun 2011, Bernd Schmidt wrote:

> Ok. Although I wonder how sel-sched can end up reusing an entry in
> h_d_i_d? How does it use this machinery? If it's not doing a normal
> forward scan as in sched_analyze, the INSN_COND mechanism may break in
> other ways.

Indeed, that patch did not completely solve the problem, as stale INSN_CONDs
can still be seen (I have a testcase reduced from combine.c).  Selective
scheduler's dependency analysis is certainly not limited to a single pass, as
it will test more dependencies on the fly after e.g. creating bookkeeping.

Was there some particular breakage you had in mind when mentioning that
INSN_CONDs may break in other ways?

Can you tell why you chose to place INSN_CONDs into HDID instead of HID?
HID seems a bit more natural choice to me, and as it explicitely populated
with zeros, it fixes the above combine.c testcase for me.  However, moving
INSN_CONDs to HID breaks sel-sched in a different way because sometimes HID is
not extended early enough; if that approach is generally ok for you, I can see
whether I can produce a working patch in that vein.

FWIW, we have a patch that adds predication support for the selective
scheduler (allowing the scheduler to transform insns into predicated form)
that we plan to submit during this stage1.

Thanks.
Alexander


[PING] [PATCH] PR preprocessor/48532 (Wrong location in pragma involving macros)

2011-06-03 Thread Dodji Seketeli
I am pinging this patch first posted to 
http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00697.html.

--- Begin Message ---
Hello,

While looking at something else, I noticed that preprocessing this
code snippet:

cat -n test.c
~=~
void foo (void)
{
  int i1, j1, k1;
#define p parallel
#define P(x) private (x##1)
#define S(x) shared (x##1)
#define F(x) firstprivate (x##1)
#pragma omp p P(i) \
  S(j) \
  F(k)
  ;
}
~=~

yields:

cc1 -E -fopenmp test.c
~=~
# 1 "test.c"
# 1 ""
# 1 ""
# 1 "test.c"
void foo (void)
{
  int i1, j1, k1;




   
# 33554432 "test.c"

 
# 8 "test.c"
#pragma omp parallel private (i1) shared (j1) firstprivate (k1)


  ;
}
~=~


Note that the bogus line ...

# 33554432 "test.c".

... should not be present in the preprocessed output

In scan_translation_unit,the call to cpp_get_token_with_location
yields a location equals to zero.

>From there, bad things happen; basically maybe_print_line is passed a
zero location.  It looks up a location map for it, and that lookup
yields the map that was created for location 1 (for builtins).  The
file path of that location is "test.c" (hence the "test.c" file on the
wrong line) and the source line number is garbage, as that location
map was never used to map location 0.

I think cpp_get_token_with_location should not have returned a zero
location to begin with.

I tracked it down to the way we handle the pragma in do_pragma
(indirectly called by cpp_get_token_with_location).  While parsing the
name of the pragma (which is the macro 'p' here, as 'omp' is just the
namespace of the pragma) with cpp_get_token, we forget to record the
invocation location of the 'p' macro.  So when
cpp_get_token_with_location pokes at said invocation location, it gets
a value of zero.

This (morally one-liner) patch just sets invocation location there.

Bootstrapped and tested on x86_64-unknown-linux-gnu for
"c,ada,c++,fortran,java,lto,objc" and checking enabled, against trunk.

libcpp/

* directives.c (do_pragma): Don't forget the invocation location
when parsing the pragma name of a namespaced pragma directive.

gcc/testsuite/

* gcc.dg/cpp/pragma-3.c: New test case.
---
 gcc/testsuite/gcc.dg/cpp/pragma-3.c |   39 +++
 libcpp/directives.c |   31 ++-
 2 files changed, 69 insertions(+), 1 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/cpp/pragma-3.c

diff --git a/gcc/testsuite/gcc.dg/cpp/pragma-3.c 
b/gcc/testsuite/gcc.dg/cpp/pragma-3.c
new file mode 100644
index 000..1d5fe9c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pragma-3.c
@@ -0,0 +1,39 @@
+/* 
+   { dg-options "-fopenmp" }
+   { dg-do preprocess }
+ */
+
+void foo (void)
+{
+  int i1, j1, k1;
+#define p parallel
+#define P(x) private (x##1)
+#define S(x) shared (x##1)
+#define F(x) firstprivate (x##1)
+#pragma omp \
+  p \
+  P(i) \
+  S(j) \
+  F(k)
+  ;
+}
+
+/* 
+   The bug here was that we had a line like:
+   # 33554432 "../../gcc/testsuite/gcc.dg/cpp/pragma-3.c"
+   
+   Before line:
+
+   #pragma omp parallel private (i1) shared (j1) firstprivate (k1)
+
+   Note the very big integer there.  Normally we should just have
+   this:
+   
+   # 13 "../../gcc/testsuite/gcc.dg/cpp/pragma-3.c"
+   #pragma omp parallel private (i1) shared (j1) firstprivate (k1)
+
+   So let's chech that we have no line with a number of 3 or more
+   digit after #:
+
+   { dg-final { scan-file-not pragma-3.i "# \[0-9\]{3} \[^\n\r\]*pragma-3.c" } 
}
+*/
diff --git a/libcpp/directives.c b/libcpp/directives.c
index f244ae5..27164ff 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -1360,7 +1360,36 @@ do_pragma (cpp_reader *pfile)
{
  bool allow_name_expansion = p->allow_expansion;
  if (allow_name_expansion)
-   pfile->state.prevent_expansion--;
+   {
+ pfile->state.prevent_expansion--;
+ /*
+   Kludge ahead.
+
+   Consider this code snippet:
+
+   #define P parallel
+   #pragma omp P for
+   ... a for loop ...
+
+   Once we parsed the 'omp' namespace of the #pragma
+   directive, we then parse the 'P' token that represents the
+   pragma name.  P being a macro, it is expanded into the
+   resulting 'parallel' token.
+
+   At this point the 'p' variable contains the 'parallel'
+   pragma name.  And pfile->context->macro is non-null
+   because we are still right at the end of the macro
+   context of 'P'.  The problem is, if we are beeing
+   (indirectly) called by cpp_get_token_with_location,
+   that function might test pfile->context->macro to see
+   if we are in the context of a macro expansion, (and we
+   ar

Re: Initialize INSN_COND

2011-06-03 Thread Bernd Schmidt
On 06/03/2011 07:44 PM, Alexander Monakov wrote:
> 
> 
> On Thu, 2 Jun 2011, Bernd Schmidt wrote:
> 
>> Ok. Although I wonder how sel-sched can end up reusing an entry in
>> h_d_i_d? How does it use this machinery? If it's not doing a normal
>> forward scan as in sched_analyze, the INSN_COND mechanism may break in
>> other ways.
> 
> Indeed, that patch did not completely solve the problem, as stale INSN_CONDs
> can still be seen (I have a testcase reduced from combine.c).  Selective
> scheduler's dependency analysis is certainly not limited to a single pass, as
> it will test more dependencies on the fly after e.g. creating bookkeeping.
> 
> Was there some particular breakage you had in mind when mentioning that
> INSN_CONDs may break in other ways?

Well, sched-deps expects that we walk the insns sequentially, setting
INSN_COND when an insn is seen for the first time, and then setting it
to const_true_rtx once the condition is no longer valid for mutex_p
comparisons.

> Can you tell why you chose to place INSN_CONDs into HDID instead of HID?

It's only used in sched-deps.c, during the scan.

> FWIW, we have a patch that adds predication support for the selective
> scheduler (allowing the scheduler to transform insns into predicated form)
> that we plan to submit during this stage1.

I have such a patch for sched-ebb.


Bernd


libobjc: remove deprecated API (patch 5)

2011-06-03 Thread Nicola Pero
This patch removes objc/hash.h and objc/sarray.h, which had been deprecated in 
GCC 4.6.0.

Of course, libobjc still has its own private versions, but they are (finally!) 
private
so we have made another step towards being able to change the libobjc internals 
at will
without having to change the public API. :-)

Committed to trunk.

Thanks

Index: libobjc/Makefile.in
===
--- libobjc/Makefile.in (revision 174594)
+++ libobjc/Makefile.in (working copy)
@@ -122,10 +122,7 @@ OBJC_H = \
   objc-api.h \
   objc-decls.h \
   runtime.h \
-  thr.h \
-  \
-  hash.h \
-  sarray.h
+  thr.h
 
 # User-visible header files containing deprecated APIs, from the
 # objc/deprecated directory
@@ -135,14 +132,12 @@ OBJC_DEPRECATED_H = \
   Object.h \
   Protocol.h \
   STR.h \
-  hash.h \
   objc_get_uninstalled_dtable.h \
   objc_malloc.h \
   objc_msg_sendv.h \
   objc_object_alloc.h \
   objc_unexpected_exception.h \
   objc_valloc.h \
-  sarray.h \
   struct_objc_category.h \
   struct_objc_class.h \
   struct_objc_ivar.h \
Index: libobjc/objc-private/common.h
===
--- libobjc/objc-private/common.h   (revision 174593)
+++ libobjc/objc-private/common.h   (working copy)
@@ -28,11 +28,6 @@ see the files COPYING3 and COPYING.RUNTIME respect
 /* This file contains definitions that should be included by all .c
and .m files in libobjc.  */
 
-/* This variable allows the public headers to determine when they are
-   being included by a file inside libobjc itself, or when they are
-   being included by an external file.  */
-#define GNU_LIBOBJC_COMPILING_LIBOBJC_ITSELF 1
-
 /* When debugging libobjc, add
 
#define DEBUG 1
Index: libobjc/libobjc.def
===
--- libobjc/libobjc.def (revision 174593)
+++ libobjc/libobjc.def (working copy)
@@ -23,8 +23,6 @@ LIBRARY libobjc
 EXPORTS
 search_for_method_in_list
 objc_get_uninstalled_dtable
-objc_hash_is_key_in_hash
-hash_is_key_in_hash
 _objc_load_callback
 objc_malloc
 objc_atomic_malloc
@@ -106,22 +104,3 @@ objc_get_class
 objc_get_meta_class
 objc_lookup_class
 objc_next_class
-sarray_at_put
-sarray_at_put_safe
-sarray_free
-sarray_lazy_copy
-sarray_new
-sarray_realloc
-sarray_remove_garbage
-objc_hash_add
-hash_add
-objc_hash_delete
-hash_delete
-objc_hash_new
-hash_new
-objc_hash_next
-hash_next
-objc_hash_remove
-hash_remove
-objc_hash_value_for_key
-hash_value_for_key
Index: libobjc/ChangeLog
===
--- libobjc/ChangeLog   (revision 174607)
+++ libobjc/ChangeLog   (working copy)
@@ -1,5 +1,25 @@
 2011-06-03  Nicola Pero  
 
+   * Makefile.in (OBJC_H): Removed hash.h and sarray.h.
+   (OBJC_DEPRECATED_H): Likewise.
+   * libobjc.def (objc_hash_new, objc_hash_delete, objc_hash_add,
+   objc_hash_remove, objc_hash_next, objc_hash_value_for_key,
+   objc_hash_is_key_in_hash, hash_add, hash_delete, hash_new,
+   hash_next, hash_remove, hash_value_for_key, hash_is_key_in_hash,
+   sarray_at_put, sarray_at_put_safe, sarray_free, sarray_lazy_copy,
+   sarray_new, sarray_realloc, sarray_remove_garbage): Removed.
+   * objc/sarray.h: Removed.
+   * objc/hash.h: Removed.
+   * objc/deprecated/sarray.h: Removed.
+   * objc/deprecated/hash.h: Removed.
+   * objc/Object.h: Do not include objc/deprecated/hash.h
+   * Object.m: Include string.h.
+   * objc/objc-api.h: Do not include objc/deprecated/hash.h.
+   * objc-private/common.h (GNU_LIBOBJC_COMPILING_LIBOBJC_ITSELF):
+   Removed.
+
+2011-06-03  Nicola Pero  
+
* Object.m ([-forward::]): Removed.
* objc/deprecated/Object.h ([-forward::]): Removed.
* sendmsg.c (__objc_forward): Updated comments.
Index: libobjc/Object.m
===
--- libobjc/Object.m(revision 174607)
+++ libobjc/Object.m(working copy)
@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respect
 
 #include "objc-private/common.h"
 #include 
+#include  /* For strcmp.  */
 #include 
 #include "objc/Object.h"
 #include "objc/Protocol.h"
Index: libobjc/objc/sarray.h
===
--- libobjc/objc/sarray.h   (revision 174593)
+++ libobjc/objc/sarray.h   (working copy)
@@ -1,2 +0,0 @@
-#include "deprecated/sarray.h"
-
Index: libobjc/objc/Object.h
===
--- libobjc/objc/Object.h   (revision 174593)
+++ libobjc/objc/Object.h   (working copy)
@@ -57,7 +57,6 @@ extern "C" {
 
 /* All of the following includes were deprecated in GCC 4.6 and will
be removed in the next release.  */
-#include "deprecated/hash.h"
 #include "deprecated/Object.h"
 
 #ifdef __cplusplus
Index: libobjc/objc/deprecated/sarray.h
==

Re: Initialize INSN_COND (was: C6X port 5/11: Track predication conditions more accurately)

2011-06-03 Thread Steve Ellcey


> Note that I am using r174594 sources with your patch *AND* with the patch
> Bernd proposed for PR 48673 
> (http://gcc.gnu.org/ml/gcc-patches/2011-05/msg02470.html).
> So this regression may be due to the other change.  I will look into it some
> more to see if I can figure out which change is causing this regression.  I 
> did not
> see any other regressions.
> 
> Steve Ellcey
> s...@cup.hp.com

Alexander,

Following up to my own email, removing Bernd's patch for PR 48673 did
not make this failure go away.  But Bernd's patch does fix the
gfortran.dg/sms-* failures I reported in PR 48673 so unless you or
Andrey have an objection to it, I would like to approve that patch for
checkin.

Steve Ellcey
s...@cup.hp.com




Re: [build] Move MD_UNWIND_SUPPORT to toplevel libgcc

2011-06-03 Thread Mike Stump
On Jun 3, 2011, at 7:35 AM, Rainer Orth wrote:
> Apart from those changes, the patch addresses the PowerPC Darwin and
> Windows32 issues as suggested:

Darwin bits: Ok.


Ping:Re: Skip building target libiberty for arm*-*-linux-androideabi

2011-06-03 Thread Jing Yu
Ping.
http://gcc.gnu.org/ml/gcc-patches/2011-05/msg02208.html

On Tue, May 31, 2011 at 11:32 AM, Jing Yu  wrote:
> Based on discussion on another thread
> (http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg06627.html),
> what Joseph recommended was ripping out all support for building
> libiberty for the target side as it is not needed. Thus I doubt
> skipping target-libiberty for all targets is acceptable.
> I don't have the bandwidth to work on the ideal patch. Thus I am
> wondering if we can skip target-libiberty for androideabi target
> before the ideal patch is out.
>
> Thanks,
> Jing
>
> On Sun, May 29, 2011 at 9:23 PM, Ye Joey  wrote:
>> On Sat, May 28, 2011 at 5:42 AM, Jing Yu  wrote:
>>>
>>>  Building gcc-4.6 arm android toolchain fails because of an
>>> incompatible function definition between libiberty and bionic.
>>>
>>> Thanking Joseph, I have learned that "there's no such thing as a
>>> target libiberty" and we should rip all the target-libiberty rules
>>> out. I don't know if someone is working on it. Before that patch comes
>>> out, can we add arm*-*-linux-androideabi to the list of targets where
>>> target-libiberty is skipped?
>>>
>> How about skip libiberty for all targets then?
>>
>> - Joey
>


Re: [PING] [PATCH] PR preprocessor/48532 (Wrong location in pragma involving macros)

2011-06-03 Thread Tom Tromey
> "Dodji" == Dodji Seketeli  writes:

Dodji> I am pinging this patch first posted to
Dodji> http://gcc.gnu.org/ml/gcc-patches/2011-04/msg00697.html.

Thanks, and sorry for not noticing earlier.

Dodji> +context of 'P'.  The problem is, if we are beeing

Typo, "being".

Ok with that fixed.

Tom


Re: Ping:Re: Skip building target libiberty for arm*-*-linux-androideabi

2011-06-03 Thread DJ Delorie

> Ping.
> http://gcc.gnu.org/ml/gcc-patches/2011-05/msg02208.html
> 
> > I don't have the bandwidth to work on the ideal patch. Thus I am
> > wondering if we can skip target-libiberty for androideabi target
> > before the ideal patch is out.

Target-specific changes in the build are up to the target maintainers.


Re: don't force debug insns after their PREV_INSNs

2011-06-03 Thread Bernd Schmidt
On 06/03/2011 04:47 PM, Alexandre Oliva wrote:
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=677681 can be
> “fixed” by disabling the artificial dependency of a debug insn on its
> previous insn.
> 
> Debug insns will often depend on their prevs anyway, in a use/def
> relationship, but if the def was (re)moved or the use was reset, this
> artificial dep helped keep the debug insn “in place”.
> 
> Being a very imperfect heuristic, it's not clear that it helps more than
> it harms.  Thoughts?  Regstrapped on x86_64-linux-gnu and
> i686-linux-gnu.

Can you explain a little more clearly what the problem is? The RH
bugzilla isn't really clear.


Bernd



[C++ PATCH] Fix a C++ mangling ICE due to TRANSLATION_UNIT_DECL (PR c++/49276)

2011-06-03 Thread Jakub Jelinek
Hi!

This testcase got broken by the
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164719
changes, before that it really didn't matter at that spot
if DECL_CONTEXT or CP_DECL_CONTEXT is used, as write_prefix
immediately returns for both NULL and global_namespace.
But when DECL_CONTEXT is TRANSLATION_UNIT_DECL, we still want to call
write_prefix with NULL or global_namespace instead.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
ok for trunk/4.6?

2011-06-03  Jakub Jelinek  

PR c++/49276
* mangle.c (write_nested_name): Use CP_DECL_CONTEXT instead of
DECL_CONTEXT.

* g++.dg/cpp0x/lambda/lambda-mangle2.C: New test.

--- gcc/cp/mangle.c.jj  2011-05-31 08:03:00.0 +0200
+++ gcc/cp/mangle.c 2011-06-03 15:47:42.0 +0200
@@ -1,6 +1,6 @@
 /* Name mangling for the 3.0 C++ ABI.
-   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
-   Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
+   2011  Free Software Foundation, Inc.
Written by Alex Samuel 
 
This file is part of GCC.
@@ -943,7 +943,7 @@ write_nested_name (const tree decl)
   else
 {
   /* No, just use   */
-  write_prefix (DECL_CONTEXT (decl));
+  write_prefix (CP_DECL_CONTEXT (decl));
   write_unqualified_name (decl);
 }
   write_char ('E');
--- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle2.C.jj   2011-06-03 
16:44:26.0 +0200
+++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle2.C  2011-06-03 
16:45:59.0 +0200
@@ -0,0 +1,21 @@
+// PR c++/49276
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+template 
+struct F
+{
+  template  F (U);
+};
+
+struct S
+{
+  void foo (F <0> x = [] {}) {}
+};
+
+int
+main ()
+{
+  S s;
+  s.foo ();
+}

Jakub


libobjc: remove deprecate API (patch 6)

2011-06-03 Thread Nicola Pero
This trivial patch removes the deprecated definition of STR.

Committed to trunk.

Thanks

Index: Makefile.in
===
--- Makefile.in (revision 174610)
+++ Makefile.in (working copy)
@@ -131,7 +131,6 @@
   MetaClass.h \
   Object.h \
   Protocol.h \
-  STR.h \
   objc_get_uninstalled_dtable.h \
   objc_malloc.h \
   objc_msg_sendv.h \
Index: ChangeLog
===
--- ChangeLog   (revision 174610)
+++ ChangeLog   (working copy)
@@ -1,5 +1,11 @@
 2011-06-03  Nicola Pero  
 
+   * objc/objc.h: Do not include deprecated/STR.h.
+   * objc/deprecated/STR.h: Removed.
+   * Makefile.in (OBJC_DEPRECATED_H): removed STR.h.
+
+2011-06-03  Nicola Pero  
+
* Makefile.in (OBJC_H): Removed hash.h and sarray.h.
(OBJC_DEPRECATED_H): Likewise.
* libobjc.def (objc_hash_new, objc_hash_delete, objc_hash_add,
Index: objc/deprecated/STR.h
===
--- objc/deprecated/STR.h   (revision 174593)
+++ objc/deprecated/STR.h   (working copy)
@@ -1,2 +0,0 @@
-/* Incredibly obsolete.  */
-typedef char *STR;  /* String alias */
Index: objc/objc.h
===
--- objc/objc.h (revision 174593)
+++ objc/objc.h (working copy)
@@ -125,8 +125,6 @@
compiler to do some type-checking.  */
 #define Nil (Class)0
 
-#include "deprecated/STR.h"
-
 /* TODO: Move the 'Protocol' declaration into objc/runtime.h.  A
Protocol is simply an object, not a basic Objective-C type.  The
Apple runtime defines Protocol in objc/runtime.h too, so it's good




Re: Ping:Re: Skip building target libiberty for arm*-*-linux-androideabi

2011-06-03 Thread Jing Yu
ARM maintainers,

Is it ok to skip building target-libiberty for arm*-*-linux-androideabi target?
http://gcc.gnu.org/ml/gcc-patches/2011-05/msg02208.html

Thanks,
Jing

On Fri, Jun 3, 2011 at 11:26 AM, DJ Delorie  wrote:
>
>> Ping.
>> http://gcc.gnu.org/ml/gcc-patches/2011-05/msg02208.html
>>
>> > I don't have the bandwidth to work on the ideal patch. Thus I am
>> > wondering if we can skip target-libiberty for androideabi target
>> > before the ideal patch is out.
>
> Target-specific changes in the build are up to the target maintainers.
>


libobjc: remove deprecated API (patch 7)

2011-06-03 Thread Nicola Pero
This patch removes another bunch of deprecated functions and hooks from libobjc,
in particular objc_valloc(), the various _objc_alloc and similar hooks and the
_objc_unexpected_exception hook.

Committed to trunk.

Thanks

Index: Makefile.in
===
--- Makefile.in (revision 174614)
+++ Makefile.in (working copy)
@@ -132,11 +132,8 @@ OBJC_DEPRECATED_H = \
   Object.h \
   Protocol.h \
   objc_get_uninstalled_dtable.h \
-  objc_malloc.h \
   objc_msg_sendv.h \
   objc_object_alloc.h \
-  objc_unexpected_exception.h \
-  objc_valloc.h \
   struct_objc_category.h \
   struct_objc_class.h \
   struct_objc_ivar.h \
@@ -268,16 +265,14 @@ sendmsg_gc.lo: sendmsg.c runtime-info.h
 # These files have separate rules because they require special
 # compiler flags.
 
-# -Wno-deprecated-declarations is to silence warnings from using 
-# _objc_unexpected_exception.
 exception.lo: exception.c
$(LIBTOOL_COMPILE) $(CC) $< -c \
-  $(ALL_CFLAGS) $(INCLUDES) -fexceptions -Wno-deprecated-declarations \
+  $(ALL_CFLAGS) $(INCLUDES) -fexceptions \
   -o $@
 
 exception_gc.lo: exception.c
$(LIBTOOL_COMPILE) $(CC) $< -c \
-  $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions 
-Wno-deprecated-declarations \
+  $(ALL_CFLAGS) $(INCLUDES) $(OBJC_GCFLAGS) -fexceptions \
   -o $@
 
 doc: info dvi pdf html
Index: libobjc.def
===
--- libobjc.def (revision 174610)
+++ libobjc.def (working copy)
@@ -26,7 +26,6 @@ objc_get_uninstalled_dtable
 _objc_load_callback
 objc_malloc
 objc_atomic_malloc
-objc_valloc
 objc_realloc
 objc_calloc
 objc_free
@@ -36,7 +35,6 @@ objc_mutex_deallocate
 objc_mutex_lock
 objc_mutex_trylock
 objc_mutex_unlock
-_objc_unexpected_exception
 objc_thread_detach
 objc_thread_exit
 objc_thread_get_data
Index: exception.c
===
--- exception.c (revision 174593)
+++ exception.c (working copy)
@@ -31,12 +31,6 @@ see the files COPYING3 and COPYING.RUNTIME respect
 #include "unwind-pe.h"
 #include  /* For memcpy */
 
-/* This hook allows libraries to sepecify special actions when an
-   exception is thrown without a handler in place.  This is deprecated
-   in favour of objc_set_uncaught_exception_handler ().  */
-void (*_objc_unexpected_exception) (id exception); /* !T:SAFE */
-
-
 /* 'is_kind_of_exception_matcher' is our default exception matcher -
it determines if the object 'exception' is of class 'catch_class',
or of a subclass.  */
@@ -539,13 +533,6 @@ objc_exception_throw (id exception)
   (*__objc_uncaught_exception_handler) (exception);
 }
 
-  /* As a last resort support the old, deprecated way of setting an
- uncaught exception handler.  */
-  if (_objc_unexpected_exception != 0)
-{
-  (*_objc_unexpected_exception) (exception);
-}
-
   abort ();
 }
 
Index: ChangeLog
===
--- ChangeLog   (revision 174614)
+++ ChangeLog   (working copy)
@@ -1,5 +1,24 @@
 2011-06-03  Nicola Pero  
 
+   * Makefile.in (OBJC_DEPRECATED_H): Removed objc_valloc.h,
+   objc_malloc.h and objc_unexpected_exception.h.
+   (exception.lo): Do not use -Wno-deprecated-declarations.
+   (exception_gc.lo): Likewise.
+   * objc/objc-api.h: Do not include deprecated/objc_valloc.h,
+   deprecated/objc_malloc.h and
+   deprecated/objc_unexpected_exception.h.
+   * objc/deprecated/objc_valloc.h: Removed.
+   * objc/deprecated/objc_malloc.h: Removed.
+   * objc/deprecated/objc_unexpected_exception.h: Removed.
+   * exception.c (_objc_unexpected_exception): Removed.
+   (objc_exception_throw): Do not check for
+   _objc_unexpected_exception.
+   * memory.c (objc_valloc, _objc_malloc, _objc_atomic_malloc,
+   _objc_valloc, _objc_realloc, _objc_calloc, _objc_free): Removed.
+   * libobjc.def (_objc_unexpected_exception, objc_valloc): Removed.
+   
+2011-06-03  Nicola Pero  
+
* objc/objc.h: Do not include deprecated/STR.h.
* objc/deprecated/STR.h: Removed.
* Makefile.in (OBJC_DEPRECATED_H): removed STR.h.
Index: memory.c
===
--- memory.c(revision 174593)
+++ memory.c(working copy)
@@ -133,38 +133,3 @@ objc_free (void *mem)
 }
 
 #endif /* !OBJC_WITH_GC */
-
-/* The rest of the file contains deprecated code.  */
-
-#if OBJC_WITH_GC
-
-void *
-objc_valloc (size_t size)
-{
-  void *res = (void *)(GC_malloc (size));
-  if (! res)
-_objc_abort ("Virtual memory exhausted\n");
-  return res;
-}
-
-#else
-
-void *
-objc_valloc (size_t size)
-{
-  void *res = (void *)(malloc (size));
-  if (! res)
-_objc_abort ("Virtual memory exhausted\n");
-  return res;
-}
-
-#endif /* !OBJC_WITH_GC */
-
-/* Hook functions for memory allocation and disposal. 

Re: [PATCH][PING][Revised] fix --enable-build-with-cxx on darwin]

2011-06-03 Thread Mike Stump
On Jun 3, 2011, at 9:25 AM, Jack Howarth wrote:
>   Could someone commit this patch, which was already approved in

Done.


libobjc: remove deprecated API (patch 8)

2011-06-03 Thread Nicola Pero
This patch removes the deprecated definition of METHOD_NULL.

Committed to trunk.

Thanks

Index: Makefile.in
===
--- Makefile.in (revision 174615)
+++ Makefile.in (working copy)
@@ -127,7 +127,6 @@ OBJC_H = \
 # User-visible header files containing deprecated APIs, from the
 # objc/deprecated directory
 OBJC_DEPRECATED_H = \
-  METHOD_NULL.h \
   MetaClass.h \
   Object.h \
   Protocol.h \
Index: ChangeLog
===
--- ChangeLog   (revision 174615)
+++ ChangeLog   (working copy)
@@ -1,5 +1,11 @@
 2011-06-03  Nicola Pero  
 
+   * Makefile.in (OBJC_DEPRECATED_H): Removed METHOD_NULL.h.
+   * objc/objc-api.h: Do not include deprecated/METHOD_NULL.h.
+   * objc/deprecated/METHOD_NULL.h: Removed.
+   
+2011-06-03  Nicola Pero  
+
* Makefile.in (OBJC_DEPRECATED_H): Removed objc_valloc.h,
objc_malloc.h and objc_unexpected_exception.h.
(exception.lo): Do not use -Wno-deprecated-declarations.
Index: objc/deprecated/METHOD_NULL.h
===
--- objc/deprecated/METHOD_NULL.h   (revision 174593)
+++ objc/deprecated/METHOD_NULL.h   (working copy)
@@ -1,2 +0,0 @@
-/* For functions which return Method_t */
-#define METHOD_NULL(Method_t)0
Index: objc/objc-api.h
===
--- objc/objc-api.h (revision 174615)
+++ objc/objc-api.h (working copy)
@@ -58,8 +58,6 @@ see the files COPYING3 and COPYING.RUNTIME respect
 extern "C" {
 #endif /* __cplusplus */
 
-#include "deprecated/METHOD_NULL.h"
-
 /* Method descriptor returned by introspective Object methods.
This is really just the first part of the more complete objc_method
structure defined below and used internally by the runtime.  */




Re: [testsuite] Run TLS torture tests with -fpic etc.

2011-06-03 Thread Rainer Orth
Rainer Orth  writes:

> As suggested by Joseph, the gcc.dg/torture/tls tests should be run with
> -fpic/-fPIC and -fpie/-fPIE if supported.
>
> The patch below implements part of this.  Unlike
> gcc.dg/torture/stackalign/stackalign.exp, I'm using the code below to
> add -fpic etc. to the torture options so it shows up in gcc.sum.
>
> Unfortunately, I have no idea how to properly test if -fpie/-fPIE is
> supported.  Jakub, do you have a suggestion?  Such a test could (and

Jakub, any suggestion how to properly test for -fpie/-fPIE support?
Otherwise, I'll remove that part of the patch for now and just commit
the -fpic/-fPIC one.

> probably should) be used in the few tests we currently have for -fpie:
>
> gcc.dg/tls/pie-1.c, gcc.dg/pie-link.c, gcc.target/i386/pr39013-[12].c
>
> Bootstrapped without regression on i386-pc-solaris2.11.
>
> Will install on mainline unless someone objects once the -fpie test has
> been fixed.
>
>   Rainer
>
>
> 2011-05-28  Rainer Orth  
>
>   * lib/target-supports.exp (check_effective_target_fpie): New proc.
>   * gcc.dg/torture/tls/tls.exp: Load torture-options.exp.
>   Run tests with -fpic/-fPIC, -fpie/-fPIE if supported.
>
> diff --git a/gcc/testsuite/gcc.dg/torture/tls/tls.exp 
> b/gcc/testsuite/gcc.dg/torture/tls/tls.exp
> --- a/gcc/testsuite/gcc.dg/torture/tls/tls.exp
> +++ b/gcc/testsuite/gcc.dg/torture/tls/tls.exp
> @@ -1,4 +1,4 @@
> -#   Copyright (C) 2010 Free Software Foundation, Inc.
> +# Copyright (C) 2010, 2011 Free Software Foundation, Inc.
>  
>  # This program is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
> @@ -18,6 +18,7 @@
>  
>  # Load support procs.
>  load_lib gcc-dg.exp
> +load_lib torture-options.exp
>  
>  # If a testcase doesn't have special options, use these.
>  global DEFAULT_CFLAGS
> @@ -25,12 +26,32 @@ if ![info exists DEFAULT_CFLAGS] then {
>  set DEFAULT_CFLAGS " -ansi -pedantic-errors"
>  }
>  
> +global DG_TORTURE_OPTIONS LTO_TORTURE_OPTIONS
> +set TLS_TORTURE_OPTIONS $DG_TORTURE_OPTIONS
> +if { [check_effective_target_fpic] } then {
> +foreach pic {fpic fPIC} {
> + foreach option $DG_TORTURE_OPTIONS {
> + lappend TLS_TORTURE_OPTIONS "$option -$pic"
> + }
> +}
> +}
> +if { [check_effective_target_fpie] } then {
> +foreach pie {fpie fPIE} {
> + foreach option $DG_TORTURE_OPTIONS {
> + lappend TLS_TORTURE_OPTIONS "$option -$pie"
> + }
> +}
> +}
> +
>  # Initialize `dg'.
>  dg-init
> +torture-init
> +set-torture-options $TLS_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS
>  
>  # Main loop.
>  gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
>  $DEFAULT_CFLAGS
>  
>  # All done.
> +torture-finish
>  dg-finish
> diff --git a/gcc/testsuite/lib/target-supports.exp 
> b/gcc/testsuite/lib/target-supports.exp
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -788,6 +788,18 @@ proc check_effective_target_fpic { } {
>  return 0
>  }
>  
> +# Return 1 if -fpie and -fPIE are supported, as in no warnings or errors
> +# emitted, 0 otherwise.
> +
> +proc check_effective_target_fpie { } {
> +if [check_no_compiler_messages fpie executable {
> + int main (void) { return 0; }
> +} "-fpie"] {
> + return 1
> +}
> +return 0
> +}
> +
>  # Return true if the target supports -mpaired-single (as used on MIPS).
>  
>  proc check_effective_target_mpaired_single { } {

-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


libobjc: remove deprecated API (patch 9)

2011-06-03 Thread Nicola Pero
This patch removes more deprecated and obsolete hooks/functions from libobjc.

Committed to trunk.

Thanks

Index: Makefile.in
===
--- Makefile.in (revision 174616)
+++ Makefile.in (working copy)
@@ -132,7 +132,6 @@ OBJC_DEPRECATED_H = \
   Protocol.h \
   objc_get_uninstalled_dtable.h \
   objc_msg_sendv.h \
-  objc_object_alloc.h \
   struct_objc_category.h \
   struct_objc_class.h \
   struct_objc_ivar.h \
Index: libobjc.def
===
--- libobjc.def (revision 174615)
+++ libobjc.def (working copy)
@@ -48,9 +48,6 @@ objc_thread_remove
 __objc_class_name_Object
 __objc_class_name_Protocol
 __objc_class_name_NXConstantString
-__objc_object_alloc
-__objc_object_copy
-__objc_object_dispose
 class_create_instance
 object_copy
 object_dispose
Index: objects.c
===
--- objects.c   (revision 174593)
+++ objects.c   (working copy)
@@ -123,8 +123,3 @@ object_setClass (id object, Class class_)
 }
 }
 
-/* Hook functions for memory allocation and disposal.  Deprecated and
-   currently unused.  */
-id (*_objc_object_alloc) (Class)   = 0;
-id (*_objc_object_dispose) (id)= 0;
-id (*_objc_object_copy) (id)   = 0;
Index: ChangeLog
===
--- ChangeLog   (revision 174616)
+++ ChangeLog   (working copy)
@@ -1,5 +1,15 @@
 2011-06-03  Nicola Pero  
 
+   * Makefile.in (OBJC_DEPRECATED_H): Removed objc_object_alloc.h.
+   * objc/deprecated/objc_object_alloc.h: Removed.
+   * objc/objc-api.h: Do not include deprecated/objc_object_alloc.h.
+   * objects.c (_objc_object_alloc, _objc_object_dispose,
+   _objc_object_copy): Removed.
+   * libobjc.def (__objc_object_alloc, __objc_object_copy,
+   __objc_object_dispose): Removed.
+   
+2011-06-03  Nicola Pero  
+
* Makefile.in (OBJC_DEPRECATED_H): Removed METHOD_NULL.h.
* objc/objc-api.h: Do not include deprecated/METHOD_NULL.h.
* objc/deprecated/METHOD_NULL.h: Removed.
Index: objc/deprecated/objc_object_alloc.h
===
--- objc/deprecated/objc_object_alloc.h (revision 174593)
+++ objc/deprecated/objc_object_alloc.h (working copy)
@@ -1,8 +0,0 @@
-/* These functions are deprecated and currently ignored.  */
-/*
-** Hook functions for allocating, copying and disposing of instances
-*/
-objc_EXPORT id (*_objc_object_alloc)(Class _class);Index: objc/objc-api.h
===
--- objc/objc-api.h (revision 174616)
+++ objc/objc-api.h (working copy)
@@ -191,8 +191,6 @@ objc_EXPORT Class (*_objc_lookup_class)(const char
 */
 objc_EXPORT void (*_objc_load_callback)(Class _class, Category* category);
 
-#include "deprecated/objc_object_alloc.h"
-
 /*
   Standard functions for memory allocation and disposal.  Users should
   use these functions in their ObjC programs so that they work so that

-objc_EXPORT id (*_objc_object_copy)(id object);
-objc_EXPORT id (*_objc_object_dispose)(id object);
-




Re: [testsuite] Run TLS torture tests with -fpic etc.

2011-06-03 Thread Jakub Jelinek
On Fri, Jun 03, 2011 at 09:38:31PM +0200, Rainer Orth wrote:
> Rainer Orth  writes:
> Jakub, any suggestion how to properly test for -fpie/-fPIE support?
> Otherwise, I'll remove that part of the patch for now and just commit
> the -fpic/-fPIC one.

You want to compile/link the program with -pie -fpie rather than just -fpie,
if it links, otherwise you are testing just linking PIC code into normal
executables.

Jakub


libobjc: remove deprecated API (patch 10)

2011-06-03 Thread Nicola Pero
This patch removes another couple of deprecated header fragments.  Note that 
this
starts to remove pieces of the Traditional API, which will be entirely removed
in GCC 4.7.0.  Of course, that requires switching all testcases to use the 
Modern
API when compiling for the GNU runtime, but we'll get there. ;-)

Committed to trunk.

Thanks

Index: Makefile.in
===
--- Makefile.in (revision 174617)
+++ Makefile.in (working copy)
@@ -130,7 +130,6 @@
   MetaClass.h \
   Object.h \
   Protocol.h \
-  objc_get_uninstalled_dtable.h \
   objc_msg_sendv.h \
   struct_objc_category.h \
   struct_objc_class.h \
@@ -142,7 +141,6 @@
   struct_objc_protocol.h \
   struct_objc_protocol_list.h \
   struct_objc_selector.h \
-  struct_objc_static_instances.h \
   struct_objc_symtab.h
 
 # Objective-C source files to compile
Index: ChangeLog
===
--- ChangeLog   (revision 174617)
+++ ChangeLog   (working copy)
@@ -1,5 +1,14 @@
 2011-06-03  Nicola Pero  
 
+   * Makefile.in (OBJC_DEPRECATED_H): Removed 
struct_objc_static_instances.h
+   and objc_get_uninstalled_dtable.h.
+   * objc/deprecated/struct_objc_static_instances.h: Removed.
+   * objc/deprecated/objc_get_uninstalled_dtable.h: Removed.   
+   * objc/objc-api.h: Do not include deprecated/objc_static_instances.h
+   and deprecated/objc_get_uninstalled_dtable.h.
+   
+2011-06-03  Nicola Pero  
+
* Makefile.in (OBJC_DEPRECATED_H): Removed objc_object_alloc.h.
* objc/deprecated/objc_object_alloc.h: Removed.
* objc/objc-api.h: Do not include deprecated/objc_object_alloc.h.
Index: objc/deprecated/objc_get_uninstalled_dtable.h
===
--- objc/deprecated/objc_get_uninstalled_dtable.h   (revision 174593)
+++ objc/deprecated/objc_get_uninstalled_dtable.h   (working copy)
@@ -1,2 +0,0 @@
-objc_EXPORT struct sarray* 
-objc_get_uninstalled_dtable(void);
Index: objc/deprecated/struct_objc_static_instances.h
===
--- objc/deprecated/struct_objc_static_instances.h  (revision 174593)
+++ objc/deprecated/struct_objc_static_instances.h  (working copy)
@@ -1,14 +0,0 @@
-/* For every class which happens to have statically allocated instances in
-   this module, one OBJC_STATIC_INSTANCES is allocated by the compiler.
-   INSTANCES is NULL terminated and points to all statically allocated
-   instances of this class.  */
-struct objc_static_instances
-{
-  char *class_name;
-#ifdef __cplusplus
-  id instances[1];
-#else
-  id instances[0];
-#endif
-};
-
Index: objc/objc-api.h
===
--- objc/objc-api.h (revision 174617)
+++ objc/objc-api.h (working copy)
@@ -104,7 +104,6 @@
equivalent to "*".  */
 #define _C_ATOM '%'
 
-#include "deprecated/struct_objc_static_instances.h"
 #include "deprecated/struct_objc_symtab.h"
 #include "deprecated/struct_objc_module.h"
 #include "deprecated/struct_objc_ivar.h"
@@ -385,8 +384,6 @@
  &&  !object_is_class (object));
 }
 
-#include "deprecated/objc_get_uninstalled_dtable.h"
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */




Re: [C++ PATCH] Fix a C++ mangling ICE due to TRANSLATION_UNIT_DECL (PR c++/49276)

2011-06-03 Thread Jason Merrill
Ok.

Jakub Jelinek  wrote:

Hi!

This testcase got broken by the
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164719
changes, before that it really didn't matter at that spot
if DECL_CONTEXT or CP_DECL_CONTEXT is used, as write_prefix
immediately returns for both NULL and global_namespace.
But when DECL_CONTEXT is TRANSLATION_UNIT_DECL, we still want to call
write_prefix with NULL or global_namespace instead.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
ok for trunk/4.6?

2011-06-03  Jakub Jelinek  

PR c++/49276
* mangle.c (write_nested_name): Use CP_DECL_CONTEXT instead of
DECL_CONTEXT.

* g++.dg/cpp0x/lambda/lambda-mangle2.C: New test.

--- gcc/cp/mangle.c.jj  2011-05-31 08:03:00.0 +0200
+++ gcc/cp/mangle.c 2011-06-03 15:47:42.0 +0200
@@ -1,6 +1,6 @@
 /* Name mangling for the 3.0 C++ ABI.
-   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
-   Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
+   2011  Free Software Foundation, Inc.
Written by Alex Samuel 
 
This file is part of GCC.
@@ -943,7 +943,7 @@ write_nested_name (const tree decl)
   else
 {
   /* No, just use   */
-  write_prefix (DECL_CONTEXT (decl));
+  write_prefix (CP_DECL_CONTEXT (decl));
   write_unqualified_name (decl);
 }
   write_char ('E');
--- gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle2.C.jj   2011-06-03 
16:44:26.0 +0200
+++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle2.C  2011-06-03 
16:45:59.0 +0200
@@ -0,0 +1,21 @@
+// PR c++/49276
+// { dg-do compile }
+// { dg-options "-std=c++0x" }
+
+template 
+struct F
+{
+  template  F (U);
+};
+
+struct S
+{
+  void foo (F <0> x = [] {}) {}
+};
+
+int
+main ()
+{
+  S s;
+  s.foo ();
+}

Jakub


Re: [PATCH] c-pragma: adding a data field to pragma_handler

2011-06-03 Thread Pierre Vittet

Hello,

I am sorry, my editor (vim) was not correctly configure (I used 
http://gcc.gnu.org/ml/gcc/2011-03/msg00425.html to improve it). I guess 
it is ok now.
If I still have issue, I will post on the mailing list if there is some 
tips for vim otherway I will use Emacs (I am not very comfortable with 
it for now ;).


Pierre Vittet

On 03/06/2011 17:47, Basile Starynkevitch wrote:

On Fri, 03 Jun 2011 17:31:25 +0200
Pierre Vittet  wrote:

   

Thank you for your answer!

I send you a new patch
I have corrected the errors you raised.

I have make my patch compatible with the old use of c_register_pragma
and c_register_pragma_with_expansion.
 

I find the patch quite interesting, but I cannot approve it.

  void
+c_register_pragma_with_expansion_and_data (const char *space, const char *name,
+  
pragma_handler_2arg handler,
+   void * data)

Perhaps there are some spaces (vs tabs) issues here.

Cheers
   


Index: gcc/c-family/c-pragma.c
===
--- gcc/c-family/c-pragma.c (revision 174521)
+++ gcc/c-family/c-pragma.c (working copy)
@@ -1148,12 +1148,12 @@ handle_pragma_float_const_decimal64 (cpp_reader *A
 }
 
 /* A vector of registered pragma callbacks.  */
+/* This is never freed as we need it during the whole execution.  */
+DEF_VEC_O (internal_pragma_handler);
+DEF_VEC_ALLOC_O (internal_pragma_handler, heap);
 
-DEF_VEC_O (pragma_handler);
-DEF_VEC_ALLOC_O (pragma_handler, heap);
+static VEC(internal_pragma_handler, heap) *registered_pragmas;
 
-static VEC(pragma_handler, heap) *registered_pragmas;
-
 typedef struct
 {
   const char *space;
@@ -1216,7 +1216,7 @@ c_pp_lookup_pragma (unsigned int id, const char **
 
 static void
 c_register_pragma_1 (const char *space, const char *name,
-pragma_handler handler, bool allow_expansion)
+ internal_pragma_handler ihandler, bool allow_expansion)
 {
   unsigned id;
 
@@ -1235,8 +1235,9 @@ c_register_pragma_1 (const char *space, const char
 }
   else
 {
-  VEC_safe_push (pragma_handler, heap, registered_pragmas, &handler);
-  id = VEC_length (pragma_handler, registered_pragmas);
+  VEC_safe_push (internal_pragma_handler, heap, registered_pragmas,
+ &ihandler);
+  id = VEC_length (internal_pragma_handler, registered_pragmas);
   id += PRAGMA_FIRST_EXTERNAL - 1;
 
   /* The C++ front end allocates 6 bits in cp_token; the C front end
@@ -1248,28 +1249,90 @@ c_register_pragma_1 (const char *space, const char
allow_expansion, false);
 }
 
+/* Register a C pragma handler, using a space and a name.  It disallows pragma
+expansion (if you want it, use c_register_pragma_with_expansion instead).  */
 void
-c_register_pragma (const char *space, const char *name, pragma_handler handler)
+c_register_pragma (const char *space, const char *name,
+   pragma_handler_1arg handler)
 {
-  c_register_pragma_1 (space, name, handler, false);
+  internal_pragma_handler ihandler;
+
+  ihandler.handler.handler_1arg = handler;
+  ihandler.extra_data = false;
+  ihandler.data = NULL;
+  c_register_pragma_1 (space, name, ihandler, false);
 }
 
+/* Register a C pragma handler, using a space and a name, it also carries an
+extra data field which can be used by the handler.  It disallows pragma
+expansion (if you want it, use c_register_pragma_with_expansion instead).  */
 void
+c_register_pragma_with_data (const char *space, const char *name,
+ pragma_handler_2arg handler, void * data)
+{
+  internal_pragma_handler ihandler;
+
+  ihandler.handler.handler_2arg = handler;
+  ihandler.extra_data = true;
+  ihandler.data = data;
+  c_register_pragma_1 (space, name, ihandler, false);
+}
+
+/* Register a C pragma handler, using a space and a name.  It allows pragma
+expansion as in the following exemple:
+  #define NUMBER 10
+  #pragma count (NUMBER)
+Name expansion is still disallowed.  */
+void
 c_register_pragma_with_expansion (const char *space, const char *name,
- pragma_handler handler)
+ pragma_handler_1arg handler)
 {
-  c_register_pragma_1 (space, name, handler, true);
+  internal_pragma_handler ihandler;
+
+  ihandler.handler.handler_1arg = handler;
+  ihandler.extra_data = false;
+  ihandler.data = NULL;
+  c_register_pragma_1 (space, name, ihandler, true);
 }
 
+/* Register a C pragma handler, using a space and a name, it also carries an
+extra data field which can be used by the handler.  It allows pragma expansion
+as in the following exemple:
+  #define NUMBER 10
+  #pragma count (NUMBER)
+Name expansion is still disallowed.  */
 void
+c_register_pragma_with_expansion_and_data (const char *space, const char *name,
+   pragma_handler_2arg hand

Re: [pph] Remove all the -fpph flags and pph_catch_... calls that instrumented the incr compiler (issue4559070)

2011-06-03 Thread Diego Novillo
On Thu, Jun 2, 2011 at 21:09, Gabriel Charette  wrote:

> 2011-06-02  Gabriel Charette  
>
>        * gcc/c-family/c.opt (fpph): Remove.
>        Update all users.
>        (fpph-decls): Remove.
>        Update all users.
>        (fpph-decls-debug): Remove.
>        Update all users.
>        (fpph-stats): Remove.
>        Update all users.
>        (fpph-tracer): Remove.
>        Update all users.

Thanks.  This is OK, with some changes:

- I was wrong about -fpph-tracer.  We are still using it, so it needs to stay.
- When removing lang_hooks, you also need to update the main
langhooks.h and langhooks-def.h
- Some removals in cp/ needed a ChangeLog as well.  The connection to
the removal in c-family/c.opt is a bit tenuous, so it's best to add an
entry in cp/ChangeLog.pph.  As with other removals, it is not
necessary to mention everything affected.  Just the functions and
variables that affect others.

I made the above changes and committed all changes after re-testing.


Diego.


Re: [pph] Removing unused timevars following pph instrumentation removal patch (issue4568053)

2011-06-03 Thread Diego Novillo
On Fri, Jun 3, 2011 at 13:28, Gabriel Charette  wrote:

> 2011-06-03  Gabriel Charette  
>
>        * timevar.def (TV_PPH_CACHE_IN): Remove.
>        (TV_PPH_CACHE_OUT): Remove.
>        (TV_PPH_MANAGE): Remove.

OK.  Committed.


Diego.


Re: [patch] add -Wdelete-non-virtual-dtor

2011-06-03 Thread Jason Merrill

On 06/03/2011 04:20 AM, Jonathan Wakely wrote:

On 3 June 2011 02:55, Jason Merrill wrote:



Do we really want to warn about the case where the class has no/trivial
destructor?


I think so.  Definitely if it's an abstract class, since it's
definitely undefined behaviour.  The user might have forgotten to
define the destructor, so the warning would draw their attention to
it.


Makes sense.

Jason


[lto] Unify testing for non-streamable nodes (issue4551094)

2011-06-03 Thread Diego Novillo

As discussed in http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00025.html,
these assertions are no longer needed and they can be unified under
lto_is_streamable (before converting it into a streamer hook).

Tested with LTO profiledbootstrap on x86_64.  Committed to trunk.


Diego.

* lto-streamer-in.c (unpack_value_fields): Remove unneeded asserts.
(lto_input_tree_pointers): Likewise.
* lto-streamer-out.c (pack_value_fields): Likewise.
(lto_output_tree_pointers): Likewise.
* lto-streamer.h (lto_is_streamable): Add check for OMP_CLAUSE
and OPTIMIZATION_NODE.

diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index a0c5509..3a5eb5a 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -1839,24 +1839,6 @@ unpack_value_fields (struct bitpack_d *bp, tree expr)
   if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
 unpack_ts_block_value_fields (bp, expr);
 
-  if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME))
-{
-  /* We only stream the version number of SSA names.  */
-  gcc_unreachable ();
-}
-
-  if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST))
-{
-  /* This is only used by GENERIC.  */
-  gcc_unreachable ();
-}
-
-  if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE))
-{
-  /* This is only used by High GIMPLE.  */
-  gcc_unreachable ();
-}
-
   if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL))
 unpack_ts_translation_unit_decl_value_fields (bp, expr);
 }
@@ -2408,38 +2390,15 @@ lto_input_tree_pointers (struct lto_input_block *ib, 
struct data_in *data_in,
   if (CODE_CONTAINS_STRUCT (code, TS_EXP))
 lto_input_ts_exp_tree_pointers (ib, data_in, expr);
 
-  if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME))
-{
-  /* We only stream the version number of SSA names.  */
-  gcc_unreachable ();
-}
-
   if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
 lto_input_ts_block_tree_pointers (ib, data_in, expr);
 
   if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
 lto_input_ts_binfo_tree_pointers (ib, data_in, expr);
 
-  if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST))
-{
-  /* This should only appear in GENERIC.  */
-  gcc_unreachable ();
-}
-
   if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR))
 lto_input_ts_constructor_tree_pointers (ib, data_in, expr);
 
-  if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE))
-{
-  /* This should only appear in High GIMPLE.  */
-  gcc_unreachable ();
-}
-
-  if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION))
-{
-  sorry ("optimization options not supported yet");
-}
-
   if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
 lto_input_ts_target_option (ib, expr);
 
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 3d42483..66b1ac6 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -589,24 +589,6 @@ pack_value_fields (struct bitpack_d *bp, tree expr)
   if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
 pack_ts_block_value_fields (bp, expr);
 
-  if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME))
-{
-  /* We only stream the version number of SSA names.  */
-  gcc_unreachable ();
-}
-
-  if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST))
-{
-  /* This is only used by GENERIC.  */
-  gcc_unreachable ();
-}
-
-  if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE))
-{
-  /* This is only used by High GIMPLE.  */
-  gcc_unreachable ();
-}
-
   if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL))
 pack_ts_translation_unit_decl_value_fields (bp, expr);
 }
@@ -1251,12 +1233,6 @@ lto_output_tree_pointers (struct output_block *ob, tree 
expr, bool ref_p)
   if (CODE_CONTAINS_STRUCT (code, TS_EXP))
 lto_output_ts_exp_tree_pointers (ob, expr, ref_p);
 
-  if (CODE_CONTAINS_STRUCT (code, TS_SSA_NAME))
-{
-  /* We only stream the version number of SSA names.  */
-  gcc_unreachable ();
-}
-
   if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
 lto_output_ts_block_tree_pointers (ob, expr, ref_p);
 
@@ -1266,21 +1242,6 @@ lto_output_tree_pointers (struct output_block *ob, tree 
expr, bool ref_p)
   if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR))
 lto_output_ts_constructor_tree_pointers (ob, expr, ref_p);
 
-  if (CODE_CONTAINS_STRUCT (code, TS_STATEMENT_LIST))
-{
-  /* This should only appear in GENERIC.  */
-  gcc_unreachable ();
-}
-
-  if (CODE_CONTAINS_STRUCT (code, TS_OMP_CLAUSE))
-{
-  /* This should only appear in High GIMPLE.  */
-  gcc_unreachable ();
-}
-
-  if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION))
-sorry ("gimple bytecode streams do not support the optimization 
attribute");
-
   if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
 lto_output_ts_target_option (ob, expr);
 
diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h
index 9de24ff..5f69655 100644
--- a/gcc/lto-streamer.h
+++ b/gcc/lto-streamer.h
@@ -1081,6 +1081,8 @@ lto_is_streamable (tree expr)
 && code !

Re: [ARM] TLS Descriptor support

2011-06-03 Thread Ramana Radhakrishnan
On 31 May 2011 11:03, Nathan Sidwell  wrote:
> On 05/27/11 01:47, Ramana Radhakrishnan wrote:
>
>> Could you consider adding a check in the configury to test if a binutils
>> version
>> of recent vintage is being used when --with-tls=gnu is in ?
>
> I thought about that and it didn't seem worth it.  We're not autodetecting
> whether to default to gnu-style tls and you'll find out soon enough if your
> binutils is too old.


I noticed this today - and maybe I don't quite understand it yet.

>   /* The + is to avoid an assembly parse ambiguity with symbols that
> +   look like register names, which is unsuccessfully recovered from.  */
> +return TARGET_THUMB2 ? "blx\\t%c0(tlscall)" : "bl\\t+%c0(tlscall)";


How are things handled for Thumb1 in case someone builds a routine for
Thumb1 which uses tlsdesc ? I went and read the doc and didn't see any
difference between T1 and T2 in the specification . Would the linker
and everyone else do the right thing or should we have the blx
instruction for TARGET_THUMB and v5t . I have a feeling that I'm
missing something here .




cheers
Ramana

>
> nathan
>
> --
> Nathan Sidwell
>
>


Re: [PING] 3 ARM patches

2011-06-03 Thread Carrot Wei
Hi ARM maintainers

Could you help to review the following patches?

thanks
Carrot

On Tue, May 24, 2011 at 9:31 AM, Carrot Wei  wrote:
> Hi
>
> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01973.html
> Use ldrd and strd to access two consecutive words
>
> http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00490.html
> Compute attr length for thumb2 insns
>
> http://gcc.gnu.org/ml/gcc-patches/2011-05/msg01092.html
> Replace 32 bit instructions with 16 bit instructions in thumb2
>
> thanks
> Carrot
>


[patch committed] Fix build failure on sh4-unknown-linux-gnu

2011-06-03 Thread Kaz Kojima
Hi,

I've applied the attached patch under the obvious rule
to fix the build failure on sh4-unknown-linux-gnu.

Regards,
kaz
--
[libgcc]
2011-06-04  Kaz Kojima  

* config.host (sh*-*-linux*): Fix typo.

--- ORIG/trunk/libgcc/config.host   2011-06-04 10:16:44.0 +0900
+++ trunk/libgcc/config.host2011-06-04 11:08:55.0 +0900
@@ -574,7 +574,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
case ${host} in
sh*-*-linux*)
tmake_file="${tmake_file} sh/t-linux"
-   md_unwind_header=sh/unwind-linux.h
+   md_unwind_header=sh/linux-unwind.h
;;
esac
;;


Re: Initialize previous in read_state_param_structs

2011-06-03 Thread Jack Howarth
On Mon, May 30, 2011 at 12:26:50PM +0200, Bernd Schmidt wrote:
> On 05/30/2011 11:51 AM, Alexandre Oliva wrote:
> > Bootstrap-O3 complains about uninitialized uses of this variable in
> > gengtype-state.c.  The variable can never actually be used before
> > initialization, but GCC is not smart enough to realize that.
> > read_state_structures, just before the function at hand, has a similar
> > loop and it zero-initializes both head and previous, so I adjusted the
> > affected function to follow the same pattern and avoid the bogus
> > warning.  Regstrapped on x86_64-linux-gnu and i686-pc-linux-gnu.  Ok to
> > install?
> 
> Ok. Alternatively you could fix the warning and shorten the code using
> the pprev trick.
> 
> 
> Bernd

Alexandre,
Since your original patch was approved, are you checking in
http://gcc.gnu.org/ml/gcc-patches/2011-05/msg02304.html? Currently the
-O3 bootstrap is still broken without it.
   Jack


[committed] Fix two pastos in guality/rotatetest.c

2011-06-03 Thread Jakub Jelinek
Hi!

f4/f5/f6 were copied from f1/f2/f3, just with s/long/int/,
but only in f4 I've adjusted the shift count.
Fixed thusly, committed to trunk.

2011-06-04  Jakub Jelinek  

* gcc.dg/guality/rotatetest.c (f5, f6): Fix up pastos.

--- gcc/testsuite/gcc.dg/guality/rotatetest.c   (revision 174631)
+++ gcc/testsuite/gcc.dg/guality/rotatetest.c   (working copy)
@@ -46,7 +46,7 @@ f4 (unsigned int x)
 __attribute__((noclone, noinline)) unsigned int
 f5 (unsigned int x, int y)
 {
-  unsigned int f = (x << y) | (x >> (64 - y));
+  unsigned int f = (x << y) | (x >> (32 - y));
   unsigned int g = f;
   asm volatile ("" : "+r" (f));
   vv++;/* { dg-final { gdb-test 52 "g" "f" } } */
@@ -56,7 +56,7 @@ f5 (unsigned int x, int y)
 __attribute__((noclone, noinline)) unsigned int
 f6 (unsigned int x, int y)
 {
-  unsigned int f = (x >> y) | (x << (64 - y));
+  unsigned int f = (x >> y) | (x << (32 - y));
   unsigned int g = f;
   asm volatile ("" : "+r" (f));
   vv++;/* { dg-final { gdb-test 62 "g" "f" } } */

Jakub


Re: [Patch,AVR]: Solve PR42210

2011-06-03 Thread Denis Chertykov
2011/5/28 Georg-Johann Lay :
> Georg-Johann Lay wrote:
>>
>> Georg-Johann Lay wrote:
>>
>>> Richard Henderson wrote:
>>>
>>>
 Why are you adding "optimize" to all these insns?  None of them will
 be matched unless combine is run, which implies optimization.
>>>
>>> Here is a patch without optimize in the insn conditions.
>>>
>>> The optimize condition is still present in the insv expander because I
>>> do not know what the policy about that is in the avr backend.
>
> http://gcc.gnu.org/ml/gcc-patches/2011-04/msg02099.html
>
> Hi, I still have a patch hanging around and don't know what to do with it.
> Install, change (and if, how) or just throw away.
>

Please, commit it.

Denis.