Re: [patch, fortran] Function call optimization

2011-03-21 Thread Thomas Koenig

Hi Mikael,

Here is the new version of the patch.  Regression-tested.  OK for trunk?

OK this time.

Thank you.


Sende  fortran/ChangeLog
Sende  fortran/dependency.c
Sende  fortran/frontend-passes.c
Sende  fortran/gfortran.h
Sende  fortran/invoke.texi
Sende  fortran/lang.opt
Sende  fortran/options.c
Sende  testsuite/ChangeLog
Hinzufügen testsuite/gfortran.dg/function_optimize_1.f90
Hinzufügen testsuite/gfortran.dg/function_optimize_2.f90
Übertrage Daten ..
Revision 171207 übertragen.

Thanks for the review!

Thomas


Re: [patch][4.7] Enhance XOR handling in simplify-rtx.c

2011-03-21 Thread Chung-Lin Tang
On 2011/3/18 12:18 AM, Richard Henderson wrote:
> On 03/16/2011 06:55 PM, Chung-Lin Tang wrote:
>> You have to use DeMorgan's Law to distribute the ~ operator:
> 
> Duh.  Not sure where my head was yesterday.
> 
> Let's enhance the comment for someone else having an off day.  Perhaps
> 
>   /* Given (xor (and A B) C), using P^Q == ~P&Q | ~Q&P and DeMorgan's
>  we can transform
>   A&B ^ C == ~(A&B)&C | ~C&(A&B)
>   == (~A|~B)&C | A&B&~C
>   == ~A&C | ~B&C | A&B&~C
>  Attempt a few simplifications when B and C are both constants.  */
> 
>> +  if (GET_CODE (op0) == AND
>> +  && CONST_INT_P (op1) && CONST_INT_P (XEXP (op0, 1)))
> 
> Should have a newline before the second && here.
> 
> Ok with those changes.

Thanks, committed patch attached below. Hope the comments are now
descriptive enough.

C.L.
Index: simplify-rtx.c
===
--- simplify-rtx.c  (revision 171207)
+++ simplify-rtx.c  (revision 171208)
@@ -2480,6 +2480,46 @@
XEXP (op0, 1), mode),
op1);
 
+  /* Given (xor (and A B) C), using P^Q == (~P&Q) | (~Q&P),
+we can transform like this:
+(A&B)^C == ~(A&B)&C | ~C&(A&B)
+== (~A|~B)&C | ~C&(A&B)* DeMorgan's Law
+== ~A&C | ~B&C | A&(~C&B)  * Distribute and re-order
+Attempt a few simplifications when B and C are both constants.  */
+  if (GET_CODE (op0) == AND
+ && CONST_INT_P (op1)
+ && CONST_INT_P (XEXP (op0, 1)))
+   {
+ rtx a = XEXP (op0, 0);
+ rtx b = XEXP (op0, 1);
+ rtx c = op1;
+ HOST_WIDE_INT bval = INTVAL (b);
+ HOST_WIDE_INT cval = INTVAL (c);
+
+ rtx na_c
+   = simplify_binary_operation (AND, mode,
+simplify_gen_unary (NOT, mode, a, 
mode),
+c);
+ if ((~cval & bval) == 0)
+   {
+ /* Try to simplify ~A&C | ~B&C.  */
+ if (na_c != NULL_RTX)
+   return simplify_gen_binary (IOR, mode, na_c,
+   GEN_INT (~bval & cval));
+   }
+ else
+   {
+ /* If ~A&C is zero, simplify A&(~C&B) | ~B&C.  */
+ if (na_c == const0_rtx)
+   {
+ rtx a_nc_b = simplify_gen_binary (AND, mode, a,
+   GEN_INT (~cval & bval));
+ return simplify_gen_binary (IOR, mode, a_nc_b,
+ GEN_INT (~bval & cval));
+   }
+   }
+   }
+
   /* (xor (comparison foo bar) (const_int 1)) can become the reversed
 comparison if STORE_FLAG_VALUE is 1.  */
   if (STORE_FLAG_VALUE == 1


Re: [objc++] RFH: PR 48167 gengtype failure (issue4291054)

2011-03-21 Thread Laurynas Biveinis
2011/3/18 Nicola Pero :
> Index: gcc/ChangeLog
> ===
> --- gcc/ChangeLog       (revision 171155)
> +++ gcc/ChangeLog       (working copy)
> @@ -1,3 +1,7 @@
> +2011-03-18  Nicola Pero  
> +
> +       * gengtype.c (files_rules): Added rule for cp/parser.h.
> +

The gengtype parts are OK. Thanks and sorry for the delay.

-- 
Laurynas


Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message

2011-03-21 Thread Kai Tietz
2011/3/18 Jason Merrill :
> OK.
>
> Jason
>

Applied first part at rev. 171209. Second part at rev. 171210.

Kai


Re: [PATCH] recog.c: Fix RTX unsharing in change groups

2011-03-21 Thread Andreas Krebbel
On 03/18/2011 09:11 PM, Eric Botcazou wrote:
>> The attached patch prevents that by doing RTX unsharing for all
>> subsequent changes after finding a single change where unsharing has
>> been explicitly requested.
> 
> This looks like a big hammer.  Why not doing it in canonicalize_change_group, 
> i.e. calling validate_unshare_change instead of validate_change there?

I think with the patch validate_(unshare)_change becomes easier to use. You can 
still
decide locally if you want unsharing or not. Without taking into account in 
which contexts
your function gets called. I consider this a big advantage.

Otherwise we would have to look at every validate_change invocation in order to 
check if
it might get called after validate_unshare_change. This sounds tedious and 
error-prone to
me. (and probably we would end up using validate_unshare_change everywhere)

-Andreas-


Re: [PATCH] Fix s390 delegitimize_address ICE (PR target/48213)

2011-03-21 Thread Andreas Krebbel
On 03/20/2011 08:48 PM, Jakub Jelinek wrote:
> Ok for trunk/4.6?
> 
> 2011-03-20  Jakub Jelinek  
> 
>   PR target/48213
>   * config/s390/s390.c (s390_delegitimize_address): Don't call
>   lowpart_subreg if orig_x has BLKmode.
> 
>   * gcc.dg/pr48213.c: New test.

Ok. Thanks!

-Andreas-


Re: [PATCH] libstdc++ ABI issues with __int128

2011-03-21 Thread Jakub Jelinek
On Sun, Mar 20, 2011 at 01:58:24AM +0100, Benjamin Kosnik wrote:
> 2011-03-19  Jakub Jelinek  
> 
>   * config/abi/pre/gnu.ver (CXXABI_1.3): Don't export _ZT[IS][PK]*[no].
>   (CXXABI_1.3.5): Export _ZTI[PK]*[no].
> 
> This looks good to me, nice catch. I'll figure out what happened with
> check_abi when I'm back, conductivity-wise.

The problem is that abicheck only flags as incompatible additions to
GLIBCXX_3.4, but not other base versions.  Ideally it would flag addition
to any version that hasn't been added (addition of the version is flagged
by
OBJECT:0:CXXABI_1.3.5
etc. entries (no @s in it).
This patch for now just complains about additions to any base versions,
I'll leave the better alternative to you ;)

2011-03-21  Jakub Jelinek  

* testsuite/util/testsuite_abi.cc (check_version): Set incompatible
even when adding symbols to CXXABI_1.3, GLIBCXX_LDBL_3.4 and
CXXABI_LDBL_1.3 versions.

--- libstdc++-v3/testsuite/util/testsuite_abi.cc.jj 2010-12-13 
12:06:14.0 +0100
+++ libstdc++-v3/testsuite/util/testsuite_abi.cc2011-03-21 
09:22:13.296401986 +0100
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 
-// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 // Free Software Foundation, Inc.
 
 // This library is free software; you can redistribute it and/or
@@ -217,10 +217,14 @@ check_version(symbol& test, bool added)
   else
test.version_status = symbol::incompatible;
   
-  // Check that added symbols aren't added in the base version.
-  if (added && test.version_name == known_versions[0])
+  // Check that added symbols aren't added in the base versions.
+  if (added
+ && (test.version_name == known_versions[0]
+ || test.version_name == "CXXABI_1.3"
+ || test.version_name == "GLIBCXX_LDBL_3.4"
+ || test.version_name == "CXXABI_LDBL_1.3"))
test.version_status = symbol::incompatible;
-  
+
   // Check that long double compatibility symbols demangled as
   // __float128 are put into some _LDBL_ version name.
   if (added && test.demangled_name.find("__float128") != std::string::npos)

Jakub


Re: [patch i386,c,c++]: PR/12171 - calling convention omitted in error message

2011-03-21 Thread Gabriel Dos Reis
On Mon, Mar 21, 2011 at 3:33 AM, Kai Tietz  wrote:
> 2011/3/18 Jason Merrill :
>> OK.
>>
>> Jason
>>
>
> Applied first part at rev. 171209. Second part at rev. 171210.
>

thanks.


[PATCH] Update some baseline_symbols.txt

2011-03-21 Thread Jakub Jelinek
Hi!

This patch updates baseline_symbols.txt for a bunch of targets.
This is generated with the
http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01175.html
patch applied.

2011-03-21  Jakub Jelinek  

* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/powerpc64-linux-gnu/32/baseline_symbols.txt:
Likewise.
* config/abi/post/powerpc64-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/powerpc-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/s390-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/s390x-linux-gnu/baseline_symbols.txt: Likewise.
* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Likewise.
* config/abi/post/x86_64-linux-gnu/baseline_symbols.txt: Likewise.

Jakub


P.bz2
Description: BZip2 compressed data


Re: [PATCH] recog.c: Fix RTX unsharing in change groups

2011-03-21 Thread Eric Botcazou
> I think with the patch validate_(unshare)_change becomes easier to use. You
> can still decide locally if you want unsharing or not. Without taking into
> account in which contexts your function gets called. I consider this a big
> advantage.

You're supposed to know what you're doing though and unsharing just because of 
a single call to canonicalize_change_group in fold_rtx seems really overkill.

> Otherwise we would have to look at every validate_change invocation in
> order to check if it might get called after validate_unshare_change. This
> sounds tedious and error-prone to me. (and probably we would end up using
> validate_unshare_change everywhere)

Well, this essentially works fine as of this writing so it's a little hard to 
buy this everything-is-probably-broken argument.  canonicalize_change_group is 
special since it's part of the recog.c API; it needs to support intertwined 
calls with validate_change and validate_unshare_change.  Once this is done, 
it's reasonable to expect that the user of the API doesn't do crazy things.

-- 
Eric Botcazou


Re: [build, lto] Only accept -fuse-linker-plugin if linker supports -plugin (PR lto/46944)

2011-03-21 Thread Rainer Orth
Richard Guenther  writes:

> On Fri, 18 Mar 2011, Rainer Orth wrote:
>
>> Richard Guenther  writes:
>> 
>> > It seemed to have disabled linker-plugin support for old binutils
>> > with --with-plugin-ld=/usr/local/bin/gold, explicit -fuse-linker-plugin 
>> > says
>> > it is not supported.  The system linker does not have plugin support
>> > (nor gold).  /usr/local has gold from binutils 2.20.50.xxx.  So it seems 
>> > that
>> >
>> > # Allow -fuse-linker-plugin to enable plugin support in GNU gold 2.20.
>> > elif test "$ld_is_gold" = yes -a "$ld_vers_major" -eq 2 -a
>> > "$ld_vers_minor" -eq 20; then
>> >   gcc_cv_lto_plugin=1
>> > fi
>> >
>> > only allows explicit -fuse-linker-plugin for recent gold but based on 
>> > checking
>> > the system linker version (instead of that of --with-plugin-ld).  I'd say
>> > allow explicit -fuse-linker-plugin always if --with-plugin-ld is specified.
>> 
>> Agreed.  I'll have a look and refrain from installing on 4.6 until this
>> is resolved.  I wasn't even aware of --with-plugin-ld, which isn't
>> documented in install.texi ;-(  This stuff seems insanely complicated to
>> me, though: which user is supposed to deal with such complications?
>
> It's sort of historic ... with plugin support for GNU ld we can probably
> drop this flag for 4.7 (eventually I'd even like to enforce the use
> of the plugin all the time or disable LTO, just for the sake of reducing
> the testing and bugreporting matrix ...).
>
> I just noticed the above with the LTO setup of our SPEC testers
> which are using somewhat old system tools.

Here's the patch I came up with.  It is on top of the previous one, so
if we want to backport to 4.6 later, both are necessary.

It also fixes a typo in the in_tree_ld case, which can never have worked.

Tested by i386-pc-solaris2.11 bootstraps with either Sun ld or gld 2.21,
and by configuring with Sun ld --with-plugin-ld=gld-2.21 and obvserving
HAVE_LTO_PLUGIN being set to 1.

Ok for mainline now and 4.6 after some soak time?

Thanks.
Rainer


2011-03-19  Rainer Orth  

* configure.ac (gcc_cv_lto_plugin): Fix typo.
Allow -fuse-linker-plugin for non-default plugin linker.
* configure: Regenerate.

diff -r 916a52719d80 gcc/configure.ac
--- a/gcc/configure.ac  Sat Mar 19 08:54:19 2011 +0100
+++ b/gcc/configure.ac  Sun Mar 20 13:37:38 2011 +0100
@@ -3192,14 +3192,14 @@
 AC_MSG_CHECKING(linker plugin support)
 gcc_cv_lto_plugin=0
 if test -f liblto_plugin.la; then
-  if test $in_tree_ld = yes -a x"$ORIGINAL_PLUGIN_LD_FOR_TARGET=" = 
x"$gcc_cv_ld"; then
+  if test $in_tree_ld = yes -a x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" = 
x"$gcc_cv_ld"; then
 if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" 
-ge 21 -o "$gcc_cv_gld_major_version" -gt 2; then
   gcc_cv_lto_plugin=2
 elif test "$ld_is_gold" = yes -a "$gcc_cv_gld_major_version" -eq 2 -a 
"$gcc_cv_gld_minor_version" -eq 20; then
   gcc_cv_lto_plugin=1
 
 fi
-  elif echo "$ld_ver" | grep GNU > /dev/null; then
+  elif test x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" = x"$gcc_cv_ld" && echo 
"$ld_ver" | grep GNU > /dev/null; then
 # Require GNU ld or gold 2.21+ for plugin support by default.
 if test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -ge 21; then
   gcc_cv_lto_plugin=2
@@ -3207,6 +3207,10 @@
 elif test "$ld_is_gold" = yes -a "$ld_vers_major" -eq 2 -a 
"$ld_vers_minor" -eq 20; then
   gcc_cv_lto_plugin=1
 fi
+  elif test x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" != x"$gcc_cv_ld"; then
+# Allow -fuse-linker-plugin if plugin linker differs from
+# default/specified linker.
+gcc_cv_lto_plugin=1
   fi
 fi
 AC_DEFINE_UNQUOTED(HAVE_LTO_PLUGIN, $gcc_cv_lto_plugin,


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


[PATCH] dwarf2out: Print the name of the unspec as part of the warning

2011-03-21 Thread Andreas Krebbel
Hi,

with the attached patch dwarf2out tries to print the name of the
unspec together with the numeric value in case the back end uses
define_c_enum for the unspec constants.

Ok for mainline?

Bye,

-Andreas-


2011-03-21  Andreas Krebbel  

* dwarf2out.c (const_ok_for_output_1): Print the unspec enum name
if possible.


Index: gcc/dwarf2out.c
===
*** gcc/dwarf2out.c.orig
--- gcc/dwarf2out.c
*** const_ok_for_output_1 (rtx *rtlp, void *
*** 13612,13620 
--- 13612,13627 
inform (current_function_decl
? DECL_SOURCE_LOCATION (current_function_decl)
: UNKNOWN_LOCATION,
+ #if NUM_UNSPEC_VALUES > 0
+   "non-delegitimized UNSPEC %s (%d) found in variable location",
+   (XINT (rtl, 1) >= 0 && XINT (rtl, 1) < NUM_UNSPEC_VALUES)
+   ? unspec_strings[XINT (rtl, 1)] : "unkown",
+   XINT (rtl, 1));
+ #else
"non-delegitimized UNSPEC %d found in variable location",
XINT (rtl, 1));
  #endif
+ #endif
expansion_failed (NULL_TREE, rtl,
"UNSPEC hasn't been delegitimized.\n");
return 1;


Re: [build, lto] Only accept -fuse-linker-plugin if linker supports -plugin (PR lto/46944)

2011-03-21 Thread Richard Guenther
On Mon, 21 Mar 2011, Rainer Orth wrote:

> Richard Guenther  writes:
> 
> > On Fri, 18 Mar 2011, Rainer Orth wrote:
> >
> >> Richard Guenther  writes:
> >> 
> >> > It seemed to have disabled linker-plugin support for old binutils
> >> > with --with-plugin-ld=/usr/local/bin/gold, explicit -fuse-linker-plugin 
> >> > says
> >> > it is not supported.  The system linker does not have plugin support
> >> > (nor gold).  /usr/local has gold from binutils 2.20.50.xxx.  So it seems 
> >> > that
> >> >
> >> > # Allow -fuse-linker-plugin to enable plugin support in GNU gold 
> >> > 2.20.
> >> > elif test "$ld_is_gold" = yes -a "$ld_vers_major" -eq 2 -a
> >> > "$ld_vers_minor" -eq 20; then
> >> >   gcc_cv_lto_plugin=1
> >> > fi
> >> >
> >> > only allows explicit -fuse-linker-plugin for recent gold but based on 
> >> > checking
> >> > the system linker version (instead of that of --with-plugin-ld).  I'd say
> >> > allow explicit -fuse-linker-plugin always if --with-plugin-ld is 
> >> > specified.
> >> 
> >> Agreed.  I'll have a look and refrain from installing on 4.6 until this
> >> is resolved.  I wasn't even aware of --with-plugin-ld, which isn't
> >> documented in install.texi ;-(  This stuff seems insanely complicated to
> >> me, though: which user is supposed to deal with such complications?
> >
> > It's sort of historic ... with plugin support for GNU ld we can probably
> > drop this flag for 4.7 (eventually I'd even like to enforce the use
> > of the plugin all the time or disable LTO, just for the sake of reducing
> > the testing and bugreporting matrix ...).
> >
> > I just noticed the above with the LTO setup of our SPEC testers
> > which are using somewhat old system tools.
> 
> Here's the patch I came up with.  It is on top of the previous one, so
> if we want to backport to 4.6 later, both are necessary.
> 
> It also fixes a typo in the in_tree_ld case, which can never have worked.
> 
> Tested by i386-pc-solaris2.11 bootstraps with either Sun ld or gld 2.21,
> and by configuring with Sun ld --with-plugin-ld=gld-2.21 and obvserving
> HAVE_LTO_PLUGIN being set to 1.
> 
> Ok for mainline now and 4.6 after some soak time?

Ok for trunk and 4.6.1.

Thanks,
Richard.

> Thanks.
>   Rainer
> 
> 
> 2011-03-19  Rainer Orth  
> 
>   * configure.ac (gcc_cv_lto_plugin): Fix typo.
>   Allow -fuse-linker-plugin for non-default plugin linker.
>   * configure: Regenerate.
> 
> diff -r 916a52719d80 gcc/configure.ac
> --- a/gcc/configure.acSat Mar 19 08:54:19 2011 +0100
> +++ b/gcc/configure.acSun Mar 20 13:37:38 2011 +0100
> @@ -3192,14 +3192,14 @@
>  AC_MSG_CHECKING(linker plugin support)
>  gcc_cv_lto_plugin=0
>  if test -f liblto_plugin.la; then
> -  if test $in_tree_ld = yes -a x"$ORIGINAL_PLUGIN_LD_FOR_TARGET=" = 
> x"$gcc_cv_ld"; then
> +  if test $in_tree_ld = yes -a x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" = 
> x"$gcc_cv_ld"; then
>  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" 
> -ge 21 -o "$gcc_cv_gld_major_version" -gt 2; then
>gcc_cv_lto_plugin=2
>  elif test "$ld_is_gold" = yes -a "$gcc_cv_gld_major_version" -eq 2 -a 
> "$gcc_cv_gld_minor_version" -eq 20; then
>gcc_cv_lto_plugin=1
>  
>  fi
> -  elif echo "$ld_ver" | grep GNU > /dev/null; then
> +  elif test x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" = x"$gcc_cv_ld" && echo 
> "$ld_ver" | grep GNU > /dev/null; then
>  # Require GNU ld or gold 2.21+ for plugin support by default.
>  if test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -ge 21; then
>gcc_cv_lto_plugin=2
> @@ -3207,6 +3207,10 @@
>  elif test "$ld_is_gold" = yes -a "$ld_vers_major" -eq 2 -a 
> "$ld_vers_minor" -eq 20; then
>gcc_cv_lto_plugin=1
>  fi
> +  elif test x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" != x"$gcc_cv_ld"; then
> +# Allow -fuse-linker-plugin if plugin linker differs from
> +# default/specified linker.
> +gcc_cv_lto_plugin=1
>fi
>  fi
>  AC_DEFINE_UNQUOTED(HAVE_LTO_PLUGIN, $gcc_cv_lto_plugin,
> 
> 
> 

-- 
Richard Guenther 
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex


Re: [build, lto] Only accept -fuse-linker-plugin if linker supports -plugin (PR lto/46944)

2011-03-21 Thread Paolo Bonzini

On 03/21/2011 11:18 AM, Rainer Orth wrote:

Richard Guenther  writes:


On Fri, 18 Mar 2011, Rainer Orth wrote:


Richard Guenther  writes:


It seemed to have disabled linker-plugin support for old binutils
with --with-plugin-ld=/usr/local/bin/gold, explicit -fuse-linker-plugin says
it is not supported.  The system linker does not have plugin support
(nor gold).  /usr/local has gold from binutils 2.20.50.xxx.  So it seems that

 # Allow -fuse-linker-plugin to enable plugin support in GNU gold 2.20.
 elif test "$ld_is_gold" = yes -a "$ld_vers_major" -eq 2 -a
"$ld_vers_minor" -eq 20; then
   gcc_cv_lto_plugin=1
 fi

only allows explicit -fuse-linker-plugin for recent gold but based on checking
the system linker version (instead of that of --with-plugin-ld).  I'd say
allow explicit -fuse-linker-plugin always if --with-plugin-ld is specified.


Agreed.  I'll have a look and refrain from installing on 4.6 until this
is resolved.  I wasn't even aware of --with-plugin-ld, which isn't
documented in install.texi ;-(  This stuff seems insanely complicated to
me, though: which user is supposed to deal with such complications?


It's sort of historic ... with plugin support for GNU ld we can probably
drop this flag for 4.7 (eventually I'd even like to enforce the use
of the plugin all the time or disable LTO, just for the sake of reducing
the testing and bugreporting matrix ...).

I just noticed the above with the LTO setup of our SPEC testers
which are using somewhat old system tools.


Here's the patch I came up with.  It is on top of the previous one, so
if we want to backport to 4.6 later, both are necessary.

It also fixes a typo in the in_tree_ld case, which can never have worked.

Tested by i386-pc-solaris2.11 bootstraps with either Sun ld or gld 2.21,
and by configuring with Sun ld --with-plugin-ld=gld-2.21 and obvserving
HAVE_LTO_PLUGIN being set to 1.

Ok for mainline now and 4.6 after some soak time?

Thanks.
Rainer


2011-03-19  Rainer Orth

* configure.ac (gcc_cv_lto_plugin): Fix typo.
Allow -fuse-linker-plugin for non-default plugin linker.
* configure: Regenerate.

diff -r 916a52719d80 gcc/configure.ac
--- a/gcc/configure.ac  Sat Mar 19 08:54:19 2011 +0100
+++ b/gcc/configure.ac  Sun Mar 20 13:37:38 2011 +0100
@@ -3192,14 +3192,14 @@
  AC_MSG_CHECKING(linker plugin support)
  gcc_cv_lto_plugin=0
  if test -f liblto_plugin.la; then
-  if test $in_tree_ld = yes -a x"$ORIGINAL_PLUGIN_LD_FOR_TARGET=" = 
x"$gcc_cv_ld"; then
+  if test $in_tree_ld = yes -a x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" = 
x"$gcc_cv_ld"; then
  if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 21 -o 
"$gcc_cv_gld_major_version" -gt 2; then
gcc_cv_lto_plugin=2
  elif test "$ld_is_gold" = yes -a "$gcc_cv_gld_major_version" -eq 2 -a 
"$gcc_cv_gld_minor_version" -eq 20; then
gcc_cv_lto_plugin=1

  fi
-  elif echo "$ld_ver" | grep GNU>  /dev/null; then
+  elif test x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" = x"$gcc_cv_ld"&&  echo "$ld_ver" | 
grep GNU>  /dev/null; then
  # Require GNU ld or gold 2.21+ for plugin support by default.
  if test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -ge 21; then
gcc_cv_lto_plugin=2
@@ -3207,6 +3207,10 @@
  elif test "$ld_is_gold" = yes -a "$ld_vers_major" -eq 2 -a 
"$ld_vers_minor" -eq 20; then
gcc_cv_lto_plugin=1
  fi
+  elif test x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" != x"$gcc_cv_ld"; then
+# Allow -fuse-linker-plugin if plugin linker differs from
+# default/specified linker.
+gcc_cv_lto_plugin=1
fi
  fi
  AC_DEFINE_UNQUOTED(HAVE_LTO_PLUGIN, $gcc_cv_lto_plugin,


I haven't followed the thread enough to understand the issue, but the 
patch is trivial enough that I can defer to Richard about it.


Paolo


Prune empty cases from toplevel configure.ac

2011-03-21 Thread Joseph S. Myers
This patch, relative to a tree with my deprecated targets removal patch 
 applied, further 
cleans up the toplevel configure.ac by removing empty cases from a case 
statement.  The original patch still needs review by someone able to 
approve the patch as a whole, but as the only apparent controversy so far 
concerned empty cases I hope this patch can resolve the concerns over that 
bit of the original patch.

The effect of removing empty cases in this particular case statement is 
that any subsequent case matching the target, generally

  *-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;

comes into effect.  That particular case is of no effect for targets with 
no GCC support since they can't be trying to build libgcj or other GCC 
target libraries anyway.  All targets removed from the case statement by 
this patch have no GCC support (after the deprecation patch).  In 
addition, some empty cases were left behind, either because the targets 
did have GCC support or because a case other than *-*-* would trigger if 
they were removed.

OK to commit?

2011-03-21  Joseph Myers  

* configure.ac (arm-semi-aof, crx-*-*, parisc*-*-linux*,
i370-*-opened*, i[[3456789]]86-moss-msdos | i[[3456789]]86-*-moss*
| i[[3456789]]86-*-uwin*, mcore-*-pe*): Remove empty cases.
* configure: Regenerate.

--- configure.ac2011-03-17 20:36:23.0 +
+++ configure.ac.new2011-03-21 10:23:01.0 +
@@ -672,8 +672,6 @@
   arc-*-*)
 noconfigdirs="$noconfigdirs target-libgloss"
 ;;
-  arm-semi-aof )
-;;
   arm-*-coff | strongarm-*-coff | xscale-*-coff)
 noconfigdirs="$noconfigdirs ${libgcj}"
 libgloss_dir=arm
@@ -743,8 +741,6 @@
 esac
 libgloss_dir=cris
 ;;
-  crx-*-*)
-;;
   d10v-*-*)
 noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}"
 ;;
@@ -778,7 +774,7 @@
 # headers, crt*.o, etc., all of which are needed by these.
 noconfigdirs="$noconfigdirs target-zlib"
 ;;
-  parisc*-*-linux* | hppa*-*-linux*)
+  hppa*-*-linux*)
 ;;
   hppa*-*-*elf* | \
   hppa*-*-lites* | \
@@ -812,8 +808,6 @@
 # No gdb or ld support yet.
 noconfigdirs="$noconfigdirs ${libgcj} tix readline mmalloc libgui itcl gdb 
ld"
 ;;
-  i370-*-opened*)
-;;
   i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
 noconfigdirs="$noconfigdirs ${libgcj}"
 libgloss_dir=i386
@@ -857,8 +851,7 @@
   echo "Warning: winsup/cygwin is missing so newlib can't be built."
 fi
 ;;
-  i[[3456789]]86-moss-msdos | i[[3456789]]86-*-moss* | \
-  i[[3456789]]86-*-uwin* | i[[3456789]]86-*-interix* )
+  i[[3456789]]86-*-interix* )
 ;;
   i[[3456789]]86-*-pe)
 noconfigdirs="$noconfigdirs target-libgloss"
@@ -899,8 +892,6 @@
   m68*-*-* | fido-*-*)
 libgloss_dir=m68k
 ;;
-  mcore-*-pe*)
-;;
   mmix-*-*)
 noconfigdirs="$noconfigdirs target-libffi target-boehm-gc gdb libgloss"
 unsupported_languages="$unsupported_languages fortran java"

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: [patch libcpp]: Improve handling of DOS-filenames and -paths

2011-03-21 Thread Kai Tietz
PING

2011/3/14 Kai Tietz :
> Hello,
>
> this patch fixes some DOS-filename comparision and directory-separator checks.
>
> Changelog libcpp
>
> 2011-03-14  Kai Tietz
>
>        * files.c (file_hash_eq): Use filename_cmp
>        instead of strcmp.
>        (nonexistent_file_hash_eq): Likewise.
>        (remap_filename): Likewise.
>        Handle absolute DOS-path,
>        (append_file_to_dir): Check for IS_DIR_SEPARATOR
>        instead of slash.
>        (read_name_map): Likewise.
>        * linemap.c (linemap_add): Use filename_cmp
>        instead of strcmp.
>        * mkdeps.c (apply_vpath): Use filename_ncmp
>        instead of strncmp.
>        (deps_restore): Use filename_cmp instead of
>        strcmp.
>        * init.c (read_original_directory): Use
>        IS_DIR_SEPARATOR instead of checking for slash.
>
> Tested for x86_64-pc-linux-gnu and x86_64-w64-mingw32. Ok for apply?
>
> Regards,
> Kai
>



-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


Re: [patch gcc c++ c-family java fortan lto]: Fix DOS-filesystem issues

2011-03-21 Thread Kai Tietz
PING

2011/3/15 Kai Tietz :
> 2011/3/15 Pedro Alves :
>> Thanks.
>>
>> This looks like lbasename-able as well, getting rid of
>> that HAVE_DOS...-ish foo:
>
> Thanks. Yes, that one I missed.
>
> Attached updated version of patch.
>
> Kai
>



-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


Re: Prune empty cases from toplevel configure.ac

2011-03-21 Thread Paolo Bonzini

On 03/21/2011 11:41 AM, Joseph S. Myers wrote:

This patch, relative to a tree with my deprecated targets removal patch
  applied, further
cleans up the toplevel configure.ac by removing empty cases from a case
statement.  The original patch still needs review by someone able to
approve the patch as a whole, but as the only apparent controversy so far
concerned empty cases I hope this patch can resolve the concerns over that
bit of the original patch.

The effect of removing empty cases in this particular case statement is
that any subsequent case matching the target, generally

   *-*-*)
 noconfigdirs="$noconfigdirs ${libgcj}"
 ;;

comes into effect.  That particular case is of no effect for targets with
no GCC support since they can't be trying to build libgcj or other GCC
target libraries anyway.  All targets removed from the case statement by
this patch have no GCC support (after the deprecation patch).  In
addition, some empty cases were left behind, either because the targets
did have GCC support or because a case other than *-*-* would trigger if
they were removed.

OK to commit?


Yes, after the deprecation patch is in.

paolo


[doc] Improve Perl requirements documentation (PR bootstrap/48135)

2011-03-21 Thread Rainer Orth
While reviewing PR bootstrap/48135, it came up that the Perl
requirements in install.texi are inaccurate:

* On some platforms (Darwin, Solaris), Perl is a build-time requirement,
  but documented with the development requirements only.

* On Solaris with symbol versioning enabled, it is always necessary
  since libgomp is versioned and built even in a C-only bootstrap.

The following patch reflects this.  Tested during a i386-pc-solaris2.11
bootstrap.

Ok for mainline and 4.6 branch?

Btw., any word on

[doc] Update install.texi for Solaris 2, IRIX, Tru64 UNIX
http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01013.html

While I don't need approval for mainline, it would be helpful to get
this into 4.6, too.

Thanks.

Rainer


2011-03-19  Rainer Orth  

PR bootstrap/48135
* doc/install.texi (Prerequisites): Move Perl to build
requirements.  Always necessary on Solaris 2 with Sun ld.

diff -r f40ef4501161 gcc/doc/install.texi
--- a/gcc/doc/install.texi  Sat Mar 19 09:09:43 2011 +0100
+++ b/gcc/doc/install.texi  Sat Mar 19 10:25:51 2011 +0100
@@ -303,6 +303,22 @@
 systems' @command{tar} programs will also work, only try GNU
 @command{tar} if you have problems.
 
+@item Perl version 5.6.1 (or later)
+
+Necessary when targetting Darwin, building @samp{libstdc++},
+and not using @option{--disable-symvers}.
+Necessary when targetting Solaris 2 with Sun @command{ld} and not using
+@option{--disable-symvers}.  A helper
+script needs @samp{Glob.pm}, which is missing from @command{perl} 5.005
+included in Solaris@tie{}8.  The bundled @command{perl} in Solaris@tie{}9 and 
up
+works.
+
+Necessary when regenerating @file{Makefile} dependencies in libiberty.
+Necessary when regenerating @file{libiberty/functions.texi}.
+Necessary when generating manpages from Texinfo manuals.
+Used by various scripts to generate some files included in SVN (mainly
+Unicode-related and rarely changing) from source tables.
+
 @item GNU Multiple Precision Library (GMP) version 4.3.2 (or later)
 
 Necessary to build GCC@.  If you do not have it installed in your
@@ -447,21 +463,6 @@
 Necessary to access the SVN repository.  Public releases and weekly
 snapshots of the development sources are also available via FTP@.
 
-@item Perl version 5.6.1 (or later)
-
-Necessary when regenerating @file{Makefile} dependencies in libiberty.
-Necessary when regenerating @file{libiberty/functions.texi}.
-Necessary when generating manpages from Texinfo manuals.
-Necessary when targetting Darwin, building @samp{libstdc++},
-and not using @option{--disable-symvers}.
-Necessary when targetting Solaris 2 with Sun @command{ld}, building
-@samp{libstdc++}, and not using @option{--disable-symvers}.  A helper
-scripts needs @samp{Glob.pm}, which is missing from @command{perl} 5.005
-included in Solaris@tie{}8.  The bundled @command{perl} in Solaris@tie{}9 and 
up
-works.
-Used by various scripts to generate some files included in SVN (mainly
-Unicode-related and rarely changing) from source tables.
-
 @item GNU diffutils version 2.7 (or later)
 
 Useful when submitting patches for the GCC source code.


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


[doc] Improve support library requirements documentation (PR bootstrap/48135)

2011-03-21 Thread Rainer Orth
While investigating PR bootstrap/48135, it came up that the submitter
had run into trouble bootstrapping with mpc 0.9.0.  Unfortunately,
install.texi when describing support library requirements always lists
`(or later)' with the individual libraries.

Users who don't have the minimal required library installed (or even
those that do) often tend to build the latest release available instead
of the minimum, which has often led to trouble in the past, e.g. with
GMP 5.0.

I've therefore added a paragraph in front of the support libraries
explaining the situation and suggesting to stick with the exact versions
mentioned.  I've left the `(or later)' for the time being; we should
further improve install.texi by listing ranges of known-good versions
there.

Ok for mainline and the 4.6 branch?

Rainer


2011-03-19  Rainer Orth  

PR bootstrap/48135
* doc/install.texi (Prerequisites): Move jar etc. up.
Explain support library version requirements.

diff -r c1a515add087 gcc/doc/install.texi
--- a/gcc/doc/install.texi  Sat Mar 19 10:25:56 2011 +0100
+++ b/gcc/doc/install.texi  Sat Mar 19 10:35:17 2011 +0100
@@ -319,6 +319,20 @@
 Used by various scripts to generate some files included in SVN (mainly
 Unicode-related and rarely changing) from source tables.
 
+@item @command{jar}, or InfoZIP (@command{zip} and @command{unzip})
+
+Necessary to build libgcj, the GCJ runtime.
+
+@end table
+
+Several support libraries are necessary to build GCC, some are required,
+others optional.  While any sufficiently new version of required tools
+usually work, library requirements are generally stricter.  Newer
+versions may work in some cases, but it's safer to use the exact
+versions documented.  We appreciate bug reports about problems with
+newer versions, though.
+
+@table @asis
 @item GNU Multiple Precision Library (GMP) version 4.3.2 (or later)
 
 Necessary to build GCC@.  If you do not have it installed in your
@@ -374,10 +388,6 @@
 In both cases @option{--with-cloog} configure option should be used
 if CLooG is not installed in your default library search path.
 
-@item @command{jar}, or InfoZIP (@command{zip} and @command{unzip})
-
-Necessary to build libgcj, the GCJ runtime.
-
 @end table
 
 @heading Tools/packages necessary for modifying GCC


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


Re: C-family stack check for threads

2011-03-21 Thread Thomas Klein

* Florian Weimer:

* Thomas Klein:

e.g. if using "-fstack-check=indirect 
-fstack-limit-symbol=stack_limit_var"

Have you looked at -fsplit-stack? It emits quite similar code.



Yes I have seen this.
But the switches -fstack-check and -fsplit-stack are for different cases.
The "stack check" (with a given limit) is used to to detect if a stack 
overflow has already taken place or if it will take place within the 
current function call.
While "split stack" is used to dynamically allocate more space (from 
Heap) if the current stack size is too small.
This mechanism is currently only supported for x86 machines (having a 
UNIX alike environment).


In my case I'm using a ARM microcontroller (without MMU) with 20KBytes 
of RAM in total.

I'm having 10 threads with a 1K stack for each.
Global variables allocating 8K and Heap having 2K.

I simply need a check method to detect if a function is going to write 
into the wrong stack area.


Regards
  Thomas






Re: [doc] Update install.texi for Solaris 2, IRIX, Tru64 UNIX

2011-03-21 Thread Gerald Pfeifer
On Thu, 17 Mar 2011, Rainer Orth wrote:
> I've just reviewed install.texi for my platforms and found it mostly
> accurate.  A few minor changes are desirable for the 4.6 release, but
> also apply to mainline since the file is identical there:
> 
> * Update recommendations to binutils 2.21 since this is what I've been
>   testing.

Since you're the primary tester and often only on these platforms, I
guess this is fine, otherwise (on GNU/Linux x86, say) it might be a bit
too strict.

> * Remove download URL for Sun Studio compilers since AFAIK we're not
>   supposed to link to non-free software.

Oh, sorry, I failed to follow up on your earlier response on that thread.

> Ok for mainline and 4.6 branch?

Yes, thank you.

Gerald


[patch] Couple of tweaks to the gimplifier

2011-03-21 Thread Eric Botcazou
Hi,

the attached patch makes a couple of tweaks to the gimplifier in order to help 
Ada, but I think that they are of general usefulness:

  1) Set TREE_THIS_NOTRAP on the INDIRECT_REF built for VLA decls.  This is
 correct since stack memory isn't considered as trapping in the IL.

  2) Improve gimplification of complex conditions in COND_EXPR.  They are
 naturally generated by the Ada compiler and the patch avoids emitting
 redundant branches in GIMPLE, visible at -O0 for the testcase:

procedure P (B : Boolean; S1, S2 : String) is
begin
  if B and then S1 & S2 = "toto" then
raise Program_Error;
  end if;
end;

@@ -158,21 +158,12 @@
movl%r12d, %eax
subl%ebx, %eax
cmpl$3, %eax
-   jne .L33
+   jne .L18
.loc 1 3 0 discriminator 1
movq-40(%rbp), %rax
movl(%rax), %eax
cmpl$1869901684, %eax
-   jne .L33
-   .loc 1 3 0 discriminator 2
-   movl$1, %eax
-   jmp .L34
-.L33:
-   movl$0, %eax
-.L34:
-   .loc 1 3 0 discriminator 3
-   testb   %al, %al
-   je  .L18
+   jne .L18
.loc 1 4 0 is_stmt 1
movl$4, %esi
movl$.LC0, %edi

Bootstrapped/regtested on x86_64-suse-linux, OK for the mainline?


2011-03-21  Eric Botcazou  

* gimplify.c (gimplify_vla_decl): Set TREE_THIS_NOTRAP flag.
(gimplify_cond_expr): Gimplify COMPOUND_EXPR conditions.


-- 
Eric Botcazou
Index: gimplify.c
===
--- gimplify.c	(revision 171044)
+++ gimplify.c	(working copy)
@@ -1322,6 +1322,7 @@ gimplify_vla_decl (tree decl, gimple_seq
   addr = create_tmp_var (ptr_type, get_name (decl));
   DECL_IGNORED_P (addr) = 0;
   t = build_fold_indirect_ref (addr);
+  TREE_THIS_NOTRAP (t) = 1;
   SET_DECL_VALUE_EXPR (decl, t);
   DECL_HAS_VALUE_EXPR_P (decl) = 1;
 
@@ -2981,6 +2982,11 @@ gimplify_cond_expr (tree *expr_p, gimple
   return GS_ALL_DONE;
 }
 
+  /* Remove any COMPOUND_EXPR so the following cases will be caught.  */
+  STRIP_TYPE_NOPS (TREE_OPERAND (expr, 0));
+  if (TREE_CODE (TREE_OPERAND (expr, 0)) == COMPOUND_EXPR)
+gimplify_compound_expr (&TREE_OPERAND (expr, 0), pre_p, true);
+
   /* Make sure the condition has BOOLEAN_TYPE.  */
   TREE_OPERAND (expr, 0) = gimple_boolify (TREE_OPERAND (expr, 0));
 


[build, doc] Obsolete Solaris 8 support

2011-03-21 Thread Rainer Orth
Continuing to support Solaris 8 is starting to cause lots of trouble:

* Regular support has ended in March 2009, and even extended support
  with special arrangements will end in March 2012.

* Access to Solaris 8 patches is restricted to customers with such
  arrangements, which I'm not.

* While I can test Solaris 8/SPARC in a Solaris 8 Branded Zone running
  on Solaris 10, this testing is limited since only the non-default
  alternate thread library is supported there.  I could test on bare
  metal if need be, but this will likely go away.

* Solaris 8/x86 testing is even worse: running it inside VirtualBox is
  dog slow and unreliable and Xen doesn't work at all.  I've finally
  been able to get myself a machine old enough to still run it or hack
  newer machines into running it, but I doubt all this trouble is worth
  it.

Therefore I'll soon commit this patch to obsolete Solaris 8 support in
4.7.  It will be removed in 4.8 then.

Tested by configuring with --with-target i386-pc-solaris2.8 and noting
the build fail in the gcc subdir, while it continues to work with
--enable-obsolete.

Rainer


2011-03-19  Rainer Orth  

* config.gcc: Obsolete *-*-solaris2.8*.
* doc/install.texi (Specific, *-*-solaris2*): Document it.

diff -r 08a2bc3273f5 gcc/config.gcc
--- a/gcc/config.gccSat Mar 19 09:24:43 2011 +0100
+++ b/gcc/config.gccSat Mar 19 09:31:53 2011 +0100
@@ -250,6 +250,7 @@
  | powerpc*-*-gnu* \
  | score-* \
  | sh*-*-symbianelf*   \
+ | *-*-solaris2.8* \
  | vax-*-netbsd*   \
  )
 if test "x$enable_obsolete" != xyes; then
diff -r 08a2bc3273f5 gcc/doc/install.texi
--- a/gcc/doc/install.texi  Sat Mar 19 09:24:43 2011 +0100
+++ b/gcc/doc/install.texi  Sat Mar 19 09:31:53 2011 +0100
@@ -46,7 +46,7 @@
 
 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
 @c 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 
-@c 2010 Free Software Foundation, Inc.
+@c 2010, 2011 Free Software Foundation, Inc.
 @c *** Converted to texinfo by Dean Wakerley, d...@wakerley.com
 
 @c IMPORTANT: whenever you modify this file, run `install.texi2html' to
@@ -4136,7 +4136,9 @@
 @c alone is too unspecific and must be avoided.
 @heading @anchor{x-x-solaris2}*-*-solaris2*
 
-Support for Solaris 7 has been removed in GCC 4.6.
+Support for Solaris 8 has been obsoleted in GCC 4.7, but can still be
+enabled by configuring with @option{--enable-obsolete}.  Support will be
+removed in GCC 4.8.  Support for Solaris 7 has been removed in GCC 4.6.
 
 Sun does not ship a C compiler with Solaris 2, though you can download
 the Sun Studio compilers for free.  Alternatively,


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


extend.texi: Fix grammatical problems with builtin machine function descriptions

2011-03-21 Thread Nick Clifton
Hi Gerald, Hi Joseph,

  I have a attached a mostly mechanical patch to fix a couple of very
  minor grammatical issues with the built-in machine function
  descriptions in the extend.texi file.  The first issue is with this
  sentence:

They all generate the machine instruction that is part of the name

  The problem is that there is more than one name and that the name is a
  property of the built-in functions.  Thus I feel that it is more correct
  to say:
   
They all generate the machine instruction that is part of their name


  The second issue is with a couple of sentences which say:

The following built-in function is available when option  is used.

  The problem here is that there is more than one built-in function that
  is enabled by  options and so I feel that it is better to say:
 
The following built-in functions are available when option  is used.


  Checked by rebuilding the gcc documentation.
  OK to apply ?

Cheers
  Nick

gcc/ChangeLog
2011-03-21  Nick Clifton  

* doc/extend.texi (Alpha Built-in Functions, X86 Built-in
Functions): Fix grammatical errors.

Index: gcc/doc/extend.texi
===
--- gcc/doc/extend.texi	(revision 171210)
+++ gcc/doc/extend.texi	(working copy)
@@ -7945,7 +7945,7 @@
 processors, depending on the command-line switches used.
 
 The following built-in functions are always available.  They
-all generate the machine instruction that is part of the name.
+all generate the machine instruction that is part of their name.
 
 @smallexample
 long __builtin_alpha_implver (void)
@@ -7981,7 +7981,7 @@
 The following built-in functions are always with @option{-mmax}
 or @option{-mcpu=@var{cpu}} where @var{cpu} is @code{pca56} or
 later.  They all generate the machine instruction that is part
-of the name.
+of their name.
 
 @smallexample
 long __builtin_alpha_pklb (long)
@@ -8002,7 +8002,7 @@
 The following built-in functions are always with @option{-mcix}
 or @option{-mcpu=@var{cpu}} where @var{cpu} is @code{ev67} or
 later.  They all generate the machine instruction that is part
-of the name.
+of their name.
 
 @smallexample
 long __builtin_alpha_cttz (long)
@@ -8649,7 +8649,7 @@
 floating point and @code{TC} 128-bit complex floating point values.
 
 The following floating point built-in functions are available in 64-bit
-mode.  All of them implement the function that is part of the name.
+mode.  All of them implement the function that is part of their name.
 
 @smallexample
 __float128 __builtin_fabsq (__float128)
@@ -8670,7 +8670,8 @@
 @end table
 
 The following built-in functions are made available by @option{-mmmx}.
-All of them generate the machine instruction that is part of the name.
+All of them generate the machine instruction that is part of their
+name.
 
 @smallexample
 v8qi __builtin_ia32_paddb (v8qi, v8qi)
@@ -8731,7 +8732,7 @@
 The following built-in functions are made available either with
 @option{-msse}, or with a combination of @option{-m3dnow} and
 @option{-march=athlon}.  All of them generate the machine
-instruction that is part of the name.
+instruction that is part of their name.
 
 @smallexample
 v4hi __builtin_ia32_pmulhuw (v4hi, v4hi)
@@ -8751,7 +8752,7 @@
 @end smallexample
 
 The following built-in functions are available when @option{-msse} is used.
-All of them generate the machine instruction that is part of the name.
+All of them generate the machine instruction that is part of their name.
 
 @smallexample
 int __builtin_ia32_comieq (v4sf, v4sf)
@@ -8850,7 +8851,7 @@
 @end table
 
 The following built-in functions are available when @option{-msse2} is used.
-All of them generate the machine instruction that is part of the name.
+All of them generate the machine instruction that is part of their name.
 
 @smallexample
 int __builtin_ia32_comisdeq (v2df, v2df)
@@ -9010,7 +9011,7 @@
 @end smallexample
 
 The following built-in functions are available when @option{-msse3} is used.
-All of them generate the machine instruction that is part of the name.
+All of them generate the machine instruction that is part of their name.
 
 @smallexample
 v2df __builtin_ia32_addsubpd (v2df, v2df)
@@ -9035,7 +9036,7 @@
 @end table
 
 The following built-in functions are available when @option{-mssse3} is used.
-All of them generate the machine instruction that is part of the name
+All of them generate the machine instruction that is part of their name
 with MMX registers.
 
 @smallexample
@@ -9058,7 +9059,7 @@
 @end smallexample
 
 The following built-in functions are available when @option{-mssse3} is used.
-All of them generate the machine instruction that is part of the name
+All of them generate the machine instruction that is part of their name
 with SSE registers.
 
 @smallexample
@@ -9081,7 +9082,7 @@
 @end smallexample
 
 The following built-in functions are available when @option{-msse4.1} is
-used.  All of them generate the machine instruction that is p

[build] Honor --disable-symvers (PR bootstrap/48135)

2011-03-21 Thread Rainer Orth
Prompted by PR bootstrap/48135, I found that only libstdc++-v3 honors
--disable-symvers.  The following patch corrects this, but also notices
again the mess we've created by having at least 3 different sets of
checks for symbol versioning, each with its own variations ;-(  But this
is not the time to correct this (yet).

Tested by a i386-pc-solaris2.11 bootstrap and checking that all
libraries were still versioned by default.  Then I removed and
configured/built the affected libraries again and checked that
versioning was correctly disabled.

The patch below was created with -w to hide indentation changes.

Ok for mainline now and perhaps 4.6.1?

Thanks.
Rainer


2011-03-19  Rainer Orth  

libgfortran:
PR bootstrap/48135
* configure.ac (gfortran_use_symver): Handle --disable-symvers.
* configure: Regenerate.

libgomp:
PR bootstrap/48135
* acinclude.m4 (enable_symvers): Handle --disable-symvers.
* configure: Regenerate.

libjava:
PR bootstrap/48135
* configure.ac (libjava_cv_anon_version_script): Handle
--disable-symvers.
* configure: Regenerate.

libquadmath:
PR bootstrap/48135
* configure.ac (quadmath_use_symver): Handle --disable-symvers.
* configure: Regenerate.

libssp:
PR bootstrap/48135
* configure.ac (ssp_use_symver): Handle --disable-symvers.
* configure: Regenerate.

diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -144,6 +144,12 @@
 
 # Check for symbol versioning (copied from libssp).
 AC_MSG_CHECKING([whether symbol versioning is supported])
+AC_ARG_ENABLE(symvers,
+AS_HELP_STRING([--disable-symvers],
+  [disable symbol versioning for libgfortran]),
+gfortran_use_symver=$enableval,
+gfortran_use_symver=yes)
+if test "x$gfortran_use_symver" = xyes; then
 save_LDFLAGS="$LDFLAGS"
 LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
 cat > conftest.map < conftest.map
AC_TRY_LINK(void globalsymbol (void) {} void localsymbol (void) {},,
-  [libjava_cv_anon_version_script=gnu], [])
+[libjava_cv_anon_version_script=gnu],
+[libjava_cv_anon_version_script=no])
if test x$libjava_cv_anon_version_script = xno; then
  case "$target_os" in
solaris2*)
@@ -1820,6 +1831,7 @@
  esac
fi
CFLAGS="$save_CFLAGS"; LDFLAGS="$save_LDFLAGS"
+   fi
   ])
 AM_CONDITIONAL(ANONVERSCRIPT, test "$libjava_cv_anon_version_script" != no)
 AM_CONDITIONAL(ANONVERSCRIPT_GNU, test "$libjava_cv_anon_version_script" = gnu)
diff --git a/libquadmath/configure.ac b/libquadmath/configure.ac
--- a/libquadmath/configure.ac
+++ b/libquadmath/configure.ac
@@ -164,6 +164,12 @@
 
 # Check for symbol versioning (copied from libssp).
 AC_MSG_CHECKING([whether symbol versioning is supported])
+AC_ARG_ENABLE(symvers,
+AS_HELP_STRING([--disable-symvers],
+  [disable symbol versioning for libquadmath]),
+quadmath_use_symver=$enableval,
+quadmath_use_symver=yes)
+if test "x$quadmath_use_symver" = xyes; then
 if test x$gcc_no_link = xyes; then
   # If we cannot link, we cannot build shared libraries, so do not use
   # symbol versioning.
@@ -194,6 +200,7 @@
   fi
   LDFLAGS="$save_LDFLAGS"
 fi
+fi
 AC_MSG_RESULT($quadmath_use_symver)
 AM_CONDITIONAL(LIBQUAD_USE_SYMVER, [test "x$quadmath_use_symver" != xno])
 AM_CONDITIONAL(LIBQUAD_USE_SYMVER_GNU, [test "x$quadmath_use_symver" = xgnu])
diff --git a/libssp/configure.ac b/libssp/configure.ac
--- a/libssp/configure.ac
+++ b/libssp/configure.ac
@@ -72,6 +72,12 @@
 fi
 
 AC_MSG_CHECKING([whether symbol versioning is supported])
+AC_ARG_ENABLE(symvers,
+AS_HELP_STRING([--disable-symvers],
+  [disable symbol versioning for libssp]),
+ssp_use_symver=$enableval,
+ssp_use_symver=yes)
+if test "x$ssp_use_symver" = xyes; then
 if test x$gcc_no_link = xyes; then
   # If we cannot link, we cannot build shared libraries, so do not use
   # symbol versioning.
@@ -102,6 +108,7 @@
   fi
   LDFLAGS="$save_LDFLAGS"
 fi
+fi
 AC_MSG_RESULT($ssp_use_symver)
 AM_CONDITIONAL(LIBSSP_USE_SYMVER, [test "x$ssp_use_symver" != xno])
 AM_CONDITIONAL(LIBSSP_USE_SYMVER_GNU, [test "x$ssp_use_symver" = xgnu])

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


[build, doc] Avoid File::Glob in in make_sunver.pl (PR bootstrap/48135)

2011-03-21 Thread Rainer Orth
Prompted by PR bootstrap/48135, I had a closer look at make_sunver.pl
and noticed that it doesn't use File::Glob at all, but turns globs in
the input version script into a regular expression for matching.
Therefore, the requirement of a Perl version newer than what is bundled
in Solaris 8 should go away.

The same seems to apply to libstdc++-v3/scripts/make_exports.pl, but I
haven't touched that file since I cannot test it.

The patch below was tested by a i386-pc-solaris2.11 bootstrap and
verifying that all version scripts were identical to their counterparts
with File::Glob included.

Will apply to mainline soon and probably backport to 4.6.1 later once
I've verified that using perl 5.005 from Solaris 8 really works.

Rainer


2011-03-19  Rainer Orth  

contrib:
PR bootstrap/48135
* make_sunver.pl: Don't use File::Glob.

gcc:
PR bootstrap/48135
* doc/install.texi (Prerequisites, Perl): Remove Glob.pm
reference.  Solaris 8 perl works.

diff -r cc5961e4e5eb contrib/make_sunver.pl
--- a/contrib/make_sunver.plSat Mar 19 22:44:56 2011 +0100
+++ b/contrib/make_sunver.plSat Mar 19 22:57:20 2011 +0100
@@ -16,7 +16,6 @@
 # It depends on the GNU version of c++filt, since it must understand the
 # GNU mangling style.
 
-use File::Glob ':glob';
 use FileHandle;
 use IPC::Open2;
 
diff -r cc5961e4e5eb gcc/doc/install.texi
--- a/gcc/doc/install.texi  Sat Mar 19 22:44:56 2011 +0100
+++ b/gcc/doc/install.texi  Sat Mar 19 22:57:20 2011 +0100
@@ -308,10 +308,8 @@
 Necessary when targetting Darwin, building @samp{libstdc++},
 and not using @option{--disable-symvers}.
 Necessary when targetting Solaris 2 with Sun @command{ld} and not using
-@option{--disable-symvers}.  A helper
-script needs @samp{Glob.pm}, which is missing from @command{perl} 5.005
-included in Solaris@tie{}8.  The bundled @command{perl} in Solaris@tie{}9 and 
up
-works.
+@option{--disable-symvers}.  The bundled @command{perl} in Solaris@tie{}8
+and up works.
 
 Necessary when regenerating @file{Makefile} dependencies in libiberty.
 Necessary when regenerating @file{libiberty/functions.texi}.


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


Re: [doc] Improve Perl requirements documentation (PR bootstrap/48135)

2011-03-21 Thread Richard Guenther
On Mon, 21 Mar 2011, Rainer Orth wrote:

> While reviewing PR bootstrap/48135, it came up that the Perl
> requirements in install.texi are inaccurate:
> 
> * On some platforms (Darwin, Solaris), Perl is a build-time requirement,
>   but documented with the development requirements only.
> 
> * On Solaris with symbol versioning enabled, it is always necessary
>   since libgomp is versioned and built even in a C-only bootstrap.
> 
> The following patch reflects this.  Tested during a i386-pc-solaris2.11
> bootstrap.
> 
> Ok for mainline and 4.6 branch?

Ok.

> Btw., any word on
> 
>   [doc] Update install.texi for Solaris 2, IRIX, Tru64 UNIX
> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01013.html
> 
> While I don't need approval for mainline, it would be helpful to get
> this into 4.6, too.

Ok with me.

Thanks,
Richard.

> Thanks.
> 
>   Rainer
> 
> 
> 2011-03-19  Rainer Orth  
> 
>   PR bootstrap/48135
>   * doc/install.texi (Prerequisites): Move Perl to build
>   requirements.  Always necessary on Solaris 2 with Sun ld.
> 
> diff -r f40ef4501161 gcc/doc/install.texi
> --- a/gcc/doc/install.texiSat Mar 19 09:09:43 2011 +0100
> +++ b/gcc/doc/install.texiSat Mar 19 10:25:51 2011 +0100
> @@ -303,6 +303,22 @@
>  systems' @command{tar} programs will also work, only try GNU
>  @command{tar} if you have problems.
>  
> +@item Perl version 5.6.1 (or later)
> +
> +Necessary when targetting Darwin, building @samp{libstdc++},
> +and not using @option{--disable-symvers}.
> +Necessary when targetting Solaris 2 with Sun @command{ld} and not using
> +@option{--disable-symvers}.  A helper
> +script needs @samp{Glob.pm}, which is missing from @command{perl} 5.005
> +included in Solaris@tie{}8.  The bundled @command{perl} in Solaris@tie{}9 
> and up
> +works.
> +
> +Necessary when regenerating @file{Makefile} dependencies in libiberty.
> +Necessary when regenerating @file{libiberty/functions.texi}.
> +Necessary when generating manpages from Texinfo manuals.
> +Used by various scripts to generate some files included in SVN (mainly
> +Unicode-related and rarely changing) from source tables.
> +
>  @item GNU Multiple Precision Library (GMP) version 4.3.2 (or later)
>  
>  Necessary to build GCC@.  If you do not have it installed in your
> @@ -447,21 +463,6 @@
>  Necessary to access the SVN repository.  Public releases and weekly
>  snapshots of the development sources are also available via FTP@.
>  
> -@item Perl version 5.6.1 (or later)
> -
> -Necessary when regenerating @file{Makefile} dependencies in libiberty.
> -Necessary when regenerating @file{libiberty/functions.texi}.
> -Necessary when generating manpages from Texinfo manuals.
> -Necessary when targetting Darwin, building @samp{libstdc++},
> -and not using @option{--disable-symvers}.
> -Necessary when targetting Solaris 2 with Sun @command{ld}, building
> -@samp{libstdc++}, and not using @option{--disable-symvers}.  A helper
> -scripts needs @samp{Glob.pm}, which is missing from @command{perl} 5.005
> -included in Solaris@tie{}8.  The bundled @command{perl} in Solaris@tie{}9 
> and up
> -works.
> -Used by various scripts to generate some files included in SVN (mainly
> -Unicode-related and rarely changing) from source tables.
> -
>  @item GNU diffutils version 2.7 (or later)
>  
>  Useful when submitting patches for the GCC source code.
> 
> 
> 

-- 
Richard Guenther 
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex


Re: [build] Honor --disable-symvers (PR bootstrap/48135)

2011-03-21 Thread Paolo Bonzini

On 03/21/2011 12:34 PM, Rainer Orth wrote:

Prompted by PR bootstrap/48135, I found that only libstdc++-v3 honors
--disable-symvers.  The following patch corrects this, but also notices
again the mess we've created by having at least 3 different sets of
checks for symbol versioning, each with its own variations ;-(  But this
is not the time to correct this (yet).

Tested by a i386-pc-solaris2.11 bootstrap and checking that all
libraries were still versioned by default.  Then I removed and
configured/built the affected libraries again and checked that
versioning was correctly disabled.

The patch below was created with -w to hide indentation changes.

Ok for mainline now and perhaps 4.6.1?


Ok for 4.7, RMs should decide about 4.6.1.

Paolo


Re: [doc] Improve support library requirements documentation (PR bootstrap/48135)

2011-03-21 Thread Richard Guenther
On Mon, 21 Mar 2011, Rainer Orth wrote:

> While investigating PR bootstrap/48135, it came up that the submitter
> had run into trouble bootstrapping with mpc 0.9.0.  Unfortunately,
> install.texi when describing support library requirements always lists
> `(or later)' with the individual libraries.
> 
> Users who don't have the minimal required library installed (or even
> those that do) often tend to build the latest release available instead
> of the minimum, which has often led to trouble in the past, e.g. with
> GMP 5.0.
> 
> I've therefore added a paragraph in front of the support libraries
> explaining the situation and suggesting to stick with the exact versions
> mentioned.  I've left the `(or later)' for the time being; we should
> further improve install.texi by listing ranges of known-good versions
> there.
> 
> Ok for mainline and the 4.6 branch?

Ok.

Thanks,
Richard.

>   Rainer
> 
> 
> 2011-03-19  Rainer Orth  
> 
>   PR bootstrap/48135
>   * doc/install.texi (Prerequisites): Move jar etc. up.
>   Explain support library version requirements.
> 
> diff -r c1a515add087 gcc/doc/install.texi
> --- a/gcc/doc/install.texiSat Mar 19 10:25:56 2011 +0100
> +++ b/gcc/doc/install.texiSat Mar 19 10:35:17 2011 +0100
> @@ -319,6 +319,20 @@
>  Used by various scripts to generate some files included in SVN (mainly
>  Unicode-related and rarely changing) from source tables.
>  
> +@item @command{jar}, or InfoZIP (@command{zip} and @command{unzip})
> +
> +Necessary to build libgcj, the GCJ runtime.
> +
> +@end table
> +
> +Several support libraries are necessary to build GCC, some are required,
> +others optional.  While any sufficiently new version of required tools
> +usually work, library requirements are generally stricter.  Newer
> +versions may work in some cases, but it's safer to use the exact
> +versions documented.  We appreciate bug reports about problems with
> +newer versions, though.
> +
> +@table @asis
>  @item GNU Multiple Precision Library (GMP) version 4.3.2 (or later)
>  
>  Necessary to build GCC@.  If you do not have it installed in your
> @@ -374,10 +388,6 @@
>  In both cases @option{--with-cloog} configure option should be used
>  if CLooG is not installed in your default library search path.
>  
> -@item @command{jar}, or InfoZIP (@command{zip} and @command{unzip})
> -
> -Necessary to build libgcj, the GCJ runtime.
> -
>  @end table
>  
>  @heading Tools/packages necessary for modifying GCC
> 
> 
> 

-- 
Richard Guenther 
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex


[build] Link with libstdc++ for libpwl test (PR bootstrap/48120)

2011-03-21 Thread Rainer Orth
As reported in the PR, the toplevel configure test for libpwl doesn't
work since it fails to link with libstdc++.  The following patch
corrects this.

There were a couple of issues:

* One cannot use LDFLAGS here since that is passed to $CC before -lpwl,
  which of course fails with a static libpwl.  I'm using LIBS instead.

* It was suggested to add $stage1_libs to LIBS, but I go for -lstdc++
  -lm instead.  I seriously doubt we can make bootstrap work with a
  non-g++ C++ compiler here, especially with Go included which is
  written in C++ itself.  This would mean linking both the foreign C++
  runtime libraries and libstdc++ into the executables, which seems to
  be a recipe for disaster.

This patch allowed a i386-pc-solaris2.11 with ppl/cloog to finish and
all graphite tests passed.

Ok for mainline?

Rainer


2011-03-19  Rainer Orth  

PR bootstrap/48120:
* configure.ac (pwllib): Use LIBS instead of LDFLAGS.
Add -lstdc++ -lm to LIBS.
* configure: Regenerate.

diff -r 3786717045e5 configure.ac
--- a/configure.ac  Sat Mar 19 10:35:20 2011 +0100
+++ b/configure.ac  Sat Mar 19 21:57:26 2011 +0100
@@ -1677,10 +1677,10 @@
 
 if test "x$with_ppl" != xno; then
   if test "x$pwllib" = x; then
-saved_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS $ppllibs"
-AC_CHECK_LIB(pwl,PWL_handle_timeout,[pwllib="-lpwl"])
-LDFLAGS="$saved_LDFLAGS"
+saved_LIBS="$LIBS"
+LIBS="$LIBS $ppllibs -lstdc++ -lm"
+AC_CHECK_LIB(pwl, PWL_handle_timeout, [pwllib="-lpwl"])
+LIBS="$saved_LIBS"
   fi
 
   ppllibs="$ppllibs -lppl_c -lppl $pwllib -lgmpxx"

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


Re: [Patch][AVR]: Support tail calls

2011-03-21 Thread Georg-Johann Lay
Denis Chertykov schrieb:
> 2011/3/18 Georg-Johann Lay :
> 
>>> Is it tested for regressions ?
>>>
>>> Denis.
>> I ran tests against svn 170942 (latest 4.7.0 snapshot). Besides
>> timestamps, the diff looks like this:
>>
>> 1435a1436,1437
>>> XPASS: gcc.dg/sibcall-3.c execution test
>>> XPASS: gcc.dg/sibcall-4.c execution test
>> 1630,1631c1632,1633
>> < # of unexpected successes 4
>> < # of expected failures132
>> ---
>>> # of unexpected successes 6
>>> # of expected failures130
>> 1670c1672
>>
>> This is due to xfail for runtime-test of sibcall abilities for avr-*-*.
>>
> 
> 
> So, the patch can be committed.
> Please, prepare the final version of the patch.

Patch updated to trunk, some more comment.

Johann


2011-03-21  Georg-Johann Lay  

* config/avr/avr-protos.h (expand_epilogue): Change prototype
* config/avr/avr.h (struct machine_function): Add field
sibcall_fails.
* config/avr/avr.c (init_cumulative_args,
avr_function_arg_advance): Use it.
* config/avr/avr.c (expand_epilogue): Add bool parameter. Handle
sibcall epilogues.
(TARGET_FUNCTION_OK_FOR_SIBCALL): Define to...
(avr_function_ok_for_sibcall): ...this new function.
(avr_lookup_function_attribute1): New static Function.
(avr_naked_function_p, interrupt_function_p,
signal_function_p, avr_OS_task_function_p,
avr_OS_main_function_p): Use it.
* config/avr/avr.md ("sibcall", "sibcall_value",
"sibcall_epilogue"): New expander.
("*call_insn", "*call_value_insn"): New insn.
("call_insn", "call_value_insn"): Remove
("call", "call_value", "epilogue"): Change expander to handle
sibling calls.

Index: config/avr/avr-protos.h
===
--- config/avr/avr-protos.h	(Revision 171215)
+++ config/avr/avr-protos.h	(Arbeitskopie)
@@ -76,7 +76,7 @@ extern const char *lshrsi3_out (rtx insn
 extern bool avr_rotate_bytes (rtx operands[]);
 
 extern void expand_prologue (void);
-extern void expand_epilogue (void);
+extern void expand_epilogue (bool);
 extern int avr_epilogue_uses (int regno);
 
 extern void avr_output_bld (rtx operands[], int bit_nr);
Index: config/avr/avr.md
===
--- config/avr/avr.md	(Revision 171215)
+++ config/avr/avr.md	(Arbeitskopie)
@@ -2647,94 +2647,91 @@
 ;; call
 
 (define_expand "call"
-  [(call (match_operand:HI 0 "call_insn_operand" "")
- (match_operand:HI 1 "general_operand" ""))]
+  [(parallel[(call (match_operand:HI 0 "call_insn_operand" "")
+   (match_operand:HI 1 "general_operand" ""))
+ (use (const_int 0))])]
   ;; Operand 1 not used on the AVR.
+  ;; Operand 2 is 1 for tail-call, 0 otherwise.
+  ""
+  "")
+
+(define_expand "sibcall"
+  [(parallel[(call (match_operand:HI 0 "call_insn_operand" "")
+   (match_operand:HI 1 "general_operand" ""))
+ (use (const_int 1))])]
+  ;; Operand 1 not used on the AVR.
+  ;; Operand 2 is 1 for tail-call, 0 otherwise.
   ""
   "")
 
 ;; call value
 
 (define_expand "call_value"
-  [(set (match_operand 0 "register_operand" "")
-(call (match_operand:HI 1 "call_insn_operand" "")
-  (match_operand:HI 2 "general_operand" "")))]
+  [(parallel[(set (match_operand 0 "register_operand" "")
+  (call (match_operand:HI 1 "call_insn_operand" "")
+(match_operand:HI 2 "general_operand" "")))
+ (use (const_int 0))])]
   ;; Operand 2 not used on the AVR.
+  ;; Operand 3 is 1 for tail-call, 0 otherwise.
   ""
   "")
 
-(define_insn "call_insn"
-  [(call (mem:HI (match_operand:HI 0 "nonmemory_operand" "!z,*r,s,n"))
- (match_operand:HI 1 "general_operand" "X,X,X,X"))]
-;; We don't need in saving Z register because r30,r31 is a call used registers
+(define_expand "sibcall_value"
+  [(parallel[(set (match_operand 0 "register_operand" "")
+  (call (match_operand:HI 1 "call_insn_operand" "")
+(match_operand:HI 2 "general_operand" "")))
+ (use (const_int 1))])]
+  ;; Operand 2 not used on the AVR.
+  ;; Operand 3 is 1 for tail-call, 0 otherwise.
+  ""
+  "")
+
+(define_insn "*call_insn"
+  [(parallel[(call (mem:HI (match_operand:HI 0 "nonmemory_operand" "z,s,z,s"))
+   (match_operand:HI 1 "general_operand"   "X,X,X,X"))
+ (use (match_operand:HI 2 "const_int_operand"  "L,L,P,P"))])]
   ;; Operand 1 not used on the AVR.
-  "(register_operand (operands[0], HImode) || CONSTANT_P (operands[0]))"
-  "*{
-  if (which_alternative==0)
- return \"%!icall\";
-  else if (which_alternative==1)
-{
-  if (AVR_HAVE_MOVW)
-	return (AS2 (movw, r30, %0) CR_TAB
-   \"%!icall\");
-  else
-	return (AS2 (mov, r30, %A0) CR_TAB
-		AS2 (mov, r31, %B0) CR_TAB
-		\"%!icall\");
-  

Re: [build] Link with libstdc++ for libpwl test (PR bootstrap/48120)

2011-03-21 Thread Paolo Bonzini

On 03/21/2011 12:48 PM, Rainer Orth wrote:

As reported in the PR, the toplevel configure test for libpwl doesn't
work since it fails to link with libstdc++.  The following patch
corrects this.

There were a couple of issues:

* One cannot use LDFLAGS here since that is passed to $CC before -lpwl,
   which of course fails with a static libpwl.  I'm using LIBS instead.



It's better anyway.

Patch is okay.

Paolo


[build, doc] Remove --enable-threads=solaris support

2011-03-21 Thread Rainer Orth
We still have support for --enable-threads=solaris (the old Unix
International thread library) in GCC.  This is pretty pointless IMO:

* Both libthread and libpthread are only two different interfaces to the
  same implementation.

* Most of our runtime libraries don't support libthread at all.

* The support is barely tested if at all, and has created user confusion
  who assumed that they should configure with --enable-threads=solaris
  when building on Solaris.  I've already clarified install.texi to
  avoid this.

The following patch removes (hopefully) all remnants of that support,
both in code and docs.

Tested by a i386-pc-solaris2.11 bootstrap without regressions and
verifying that a --enable-threads=solaris runs into the expected error
configuring gcc.

Will apply to mainline soon.

Rainer


2011-03-20  Rainer Orth  

gcc:
* gthr-solaris.h: Remove.
* gthr.h (_SOLARIS_THREADS): Don't include gthr-solaris.h, remove.
* config/sol2.h (CPP_SUBTARGET_SPEC): Remove -threads support.
(LIB_SPEC): Likewise.
* config/sol2.opt (threads): Remove.
* config.gcc (i[34567]86-*-solaris2*): Remove solaris threads
support.
(sparc*-*-solaris2*): Likewise.
* configure.ac (enable_threads): Enable solaris support.
* configure: Regenerate.
* doc/invoke.texi (Option Summary, Solaris 2 Options): Remove
-threads.
* doc/install.texi (Configuration, --enable-threads=lib): Remove
solaris.

boehm-gc:
* configure.ac (THREADS): Remove solaris.
* configure: Regenerate.

libjava:
* configure.ac (THREADS): Remove solaris.
* configure: Regenerate.

diff -r 5ba1687bfdfd boehm-gc/configure.ac
--- a/boehm-gc/configure.ac Sun Mar 20 21:48:36 2011 +0100
+++ b/boehm-gc/configure.ac Sun Mar 20 22:14:54 2011 +0100
@@ -235,7 +235,7 @@
 AC_DEFINE(GC_AIX_THREADS,1)
 AC_DEFINE(_REENTRANT,1)
 ;;
- decosf1 | irix | mach | os2 | solaris | dce | vxworks)
+ decosf1 | irix | mach | os2 | dce | vxworks)
 AC_MSG_ERROR(thread package $THREADS not yet supported)
 ;;
  *)
diff -r 5ba1687bfdfd gcc/config.gcc
--- a/gcc/config.gccSun Mar 20 21:48:36 2011 +0100
+++ b/gcc/config.gccSun Mar 20 22:14:54 2011 +0100
@@ -1433,9 +1433,6 @@
  "":yes:* | yes:yes:* )
thread_file=posix
;;
- "":*:yes | yes:*:yes )
-   thread_file=solaris
-   ;;
esac
;;
 i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
@@ -2610,9 +2607,6 @@
  "":yes:* | yes:yes:* )
thread_file=posix
;;
- "":*:yes | yes:*:yes )
-   thread_file=solaris
-   ;;
esac
;;
 sparc-wrs-vxworks)
diff -r 5ba1687bfdfd gcc/config/sol2.h
--- a/gcc/config/sol2.h Sun Mar 20 21:48:36 2011 +0100
+++ b/gcc/config/sol2.h Sun Mar 20 22:14:54 2011 +0100
@@ -83,7 +83,6 @@
 #undef CPP_SUBTARGET_SPEC
 #define CPP_SUBTARGET_SPEC "\
 %{pthreads|pthread:-D_REENTRANT -D_PTHREADS} \
-%{!pthreads:%{!pthread:%{threads:-D_REENTRANT -D_SOLARIS_THREADS}}} \
 %{compat-bsd:-iwithprefixbefore ucbinclude -I/usr/ucbinclude} \
 "
 
@@ -137,8 +136,6 @@
%{!symbolic:\
  %{pthreads|pthread:" \
 LIB_THREAD_LDFLAGS_SPEC " -lpthread " LIB_TLS_SPEC "} \
- %{!pthreads:%{!pthread:%{threads:" \
-   LIB_THREAD_LDFLAGS_SPEC " -lthread}}} \
  %{p|pg:-ldl} -lc}"
 
 #undef  ENDFILE_SPEC
diff -r 5ba1687bfdfd gcc/config/sol2.opt
--- a/gcc/config/sol2.opt   Sun Mar 20 21:48:36 2011 +0100
+++ b/gcc/config/sol2.opt   Sun Mar 20 22:14:54 2011 +0100
@@ -42,6 +42,3 @@
 
 rdynamic
 Driver
-
-threads
-Driver
diff -r 5ba1687bfdfd gcc/configure.ac
--- a/gcc/configure.ac  Sun Mar 20 21:48:36 2011 +0100
+++ b/gcc/configure.ac  Sun Mar 20 22:14:54 2011 +0100
@@ -1332,7 +1332,7 @@
 target_thread_file='single'
 ;;
   aix | dce | gnat | irix | posix | posix95 | rtems | \
-  single | solaris | vxworks | win32 | mipssde)
+  single | vxworks | win32 | mipssde)
 target_thread_file=${enable_threads}
 ;;
   *)
diff -r 5ba1687bfdfd gcc/doc/install.texi
--- a/gcc/doc/install.texi  Sun Mar 20 21:48:36 2011 +0100
+++ b/gcc/doc/install.texi  Sun Mar 20 22:14:54 2011 +0100
@@ -1129,9 +1129,6 @@
 RTEMS thread support.
 @item single
 Disable thread support, should work for all platforms.
-@item solaris
-Sun Solaris 2/Unix International thread support.  Only use this if you
-really need to use this legacy API instead of the default, @samp{posix}.
 @item vxworks
 VxWorks thread support.
 @item win32
diff -r 5ba1687bfdfd gcc/doc/invoke.texi
--- a/gcc/doc/invoke.texi   Sun Mar 20 21:48:36 2011 +0100
+++ b/gcc/doc/invoke.texi   Sun Mar 20 22:14:54 2011 +0100
@@ -854,7 +854,7 @@
 
 @emph{Solaris 2 Options}
 @gccoptlist{-mimpure-text  -mno-impure-text @gol
--threads -pthreads -pthread}
+-pthreads -pthread}
 
 @emph{SPARC Options}
 @gccoptlist{-mcpu=@var{cpu

[libgo] Support GOTESTFLAGS

2011-03-21 Thread Rainer Orth
The following patch came in handy when I need to repeat an individual
libgo test and investigate the resulting binary:

$ make GOTESTFLAGS=--keep /check

does the trick and is far neater than modifying the generated Makefile.

Rainer


2011-03-20  Rainer Orth  

* Makefile.am (CHECK): Use $(GOTESTFLAGS).
* Makefile.in: Regenerate.

diff -r ee84762ea4b7 libgo/Makefile.am
--- a/libgo/Makefile.am Sat Mar 19 22:05:32 2011 +0100
+++ b/libgo/Makefile.am Sun Mar 20 00:01:03 2011 +0100
@@ -1503,9 +1503,9 @@
prefix=`if test "$(@D)" = "regexp"; then echo regexp-test; else dirname 
$(@D); fi`; \
test "$${prefix}" != "." || prefix="$(@D)"; \
if test "$(use_dejagnu)" = "yes"; then \
- $(SHELL) $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) 
--srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" 
--pkgfiles="$(go_$(subst /,_,$(@D))_files)"; \
+ $(SHELL) $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) 
--srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" 
--pkgfiles="$(go_$(subst /,_,$(@D))_files)" $(GOTESTFLAGS); \
else \
- if $(SHELL) $(srcdir)/testsuite/gotest --basedir=$(srcdir) 
--srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" 
--pkgfiles="$(go_$(subst /,_,$(@D))_files)" >>$@-log 2>&1; then \
+ if $(SHELL) $(srcdir)/testsuite/gotest --basedir=$(srcdir) 
--srcdir=$(srcdir)/go/$(@D) --prefix="libgo_$${prefix}" 
--pkgfiles="$(go_$(subst /,_,$(@D))_files)" $(GOTESTFLAGS) >>$@-log 2>&1; then \
echo "PASS: $(@D)"; \
  else \
echo "FAIL: $(@D)"; \

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


Re: [doc] Update install.texi for Solaris 2, IRIX, Tru64 UNIX

2011-03-21 Thread Rainer Orth
Gerald Pfeifer  writes:

> On Thu, 17 Mar 2011, Rainer Orth wrote:
>> I've just reviewed install.texi for my platforms and found it mostly
>> accurate.  A few minor changes are desirable for the 4.6 release, but
>> also apply to mainline since the file is identical there:
>> 
>> * Update recommendations to binutils 2.21 since this is what I've been
>>   testing.
>
> Since you're the primary tester and often only on these platforms, I
> guess this is fine, otherwise (on GNU/Linux x86, say) it might be a bit
> too strict.

I've carefully worded to be only a recommendation, stating at the same
time when the bundled versions should work too.  2.21 is an important
improvement over 2.20 since I've fixed several bugs there, especially
related to TLS support.

>> * Remove download URL for Sun Studio compilers since AFAIK we're not
>>   supposed to link to non-free software.
>
> Oh, sorry, I failed to follow up on your earlier response on that thread.

No problem, just stumbled over it again when re-reading the sections on
my targets.

Rainer

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


[Ada] Avoid duplicating branches in loop conditions

2011-03-21 Thread Eric Botcazou
This avoids duplicating branches in the generated code at -O0 for complex loop 
conditions involving boolean expressions.

Tested on i586-suse-linux, applied on the mainline.


2011-03-21  Eric Botcazou  

* gcc-interface/decl.c (elaborate_expression_1): When optimization is
disabled, use the variable for bounds of loop iteration scheme.


-- 
Eric Botcazou
Index: gcc-interface/decl.c
===
--- gcc-interface/decl.c	(revision 171210)
+++ gcc-interface/decl.c	(working copy)
@@ -6004,7 +6004,7 @@ elaborate_expression_1 (tree gnu_expr, E
 			bool definition, bool need_debug)
 {
   const bool expr_global_p = Is_Public (gnat_entity) || global_bindings_p ();
-  bool expr_variable_p;
+  bool expr_variable_p, use_variable;
   tree gnu_decl;
 
   /* In most cases, we won't see a naked FIELD_DECL because a discriminant
@@ -6058,8 +6058,18 @@ elaborate_expression_1 (tree gnu_expr, E
 	&& (TREE_READONLY (inner) || DECL_READONLY_ONCE_ELAB (inner)));
 }
 
-  /* Now create the variable if we need it.  */
-  if (need_debug || (expr_variable_p && expr_global_p))
+  /* We only need to use the variable if we are in a global context since GCC
+ can do the right thing in the local case.  However, when not optimizing,
+ use it for bounds of loop iteration scheme to avoid code duplication.  */
+  use_variable = expr_variable_p
+		 && (expr_global_p
+		 || (!optimize
+			 && Is_Itype (gnat_entity)
+			 && Nkind (Associated_Node_For_Itype (gnat_entity))
+			== N_Loop_Parameter_Specification));
+
+  /* Now create it, possibly only for debugging purposes.  */
+  if (use_variable || need_debug)
 gnu_decl
   = create_var_decl (create_concat_name (gnat_entity,
 	 IDENTIFIER_POINTER (gnu_name)),
@@ -6067,9 +6077,7 @@ elaborate_expression_1 (tree gnu_expr, E
 			 !need_debug, Is_Public (gnat_entity),
 			 !definition, expr_global_p, NULL, gnat_entity);
 
-  /* We only need to use this variable if we are in global context since GCC
- can do the right thing in the local case.  */
-  if (expr_global_p && expr_variable_p)
+  if (use_variable)
 return gnu_decl;
 
   return expr_variable_p ? gnat_save_expr (gnu_expr) : gnu_expr;


PING^2: Reducing the overhead of dwarf2 location tracking

2011-03-21 Thread Richard Sandiford
Second ping for this patch (4.5+):

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

It fixes a source of quadratic memory use while generating dwarf2
var-tracking information.

Thanks,
Richard


Re: [patch] Couple of tweaks to the gimplifier

2011-03-21 Thread Richard Guenther
On Mon, Mar 21, 2011 at 12:19 PM, Eric Botcazou  wrote:
> Hi,
>
> the attached patch makes a couple of tweaks to the gimplifier in order to help
> Ada, but I think that they are of general usefulness:
>
>  1) Set TREE_THIS_NOTRAP on the INDIRECT_REF built for VLA decls.  This is
>     correct since stack memory isn't considered as trapping in the IL.

This is ok.

>  2) Improve gimplification of complex conditions in COND_EXPR.  They are
>     naturally generated by the Ada compiler and the patch avoids emitting
>     redundant branches in GIMPLE, visible at -O0 for the testcase:

Shouldn't

+  /* Remove any COMPOUND_EXPR so the following cases will be caught.  */
+  STRIP_TYPE_NOPS (TREE_OPERAND (expr, 0));
+  if (TREE_CODE (TREE_OPERAND (expr, 0)) == COMPOUND_EXPR)
+gimplify_compound_expr (&TREE_OPERAND (expr, 0), pre_p, true);

happen in gimple_boolify instead so that other callers also benefit?
That is, add a COMPOUND_EXPR case there?

> procedure P (B : Boolean; S1, S2 : String) is
> begin
>  if B and then S1 & S2 = "toto" then
>    raise Program_Error;
>  end if;
> end;

So, what does the GENERIC look like here?

Thanks,
Richard.


> @@ -158,21 +158,12 @@
>        movl    %r12d, %eax
>        subl    %ebx, %eax
>        cmpl    $3, %eax
> -       jne     .L33
> +       jne     .L18
>        .loc 1 3 0 discriminator 1
>        movq    -40(%rbp), %rax
>        movl    (%rax), %eax
>        cmpl    $1869901684, %eax
> -       jne     .L33
> -       .loc 1 3 0 discriminator 2
> -       movl    $1, %eax
> -       jmp     .L34
> -.L33:
> -       movl    $0, %eax
> -.L34:
> -       .loc 1 3 0 discriminator 3
> -       testb   %al, %al
> -       je      .L18
> +       jne     .L18
>        .loc 1 4 0 is_stmt 1
>        movl    $4, %esi
>        movl    $.LC0, %edi
>
> Bootstrapped/regtested on x86_64-suse-linux, OK for the mainline?
>
>
> 2011-03-21  Eric Botcazou  
>
>        * gimplify.c (gimplify_vla_decl): Set TREE_THIS_NOTRAP flag.
>        (gimplify_cond_expr): Gimplify COMPOUND_EXPR conditions.
>
>
> --
> Eric Botcazou
>


[Ada] Implement switches to reorder record components in gigi

2011-03-21 Thread Eric Botcazou
This is the gigi part of the implementation of the -gnatd.r/-gnatd.v switches 
that allow record components to be reordered in certain cases.  The algorithm 
is documented in the code.

Tested on i586-suse-linux, applied on the mainline.


2011-03-21  Eric Botcazou  

* gcc-interface/decl.c (components_to_record): Add REORDER parameter,
rename DEBUG_INFO_P into DEBUG_INFO and move P_GNU_REP_LIST parameter
to the end of the list.  Adjust recursive call.  Rename local variable.
If REORDER is true, reorder components of the record type.
(gnat_to_gnu_entity): Pass OK_To_Reorder_Components flag as argument to
components_to_record and adjust the parameter list.


-- 
Eric Botcazou
Index: gcc-interface/decl.c
===
--- gcc-interface/decl.c	(revision 171220)
+++ gcc-interface/decl.c	(working copy)
@@ -159,8 +159,8 @@ static bool array_type_has_nonaliased_co
 static bool compile_time_known_address_p (Node_Id);
 static bool cannot_be_superflat_p (Node_Id);
 static bool constructor_address_p (tree);
-static void components_to_record (tree, Node_Id, tree, int, bool, tree *,
-  bool, bool, bool, bool, bool);
+static void components_to_record (tree, Node_Id, tree, int, bool, bool, bool,
+  bool, bool, bool, bool, tree *);
 static Uint annotate_value (tree);
 static void annotate_rep (Entity_Id, tree);
 static tree build_position_list (tree, bool, tree, tree, unsigned int, tree);
@@ -2951,9 +2951,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entit
 
 	/* Add the fields into the record type and finish it up.  */
 	components_to_record (gnu_type, Component_List (record_definition),
-			  gnu_field_list, packed, definition, NULL,
-			  false, all_rep, is_unchecked_union,
-			  debug_info_p, false);
+			  gnu_field_list, packed, definition, false,
+			  all_rep, is_unchecked_union, debug_info_p,
+			  false, OK_To_Reorder_Components (gnat_entity),
+			  NULL);
 
 	/* If it is passed by reference, force BLKmode to ensure that objects
 	   of this type will always be put in memory.  */
@@ -6992,10 +6993,6 @@ compare_field_bitpos (const PTR rt1, con
 
DEFINITION is true if we are defining this record type.
 
-   P_GNU_REP_LIST, if nonzero, is a pointer to a list to which each field
-   with a rep clause is to be added; in this case, that is all that should
-   be done with such fields.
-
CANCEL_ALIGNMENT is true if the alignment should be zeroed before laying
out the record.  This means the alignment only serves to force fields to
be bitfields, but not to require the record to be that aligned.  This is
@@ -7006,27 +7003,37 @@ compare_field_bitpos (const PTR rt1, con
UNCHECKED_UNION is true if we are building this type for a record with a
Pragma Unchecked_Union.
 
-   DEBUG_INFO_P is true if we need to write debug information about the type.
+   DEBUG_INFO is true if we need to write debug information about the type.
 
MAYBE_UNUSED is true if this type may be unused in the end; this doesn't
-   mean that its contents may be unused as well, but only the container.  */
+   mean that its contents may be unused as well, only the container itself.
 
+   REORDER is true if we are permitted to reorder components of this type.
+
+   P_GNU_REP_LIST, if nonzero, is a pointer to a list to which each field
+   with a rep clause is to be added; in this case, that is all that should
+   be done with such fields.  */
 
 static void
 components_to_record (tree gnu_record_type, Node_Id gnat_component_list,
 		  tree gnu_field_list, int packed, bool definition,
-		  tree *p_gnu_rep_list, bool cancel_alignment,
-		  bool all_rep, bool unchecked_union, bool debug_info_p,
-		  bool maybe_unused)
+		  bool cancel_alignment, bool all_rep,
+		  bool unchecked_union, bool debug_info,
+		  bool maybe_unused, bool reorder,
+		  tree *p_gnu_rep_list)
 {
   bool all_rep_and_size = all_rep && TYPE_SIZE (gnu_record_type);
   bool layout_with_rep = false;
   Node_Id component_decl, variant_part;
-  tree gnu_our_rep_list = NULL_TREE;
-  tree gnu_field, gnu_next, gnu_last = tree_last (gnu_field_list);
+  tree gnu_field, gnu_next, gnu_last;
+  tree gnu_variant_part = NULL_TREE;
+  tree gnu_rep_list = NULL_TREE;
+  tree gnu_var_list = NULL_TREE;
+  tree gnu_self_list = NULL_TREE;
 
   /* For each component referenced in a component declaration create a GCC
  field and add it to the list, skipping pragmas in the GNAT list.  */
+  gnu_last = tree_last (gnu_field_list);
   if (Present (Component_Items (gnat_component_list)))
 for (component_decl
 	   = First_Non_Pragma (Component_Items (gnat_component_list));
@@ -7046,7 +7053,7 @@ components_to_record (tree gnu_record_ty
 	else
 	  {
 	gnu_field = gnat_to_gnu_field (gnat_field, gnu_record_type, packed,
-	   definition, debug_info_p);
+	   definition, debug_info);
 
 	/* If this is the _Tag field,

Re: [build] Honor --disable-symvers (PR bootstrap/48135)

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

> On 03/21/2011 12:34 PM, Rainer Orth wrote:
>> Prompted by PR bootstrap/48135, I found that only libstdc++-v3 honors
>> --disable-symvers.  The following patch corrects this, but also notices
>> again the mess we've created by having at least 3 different sets of
>> checks for symbol versioning, each with its own variations ;-(  But this
>> is not the time to correct this (yet).
>>
>> Tested by a i386-pc-solaris2.11 bootstrap and checking that all
>> libraries were still versioned by default.  Then I removed and
>> configured/built the affected libraries again and checked that
>> versioning was correctly disabled.
>>
>> The patch below was created with -w to hide indentation changes.
>>
>> Ok for mainline now and perhaps 4.6.1?
>
> Ok for 4.7, RMs should decide about 4.6.1.

Applied, thanks.  It would be nice to get into 4.6 (even 4.6.1) since
otherwise install.texi which claims --disable-symvers as a workaround
lies :-)

Rainer

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


Re: [build] Link with libstdc++ for libpwl test (PR bootstrap/48120)

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

> On 03/21/2011 12:48 PM, Rainer Orth wrote:
>> As reported in the PR, the toplevel configure test for libpwl doesn't
>> work since it fails to link with libstdc++.  The following patch
>> corrects this.
>>
>> There were a couple of issues:
>>
>> * One cannot use LDFLAGS here since that is passed to $CC before -lpwl,
>>which of course fails with a static libpwl.  I'm using LIBS instead.
>>
>
> It's better anyway.
>
> Patch is okay.

Thanks, applied.  Should I sync to src, too?

Rainer

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


Re: [patch] Fix PR48183, NEON ICE in emit-rtl.c:immed_double_const() under -g

2011-03-21 Thread Chung-Lin Tang
On 2011/3/20 08:11 PM, Richard Guenther wrote:
> On Sun, Mar 20, 2011 at 12:01 PM, Chung-Lin Tang
>  wrote:
>> Hi,
>> PR48183 is a case where ARM NEON instrinsics, under -O -g, produce debug
>> insns that tries to expand OImode (32-byte integer) zero constants, much
>> too large to represent as two HOST_WIDE_INTs; as the internals manual
>> indicates, such large constants are not supported in general, and ICEs
>> on the GET_MODE_BITSIZE(mode) == 2*HOST_BITS_PER_WIDE_INT assertion.
>>
>> This patch allows the cases where the large integer constant is still
>> representable using a single CONST_INT, such as zero(0). Bootstrapped
>> and tested on i686 and x86_64, cross-tested on ARM, all without
>> regressions. Okay for trunk?
> 
> Hum, if you make it fit into a CONST_INT why not make it fit into a 
> CONST_DOUBLE
> where it should _always_ fit because of the limits of the arguments given to
> immed_double_const.  Thus, why not simply remove the assert - also a question

Well you're right, simply removing the assertion might work as well; my
patch sort of tried to solve the specific case at hand conservatively...

> for other reviewers?  Or rather, why does immed_double_const have a mode
> argument and does not require the caller to properly truncate?

I guess the existence of such large integer modes are probably
relatively new, and usually not directly used this way?

Thanks,
Chung-Lin


Re: [build] Link with libstdc++ for libpwl test (PR bootstrap/48120)

2011-03-21 Thread Paolo Bonzini

On 03/21/2011 01:40 PM, Rainer Orth wrote:

Paolo Bonzini  writes:


On 03/21/2011 12:48 PM, Rainer Orth wrote:

As reported in the PR, the toplevel configure test for libpwl doesn't
work since it fails to link with libstdc++.  The following patch
corrects this.

There were a couple of issues:

* One cannot use LDFLAGS here since that is passed to $CC before -lpwl,
which of course fails with a static libpwl.  I'm using LIBS instead.



It's better anyway.

Patch is okay.


Thanks, applied.  Should I sync to src, too?


Yes, always (except for libiberty/ and include/).

Paolo


Re: [testsuite, build] Convert boehm-gc testsuite to DejaGnu (PR boehm-gc/11412)

2011-03-21 Thread Rainer Orth
Mike Stump  writes:

>> +catch { exec $libtool --mode=clean rm -f $basename.lo }
>
> If libtool runs on the host, this doesn't do that, try:
>
>   [remote_exec host ... ]
>
> see gcc.exp for examples.
>
>> +catch { exec $libtool --mode=clean rm -f [file rootname [file tail 
>> $testcase]] $shlib }
>
> Likewise.

I've applied those changes, and also managed to fix the problems I had
in Tru64 UNIX testing.  Here's the patch I'd like to commit to 4.7.

It contains a couple of build changes beyond the last one, so I need
build maintainer approval for those:

* UNWINDLIBS is never set, thus removed as unused.

* On Tru64 UNIX, the tests need to be compiled with -pthread since
   errors out if not compiled with -D_REENTRANT.  To handle
  that, I collect the necessary flags in THREADCFLAGS and store that in
  site.exp.  Before, it was added to INCLUDES or AM_CPPFLAGS which seems
  wrong.

* I'm removing DG/UX support which has some thread stuff, but Hans
  already agreed that this can go as long obsolete.

Bootstrapped without regressions on {i386, sparc}-pc-solaris2.{8, 9, 10,
11} with Sun and GNU ld, alpha-dec-osf5.1b and mips-sgi-irix6.5.

Ok for mainline?

Thanks.
Rainer


2010-12-31  Rainer Orth  

PR boehm-gc/11412
* configure.ac (THREADCFLAGS): New variable.
Use it instead of INCLUDES, AM_CPPFLAGS.
Remove DG/UX support.
(AC_CONFIG_FILES): Add testsuite/Makefile.
* Makefile.am (AUTOMAKE_OPTIONS): Use foreign instead of cygnus.
(SUBDIRS): Add testsuite.
(libgcjgc_la_LIBADD): Remove $(UNWINDLIBS).
(AM_CXXFLAGS): Add $(THREADCFLAGS).
(AM_CFLAGS): Likewise.
Remove TESTS related variables.
(AM_MAKEFLAGS): Don't pass RUNTEST.
* Makefile.in: Regenerate.
* configure: Regenerate.
* testsuite/Makefile.am: New file.
* testsuite/Makefile.in: New file.
* testsuite/lib/boehm-gc.exp: New file.
* testsuite/config/default.exp: New file.
* testsuite/boehm-gc.c/c.exp: New file.
* testsuite/boehm-gc.lib/lib.exp: New file.
* tests/test.c: Move ...
* testsuite/boehm-gc.c/gctest.c: ... here.
* tests/leak_test.c, tests/middle.c, tests/thread_leak_test.c,
tests/trace_test.c: Move ...
* testsuite/boehm-gc.c: ... here.
* testsuite/boehm-gc.c/trace_test.c: Skip everywhere.
* tests/staticrootslib.c, tests/staticrootstest.c: Move ...
* testsuite/boehm-gc.lib: ... here.
* testsuite/boehm-gc.lib/staticrootstest.c: Use dg-add-shlib
staticrootslib.c.
* tests/test_cpp.cc: Move ...
* testsuite/boehm-gc.c++: ... here.

diff -r 8efcb4b03d45 boehm-gc/Makefile.am
--- a/boehm-gc/Makefile.am  Sun Mar 20 14:28:11 2011 +0100
+++ b/boehm-gc/Makefile.am  Sun Mar 20 21:37:14 2011 +0100
@@ -4,10 +4,10 @@
 ## files that should be in the distribution are not mentioned in this
 ## Makefile.am.
 
-AUTOMAKE_OPTIONS = cygnus subdir-objects
+AUTOMAKE_OPTIONS = foreign subdir-objects
 ACLOCAL_AMFLAGS = -I .. -I ../config
 
-SUBDIRS = include
+SUBDIRS = include testsuite
 
 noinst_LTLIBRARIES = libgcjgc.la libgcjgc_convenience.la
 
@@ -35,7 +35,7 @@
 
 # Include THREADLIBS here to ensure that the correct versions of
 # linuxthread semaphore functions get linked:
-libgcjgc_la_LIBADD = $(addobjs) $(THREADLIBS) $(UNWINDLIBS)
+libgcjgc_la_LIBADD = $(addobjs) $(THREADLIBS)
 libgcjgc_la_DEPENDENCIES = $(addobjs)
 libgcjgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:2:0 -rpath 
$(toolexeclibdir)
 libgcjgc_la_LINK = $(LINK) $(libgcjgc_la_LDFLAGS)
@@ -43,48 +43,11 @@
 libgcjgc_convenience_la_LIBADD = $(addobjs)
 libgcjgc_convenience_la_DEPENDENCIES = $(addobjs)
 
-AM_CXXFLAGS = $(GC_CFLAGS)
-AM_CFLAGS = $(GC_CFLAGS)
+AM_CXXFLAGS = $(GC_CFLAGS) $(THREADCFLAGS)
+AM_CFLAGS = $(GC_CFLAGS) $(THREADCFLAGS)
 AM_LDFLAGS = $(shell $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
 override CFLAGS := $(filter-out $(O0_CFLAGS), $(CFLAGS)) $(O0_CFLAGS)
 
-test_ldadd = libgcjgc.la $(THREADLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
-
-check_PROGRAMS = gctest
-gctest_SOURCES = tests/test.c
-gctest_LDADD = $(test_ldadd)
-gctest_LDFLAGS = -shared-libgcc
-gctest_LINK = $(LINK) $(gctest_LDFLAGS)
-TESTS_ENVIRONMENT = LD_LIBRARY_PATH=../../$(MULTIBUILDTOP)gcc
-TESTS = gctest
-
-TESTS += leaktest$(EXEEXT)
-check_PROGRAMS += leaktest
-leaktest_SOURCES = tests/leak_test.c
-leaktest_LDADD = $(test_ldadd)
-leaktest_LDFLAGS = -shared-libgcc
-leaktest_LINK = $(LINK) $(leaktest_LDFLAGS)
-
-TESTS += middletest$(EXEEXT)
-check_PROGRAMS += middletest
-middletest_SOURCES = tests/middle.c
-middletest_LDADD = $(test_ldadd)
-middletest_LDFLAGS = -shared-libgcc
-middletest_LINK = $(LINK) $(middletest_LDFLAGS)
-
-TESTS += staticrootstest$(EXEEXT)
-check_PROGRAMS += staticrootstest
-staticrootstest_SOURCES = tests/staticrootstest.c
-staticrootstest_LDADD = $(test_ldadd) libstaticrootslib.la
-staticrootstest_LDFLAGS = -shared-libgcc
-sta

Re: [Ada] Implement switches to reorder record components in gigi

2011-03-21 Thread Duncan Sands

Hi Eric, this looks like a nice improvement.  I noticed this mysterious undef
though - what is it for?

+#undef MOVE_FROM_FIELD_LIST_TO

Ciao, Duncan.


[PATCH] Fix PR 48143

2011-03-21 Thread Andrey Belevantsev

Hello,

As noted in the PR audit trail, the scheduler crashes for this bug because 
we see an SSE insn without proper reservation.  Uros has pointed several 
such insns to me.  The following patch adding athlon_decode attributes is 
bootstrapped and tested on x86_64.


Uros, you have preapproved the patch idea, but does it still look ok to 
you?  I have mostly copied reservations from bdver1 variants.


Richi, Jakub, do you want this in 4.6.1?  4.6.0?

Andrey


2011-03-21  Andrey Belevantsev  

PR rtl-optimization/48143
* config/i386/sse.md (*sse2_cvtpd2dq): Add athlon_decode attribute.
(*sse2_cvttpd2dq, sse2_cvtss2sd, *sse2_cvtpd2ps,
sse2_cvtps2pd): Likewise.

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 6200419..a50db12 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -2715,6 +2715,7 @@
(set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")
(set_attr "amdfam10_decode" "double")
+   (set_attr "athlon_decode" "double")
(set_attr "bdver1_decode" "double")])
 
 (define_insn "avx_cvttpd2dq256"
@@ -2746,6 +2747,7 @@
(set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")
(set_attr "amdfam10_decode" "double")
+   (set_attr "athlon_decode" "double")
(set_attr "bdver1_decode" "double")])
 
 (define_insn "*avx_cvtsd2ss"
@@ -2806,6 +2808,7 @@
   "cvtss2sd\t{%2, %0|%0, %2}"
   [(set_attr "type" "ssecvt")
(set_attr "amdfam10_decode" "vector,double")
+   (set_attr "athlon_decode" "direct,direct")
(set_attr "bdver1_decode" "direct,direct")
(set_attr "mode" "DF")])
 
@@ -2842,6 +2845,7 @@
(set_attr "prefix" "maybe_vex")
(set_attr "mode" "V4SF")
(set_attr "amdfam10_decode" "double")
+   (set_attr "athlon_decode" "double")
(set_attr "bdver1_decode" "double")])
 
 (define_insn "avx_cvtps2pd256"
@@ -2879,6 +2883,7 @@
(set_attr "mode" "V2DF")
(set_attr "prefix_data16" "0")
(set_attr "amdfam10_decode" "direct")
+   (set_attr "athlon_decode" "double")
(set_attr "bdver1_decode" "double")])
 
 (define_expand "vec_unpacks_hi_v4sf"


Re: [build] Honor --disable-symvers (PR bootstrap/48135)

2011-03-21 Thread Richard Guenther
On Mon, Mar 21, 2011 at 1:39 PM, Rainer Orth
 wrote:
> Paolo Bonzini  writes:
>
>> On 03/21/2011 12:34 PM, Rainer Orth wrote:
>>> Prompted by PR bootstrap/48135, I found that only libstdc++-v3 honors
>>> --disable-symvers.  The following patch corrects this, but also notices
>>> again the mess we've created by having at least 3 different sets of
>>> checks for symbol versioning, each with its own variations ;-(  But this
>>> is not the time to correct this (yet).
>>>
>>> Tested by a i386-pc-solaris2.11 bootstrap and checking that all
>>> libraries were still versioned by default.  Then I removed and
>>> configured/built the affected libraries again and checked that
>>> versioning was correctly disabled.
>>>
>>> The patch below was created with -w to hide indentation changes.
>>>
>>> Ok for mainline now and perhaps 4.6.1?
>>
>> Ok for 4.7, RMs should decide about 4.6.1.
>
> Applied, thanks.  It would be nice to get into 4.6 (even 4.6.1) since
> otherwise install.texi which claims --disable-symvers as a workaround
> lies :-)

Ok.

Thanks,
Richard.


Re: [build] Honor --disable-symvers (PR bootstrap/48135)

2011-03-21 Thread Rainer Orth
Richard Guenther  writes:

>>> Ok for 4.7, RMs should decide about 4.6.1.
>>
>> Applied, thanks.  It would be nice to get into 4.6 (even 4.6.1) since
>> otherwise install.texi which claims --disable-symvers as a workaround
>> lies :-)
>
> Ok.

Just to make no mistake: ok for 4.6.0 or ok for 4.6.1?

Thanks.
Rainer

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


[testsuite] Don't xfail 22_locale/num_put/put/char/14220.cc on 64-bit Solaris 10/SPARC

2011-03-21 Thread Rainer Orth
22_locale/num_put/put/char/14220.cc XPASSes on 64-bit Solaris 10/SPARC
for quite some time, so I'm removing the corresponding xfail.

Tested with the appropriate runtest invocations, installed on 4.5 branch
and mainline.  Ok for 4.6, too?

Thanks.
Rainer


2011-03-12  Rainer Orth  

* testsuite/22_locale/num_put/put/char/14220.cc: Don't xfail on
sparc*-sun-solaris2.10 && lp64.

diff -r ced857e5c4d7 libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc
--- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.ccSat Mar 
12 10:42:19 2011 +0100
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.ccSat Mar 
12 10:46:58 2011 +0100
@@ -1,6 +1,6 @@
 // 2004-04-30  Paolo Carlini  
 
-// Copyright (C) 2004, 2009, 2010 Free Software Foundation
+// Copyright (C) 2004, 2009, 2010, 2011 Free Software Foundation
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -19,13 +19,12 @@
 
 // 22.2.2.2.1  num_put members
 
-// On Solaris 9/x86, 32-bit Solaris 10/x86 and 64-bit Solaris 10/SPARC, this
-// test crashes in libc.  Inside libstdc++, we call sprintf like so:
+// On Solaris 9/x86 and 32-bit Solaris 10/x86, this test crashes in libc.
+// Inside libstdc++, we call sprintf like so:
 //   sprintf (buffer, "%.*f", 1000, 1.0)
 // which crashes.
 // { dg-xfail-run-if "" i?86-*-solaris2.9 }
 // { dg-xfail-run-if "" { i?86-*-solaris2.10 && ilp32 } }
-// { dg-xfail-run-if "" { sparc*-sun-solaris2.10 && lp64 } }
 
 #include 
 #include 


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


Re: [build] Honor --disable-symvers (PR bootstrap/48135)

2011-03-21 Thread Richard Guenther
On Mon, 21 Mar 2011, Rainer Orth wrote:

> Richard Guenther  writes:
> 
> >>> Ok for 4.7, RMs should decide about 4.6.1.
> >>
> >> Applied, thanks.  It would be nice to get into 4.6 (even 4.6.1) since
> >> otherwise install.texi which claims --disable-symvers as a workaround
> >> lies :-)
> >
> > Ok.
> 
> Just to make no mistake: ok for 4.6.0 or ok for 4.6.1?

Ok for 4.6.1.

Richard.

Re: [testsuite] Don't xfail 22_locale/num_put/put/char/14220.cc on 64-bit Solaris 10/SPARC

2011-03-21 Thread Richard Guenther
On Mon, 21 Mar 2011, Rainer Orth wrote:

> 22_locale/num_put/put/char/14220.cc XPASSes on 64-bit Solaris 10/SPARC
> for quite some time, so I'm removing the corresponding xfail.
> 
> Tested with the appropriate runtest invocations, installed on 4.5 branch
> and mainline.  Ok for 4.6, too?

Ok for 4.6, too.

Richard.

> Thanks.
>   Rainer
> 
> 
> 2011-03-12  Rainer Orth  
> 
>   * testsuite/22_locale/num_put/put/char/14220.cc: Don't xfail on
>   sparc*-sun-solaris2.10 && lp64.
> 
> diff -r ced857e5c4d7 
> libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc
> --- a/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc  Sat Mar 
> 12 10:42:19 2011 +0100
> +++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc  Sat Mar 
> 12 10:46:58 2011 +0100
> @@ -1,6 +1,6 @@
>  // 2004-04-30  Paolo Carlini  
>  
> -// Copyright (C) 2004, 2009, 2010 Free Software Foundation
> +// Copyright (C) 2004, 2009, 2010, 2011 Free Software Foundation
>  //
>  // This file is part of the GNU ISO C++ Library.  This library is free
>  // software; you can redistribute it and/or modify it under the
> @@ -19,13 +19,12 @@
>  
>  // 22.2.2.2.1  num_put members
>  
> -// On Solaris 9/x86, 32-bit Solaris 10/x86 and 64-bit Solaris 10/SPARC, this
> -// test crashes in libc.  Inside libstdc++, we call sprintf like so:
> +// On Solaris 9/x86 and 32-bit Solaris 10/x86, this test crashes in libc.
> +// Inside libstdc++, we call sprintf like so:
>  //   sprintf (buffer, "%.*f", 1000, 1.0)
>  // which crashes.
>  // { dg-xfail-run-if "" i?86-*-solaris2.9 }
>  // { dg-xfail-run-if "" { i?86-*-solaris2.10 && ilp32 } }
> -// { dg-xfail-run-if "" { sparc*-sun-solaris2.10 && lp64 } }
>  
>  #include 
>  #include 
> 
> 
> 

-- 
Richard Guenther 
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex


[Patch] Disable -mfdpic for bfin-uclinux target

2011-03-21 Thread Henderson, Stuart
-mfdpic is not supported for the bfin-uclinux target.  this patch defines a 
macro in the uclinux header and then adds a check to bfin.c if the macro is 
defined.

2011-03-21  Stuart Henderson 
   Originally from Bernd Schmidt
   * config/bfin/uclinux.h (SUBTARGET_FDPIC_NOT_SUPPORTED): New macro.
   * config/bfin/bfin.c (override_options): Test it and error if TARGET_FDPIC.


I don't have write privileges.

Thanks,
Stu


upstream.patch
Description: upstream.patch


[PATCH] Fix PR48210

2011-03-21 Thread Richard Guenther

Pretty obvious, require at least 1 partition.

Richard.

2011-03-31  Richard Guenther  

PR lto/48210
* params.def (lto-partitions): Require at least 1 partition.

Index: gcc/params.def
===
--- gcc/params.def  (revision 171229)
+++ gcc/params.def  (working copy)
@@ -868,7 +868,7 @@ DEFPARAM (PARAM_DEVIRT_TYPE_LIST_SIZE,
 DEFPARAM (PARAM_LTO_PARTITIONS,
  "lto-partitions",
  "Number of paritions program should be split to",
- 32, 0, 0)
+ 32, 1, 0)
 
 DEFPARAM (MIN_PARTITION_SIZE,
  "lto-min-partition",


Re: [PATCH] Fix PR48210

2011-03-21 Thread Rainer Orth
Richard Guenther  writes:

> Index: gcc/params.def
> ===
> --- gcc/params.def(revision 171229)
> +++ gcc/params.def(working copy)
> @@ -868,7 +868,7 @@ DEFPARAM (PARAM_DEVIRT_TYPE_LIST_SIZE,
>  DEFPARAM (PARAM_LTO_PARTITIONS,
> "lto-partitions",
> "Number of paritions program should be split to",

Not your patch, but ^ typo.

Rainer

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


[PATCH] Weaken PR47661

2011-03-21 Thread Richard Guenther

We force all maybe-trapping conditions into separate stmts, but this
isn't necessary w/o -fno-call-exceptions.  It also confuses our
branch prediction.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

The bug remains for -fnon-call-exceptions.

Richard.

2011-03-21  Richard Guenther  

PR middle-end/47661
* gimple.c (is_gimple_condexpr): Use tree_could_throw_p.

Index: gcc/gimple.c
===
--- gcc/gimple.c(revision 171142)
+++ gcc/gimple.c(working copy)
@@ -2581,7 +2581,7 @@ bool
 is_gimple_condexpr (tree t)
 {
   return (is_gimple_val (t) || (COMPARISON_CLASS_P (t)
-   && !tree_could_trap_p (t)
+   && !tree_could_throw_p (t)
&& is_gimple_val (TREE_OPERAND (t, 0))
&& is_gimple_val (TREE_OPERAND (t, 1;
 }



Re: [PATCH 02/18] enforce TREE_CHAIN and TREE_TYPE accesses

2011-03-21 Thread Nathan Froyd
On Sat, Mar 12, 2011 at 01:08:23PM +0100, Eric Botcazou wrote:
> > gcc/ada/
> > * gcc-interface/ada-tree.h (union lang_tree_node): Check for
> > TS_COMMON before calling TREE_CHAIN.
> > * gcc-interface/misc.c (gnat_init_ts): New function.
> > (LANG_HOOKS_INIT_TS): Define.
> 
> I presume that PLUS_NOMOD_EXPR, MINUS_NOMOD_EXPR and ATTR_ADDR_EXPR need not 
> be marked in gnat_init_ts?  If so, please add a single comment to that effect 
> in the function and reorder the lines to match the order in ada-tree.def.

Well, they never have their TREE_TYPE taken during bootstrap and test,
at least...

You're right, though; they should probably be marked as such for
completeness.  OK to commit with those additions and reordering as above
sight unseen, or would you like to see the patch?

-Nathan


Re: [PATCH] Fix PR48210

2011-03-21 Thread Joseph S. Myers
On Mon, 21 Mar 2011, Rainer Orth wrote:

> Richard Guenther  writes:
> 
> > Index: gcc/params.def
> > ===
> > --- gcc/params.def  (revision 171229)
> > +++ gcc/params.def  (working copy)
> > @@ -868,7 +868,7 @@ DEFPARAM (PARAM_DEVIRT_TYPE_LIST_SIZE,
> >  DEFPARAM (PARAM_LTO_PARTITIONS,
> >   "lto-partitions",
> >   "Number of paritions program should be split to",
> 
> Not your patch, but ^ typo.

(PR 47911.)

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: [build, doc] Obsolete Solaris 8 support

2011-03-21 Thread Joseph S. Myers
On Mon, 21 Mar 2011, Rainer Orth wrote:

> Therefore I'll soon commit this patch to obsolete Solaris 8 support in
> 4.7.  It will be removed in 4.8 then.

When obsoleting targets or other features, please update the release notes 
(gcc-4.7/changes.html).

-- 
Joseph S. Myers
jos...@codesourcery.com


invoke.texi: Fix minor typos

2011-03-21 Thread Nick Clifton
Hi Gerald, Hi Jospeh,

  The patch below fixes a bunch of minor typos in the invoke.texi file.
  I suspect that it might qualify as obvious, but I though that I ought
  to run it past you first.

  OK to apply ?

Cheers
  Nick

gcc/ChangeLog
2011-03-21  Nick Clifton  

* doc/invoke.texi (Overall Options): Move closing brace to end of
options list.
(Optimization Options): Add missing @gol.
(Directory Options): Likewise.
(i386 and x86-64 Options): Likewise.
(RS6000 and PowerPC Options): Likewise.
(i386 and x86-64 Windows Options): Likewise.
(V850 Options): Add text missing from descriptions.

Index: gcc/doc/invoke.texi
===
--- gcc/doc/invoke.texi	(revision 171210)
+++ gcc/doc/invoke.texi	(working copy)
@@ -165,7 +165,7 @@
 -pipe  -pass-exit-codes  @gol
 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
--fdump-ada-spec@r{[}-slim@r{]}} -fdump-go-spec=@var{file}
+-fdump-ada-spec@r{[}-slim@r{]} -fdump-go-spec=@var{file}}
 
 @item C Language Options
 @xref{C Dialect Options,,Options Controlling C Dialect}.
@@ -357,7 +357,7 @@
 -fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
 -floop-block -floop-flatten -floop-interchange -floop-strip-mine @gol
--floop-parallelize-all -flto -flto-compression-level
+-floop-parallelize-all -flto -flto-compression-level @gol
 -flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
@@ -435,9 +435,9 @@
 
 @item Directory Options
 @xref{Directory Options,,Options for Directory Search}.
-@gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir}}
--iquote@var{dir} -L@var{dir} -specs=@var{file} -I-
---sysroot=@var{dir}
+@gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
+-iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
+--sysroot=@var{dir}}
 
 @item Machine Dependent Options
 @xref{Submodel Options,,Hardware Models and Configurations}.
@@ -595,7 +595,7 @@
 -masm=@var{dialect}  -mno-fancy-math-387 @gol
 -mno-fp-ret-in-387  -msoft-float @gol
 -mno-wide-multiply  -mrtd  -malign-double @gol
--mpreferred-stack-boundary=@var{num}
+-mpreferred-stack-boundary=@var{num} @gol
 -mincoming-stack-boundary=@var{num} @gol
 -mcld -mcx16 -msahf -mmovbe -mcrc32 -mrecip -mvzeroupper @gol
 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
@@ -802,7 +802,7 @@
 -mprototype  -mno-prototype @gol
 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
--mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision
+-mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
 -mno-recip-precision @gol
 -mveclibabi=@var{type} -mfriz -mno-friz}
 
@@ -906,7 +906,7 @@
 See i386 and x86-64 Options.
 
 @emph{i386 and x86-64 Windows Options}
-@gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
+@gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
 -mnop-fun-dllimport -mthread @gol
 -municode -mwin32 -mwindows -fno-set-stack-executable}
 
@@ -17440,12 +17452,13 @@
 @item -mv850e2
 @opindex mv850e2
 Specify that the target processor is the V850E2.  The preprocessor
-constants @samp{__v850e2__} will be defined if
+constants @samp{__v850e2__} will be defined if this option is used.
 
 @item -mv850e1
 @opindex mv850e1
 Specify that the target processor is the V850E1.  The preprocessor
 constants @samp{__v850e1__} and @samp{__v850e__} will be defined if
+this option is used.
 
 @item -mv850es
 @opindex mv850es


[patch commited] rs6000/t-freebsd 4.6 branch

2011-03-21 Thread Andreas Tobler

All,

I committed the obvious patch below after asking Jakub.

Andreas

2011-03-21  Andreas Tobler  

* config/rs6000/t-freebsd: Remove duplication from file.


Index: t-freebsd
===
--- t-freebsd   (revision 171238)
+++ t-freebsd   (working copy)
@@ -22,29 +22,3 @@
 # Invoke this file after rs6000/t-ppccomm.

 LIB2FUNCS_EXTRA = tramp.S
-
-# Overrides for FreeBSD PowerPC
-#
-# Copyright (C) 2011 Free Software Foundation, Inc.
-#
-# 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
-# .
-
-# We do not want to build darwin-ldouble.c, so set the LIB2FUNCS_EXTRA 
again.

-# Invoke this file after rs6000/t-ppccomm.
-
-LIB2FUNCS_EXTRA = tramp.S
-


Re: [PATCH] Fix PR 48143

2011-03-21 Thread Uros Bizjak
2011/3/21 Andrey Belevantsev :
> Hello,
>
> As noted in the PR audit trail, the scheduler crashes for this bug because
> we see an SSE insn without proper reservation.  Uros has pointed several
> such insns to me.  The following patch adding athlon_decode attributes is
> bootstrapped and tested on x86_64.
>
> Uros, you have preapproved the patch idea, but does it still look ok to you?
>  I have mostly copied reservations from bdver1 variants.
>
> Richi, Jakub, do you want this in 4.6.1?  4.6.0?
>
> Andrey
>
>
> 2011-03-21  Andrey Belevantsev  
>
>        PR rtl-optimization/48143
>        * config/i386/sse.md (*sse2_cvtpd2dq): Add athlon_decode attribute.
>        (*sse2_cvttpd2dq, sse2_cvtss2sd, *sse2_cvtpd2ps,
>        sse2_cvtps2pd): Likewise.

Can you please cross-check these added attribute with the values in
Chapter C.7 (Table 18) and C.8 (Table 19) in [1] ? Otherwise, the
patch is OK.

[1] http://support.amd.com/us/Processor_TechDocs/25112.PDF

Thanks,
Uros.


Re: [PATCH] Fix PR48210

2011-03-21 Thread Richard Guenther
On Mon, 21 Mar 2011, Joseph S. Myers wrote:

> On Mon, 21 Mar 2011, Rainer Orth wrote:
> 
> > Richard Guenther  writes:
> > 
> > > Index: gcc/params.def
> > > ===
> > > --- gcc/params.def(revision 171229)
> > > +++ gcc/params.def(working copy)
> > > @@ -868,7 +868,7 @@ DEFPARAM (PARAM_DEVIRT_TYPE_LIST_SIZE,
> > >  DEFPARAM (PARAM_LTO_PARTITIONS,
> > > "lto-partitions",
> > > "Number of paritions program should be split to",
> > 
> > Not your patch, but ^ typo.
> 
> (PR 47911.)

Committed.

2011-03-21  Richard Guenther  

PR translation/47911
* params.def (lto-partitions): Fix typo.
(lto-min-partition): Fix wording.

Index: gcc/params.def
===
--- gcc/params.def  (revision 171236)
+++ gcc/params.def  (working copy)
@@ -867,12 +867,12 @@ DEFPARAM (PARAM_DEVIRT_TYPE_LIST_SIZE,
 
 DEFPARAM (PARAM_LTO_PARTITIONS,
  "lto-partitions",
- "Number of paritions program should be split to",
+ "Number of partitions the program should be split to",
  32, 1, 0)
 
 DEFPARAM (MIN_PARTITION_SIZE,
  "lto-min-partition",
- "Size of minimal paritition for WHOPR (in estimated instructions)",
+ "Minimal size of a paritition for LTO (in estimated instructions)",
  1000, 0, 0)
 
 /* Diagnostic parameters.  */


[patch committed] rs6000/t-freebsd trunk

2011-03-21 Thread Andreas Tobler

All,

I committed this obvious patch also to trunk.

Andreas

2011-03-21  Andreas Tobler  

* config/rs6000/t-freebsd: Remove duplication from file.


Index: t-freebsd
===
--- t-freebsd   (revision 171238)
+++ t-freebsd   (working copy)
@@ -22,29 +22,3 @@
  # Invoke this file after rs6000/t-ppccomm.

  LIB2FUNCS_EXTRA = tramp.S
-
-# Overrides for FreeBSD PowerPC
-#
-# Copyright (C) 2011 Free Software Foundation, Inc.
-#
-# 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
-# .
-
-# We do not want to build darwin-ldouble.c, so set the LIB2FUNCS_EXTRA
again.
-# Invoke this file after rs6000/t-ppccomm.
-
-LIB2FUNCS_EXTRA = tramp.S
-


Re: [PATCH] Fix PR48210

2011-03-21 Thread Rainer Orth
Richard Guenther  writes:

>  DEFPARAM (MIN_PARTITION_SIZE,
> "lto-min-partition",
> -   "Size of minimal paritition for WHOPR (in estimated instructions)",
> +   "Minimal size of a paritition for LTO (in estimated instructions)",

Another typo :-)^

Rainer

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


Re: [PATCH] Fix PR48210

2011-03-21 Thread Richard Guenther
On Mon, 21 Mar 2011, Rainer Orth wrote:

> Richard Guenther  writes:
> 
> >  DEFPARAM (MIN_PARTITION_SIZE,
> >   "lto-min-partition",
> > - "Size of minimal paritition for WHOPR (in estimated instructions)",
> > + "Minimal size of a paritition for LTO (in estimated instructions)",
> 
> Another typo :-)  ^

Fixed.

Clearly shows the value of spell-checkers in IDEs ;)  Of course I
simply blame Honza ... ;)

Richard.

2011-03-21  Richard Guenther  

* params.def (lto-min-partition): Fix typo.

Index: gcc/params.def
===
--- gcc/params.def  (revision 171244)
+++ gcc/params.def  (working copy)
@@ -872,7 +872,7 @@ DEFPARAM (PARAM_LTO_PARTITIONS,
 
 DEFPARAM (MIN_PARTITION_SIZE,
  "lto-min-partition",
- "Minimal size of a paritition for LTO (in estimated instructions)",
+ "Minimal size of a partition for LTO (in estimated instructions)",
  1000, 0, 0)
 
 /* Diagnostic parameters.  */


Re: PATCH: copy_addr_to_reg: Convert to Pmode if needed

2011-03-21 Thread Richard Sandiford
"H.J. Lu"  writes:
> diff --git a/gcc/explow.c b/gcc/explow.c
> index 460af1f..9b3c082 100644
> --- a/gcc/explow.c
> +++ b/gcc/explow.c
> @@ -611,6 +611,8 @@ copy_to_reg (rtx x)
>  rtx
>  copy_addr_to_reg (rtx x)
>  {
> +  if (GET_MODE (x) != VOIDmode && GET_MODE (x) != Pmode)
> +x = convert_to_mode (Pmode, x, 1);
>return copy_to_mode_reg (Pmode, x);
>  }

I think you need to say why the conversion should be done here
rather than in the caller.

Regardless of that, though: I think this should be convert_memory_address
rather than convert_to_mode.  Paasing 1 is wrong, because pointers are
signed on some targets.

Richard


[PATCH] More ternary RHS, less single

2011-03-21 Thread Richard Guenther

This removes odd things from being a valid RHS and transitions the two
easy cases from single to ternary RHS.  There are now two codes left
that should IMHO move over to ternary, COND_EXPR and VEC_COND_EXPR.
I'll tackle them separately.

Bootstrapped and tested on x86_64-unknown-linux-gnu, testing in progress.

I plan to commit this tomorrow if there are no complaints.

Richard.

2011-03-21  Richard Guenther  

* gimple.c (gimple_rhs_class_table): POLYNOMIAL_CHREC is not
a valid RHS.  Make DOT_PROD_EXPR and REALIGN_LOAD_EXPR ternary.
* tree-cfg.c (verify_gimple_assign_ternary): Allow DOT_PROD_EXPR
and REALIGN_LOAD_EXPR.
(verify_gimple_assign_single): Do not allow POLYNOMIAL_CHREC,
DOT_PROD_EXPR or REALIGN_LOAD_EXPR.
* expr.c (expand_expr_real_1): Move REALIGN_LOAD_EXPR and
DOT_PROD_EXPR case ...
(expand_expr_real_2): ... here.
* gimple-pretty-print.c (dump_ternary_rhs): Handle DOT_PROD_EXPR
and REALIGN_LOAD_EXPR.
* tree-data-ref.c (split_constant_offset): Bail out for all CHRECs.
* tree-vect-loop.c (vect_model_reduction_cost): Handle ternaries.
(vect_create_epilog_for_reduction): Likewise.
(vectorizable_reduction): Likewise.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern): Adjust.
* tree-vect-stmts.c (vectorizable_load): Likewise.

Index: gcc/gimple.c
===
*** gcc/gimple.c.orig   2011-03-21 16:28:59.0 +0100
--- gcc/gimple.c2011-03-21 17:21:21.0 +0100
*** get_gimple_rhs_num_ops (enum tree_code c
*** 2514,2519 
--- 2514,2521 
 : (SYM) == TRUTH_NOT_EXPR ? GIMPLE_UNARY_RHS   
\
 : ((SYM) == WIDEN_MULT_PLUS_EXPR   \
|| (SYM) == WIDEN_MULT_MINUS_EXPR   
\
+   || (SYM) == DOT_PROD_EXPR   
\
+   || (SYM) == REALIGN_LOAD_EXPR   \
|| (SYM) == FMA_EXPR) ? GIMPLE_TERNARY_RHS  \
 : ((SYM) == COND_EXPR  \
|| (SYM) == CONSTRUCTOR \
*** get_gimple_rhs_num_ops (enum tree_code c
*** 2522,2531 
|| (SYM) == ADDR_EXPR   \
|| (SYM) == WITH_SIZE_EXPR  \
|| (SYM) == SSA_NAME\
!   || (SYM) == POLYNOMIAL_CHREC\
!   || (SYM) == DOT_PROD_EXPR   
\
!   || (SYM) == VEC_COND_EXPR   
\
!   || (SYM) == REALIGN_LOAD_EXPR) ? GIMPLE_SINGLE_RHS  \
 : GIMPLE_INVALID_RHS),
  #define END_OF_BASE_TREE_CODES (unsigned char) GIMPLE_INVALID_RHS,
  
--- 2524,2530 
|| (SYM) == ADDR_EXPR   \
|| (SYM) == WITH_SIZE_EXPR  \
|| (SYM) == SSA_NAME\
!   || (SYM) == VEC_COND_EXPR) ? GIMPLE_SINGLE_RHS  \
 : GIMPLE_INVALID_RHS),
  #define END_OF_BASE_TREE_CODES (unsigned char) GIMPLE_INVALID_RHS,
  
Index: gcc/tree-cfg.c
===
*** gcc/tree-cfg.c.orig 2011-03-21 16:28:59.0 +0100
--- gcc/tree-cfg.c  2011-03-21 17:21:38.0 +0100
*** verify_gimple_assign_ternary (gimple stm
*** 3742,3747 
--- 3742,3752 
}
break;
  
+ case DOT_PROD_EXPR:
+ case REALIGN_LOAD_EXPR:
+   /* FIXME.  */
+   return false;
+ 
  default:
gcc_unreachable ();
  }
*** verify_gimple_assign_single (gimple stmt
*** 3872,3881 
  case OBJ_TYPE_REF:
  case ASSERT_EXPR:
  case WITH_SIZE_EXPR:
- case POLYNOMIAL_CHREC:
- case DOT_PROD_EXPR:
  case VEC_COND_EXPR:
- case REALIGN_LOAD_EXPR:
/* FIXME.  */
return res;
  
--- 3877,3883 
Index: gcc/expr.c
===
*** gcc/expr.c.orig 2011-03-21 16:28:59.0 +0100
--- gcc/expr.c  2011-03-21 16:37:18.0 +0100
*** expand_expr_real_2 (sepops ops, rtx targ
*** 8259,8264 
--- 8259,8294 
mode = TYPE_MODE (TREE_TYPE (treeop0));
goto binop;
  
+ case DOT_PROD_EXPR:
+   {
+   tree oprnd0 = treeop0;
+   tree oprnd1 = treeop1;
+   tree oprnd2 = treeop2;
+   rtx op2;
+ 
+   expand_operands (oprnd0, oprnd1, NULL_RTX, &op0, &op1, EXPAND_NORMAL);
+   op2 = expand_normal (oprnd2);
+   target = expand_widen_patter

Re: [PATCH] Fix shorten_compare (PR c/48197)

2011-03-21 Thread Joseph S. Myers
On Sun, 20 Mar 2011, Jakub Jelinek wrote:

> 2011-03-20  Jakub Jelinek  
> 
>   PR c/48197
>   * c-common.c (shorten_compare): If primopN is first sign-extended
>   to opN and then zero-extended to result type, set primopN to opN.
> 
>   * gcc.c-torture/execute/pr48197.c: New test.

This is OK, in that I believe it is (a) correct and (b) a sensible place 
in the current context to fix this to avoid problems with shorten_compare 
not working with mixed extensions.  It's worth checking if this fixes PR 
42544 as well, since that also looks like it involves mixed extensions.

shorten_compare is of course a mess and could do with being moved to the 
middle-end (ideally gimple-fold, I think) - and with having a proper 
conceptual model of combinations of integer conversions rather than 
various ad hoc cases.  (The same applies to other shortening in front ends 
- and to anything using get_narrower at all.)  Suppose you separate out 
the floating-point bits so you are only dealing with sequences of integer 
conversions.  Then any such sequence can be reduced to the following (or a 
subset thereof): truncate to A bits, sign-extend to B bits and zero-extend 
to C bits (convert to a signed A-bit type, an unsigned B-bit type and an 
unsigned C-bit type).  I think these optimizations would be both (a) safer 
and (b) more likely to cover all cases if they worked by computing the 
values of A, B and C (and the associated inner operands that get truncated 
/ extended), using any available range information to determine that 
sign-extension is actually zero-extension in some cases, and then reasoned 
about what the best code to generate is in terms of those values.  (You 
can also integrate left and right shifts by constant values and bitwise 
AND, OR and XOR with constants into a more general version of this model - 
truncate, left shift, sign extend, XOR with a constant, force some bits to 
0 and some bits to 1 - though I don't know how useful that would be.)

-- 
Joseph S. Myers
jos...@codesourcery.com


Re: [build, doc] Obsolete Solaris 8 support

2011-03-21 Thread Rainer Orth
"Joseph S. Myers"  writes:

> On Mon, 21 Mar 2011, Rainer Orth wrote:
>
>> Therefore I'll soon commit this patch to obsolete Solaris 8 support in
>> 4.7.  It will be removed in 4.8 then.
>
> When obsoleting targets or other features, please update the release notes 
> (gcc-4.7/changes.html).

Like this?  Or should I link to the UI threads removal patch, too?

Rainer


2011-03-21  Rainer Orth  

* htdocs/gcc-4.7/changes.html (Caveats): Document Solaris 8
obsoletion, Solaris threads removal.

Index: htdocs/gcc-4.7/changes.html
===
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v
retrieving revision 1.1
diff -u -p -r1.1 changes.html
--- htdocs/gcc-4.7/changes.html 14 Mar 2011 13:52:00 -  1.1
+++ htdocs/gcc-4.7/changes.html 21 Mar 2011 16:45:37 -
@@ -14,8 +14,27 @@
 Caveats
 
   
-...
- 
+Support for a number of older systems and recently
+unmaintained or untested target ports of GCC has been declared
+obsolete in GCC 4.7.  Unless there is activity to revive them, the
+next release of GCC will have their sources permanently
+removed.
+
+The following ports for individual systems on
+particular architectures have been obsoleted:
+
+
+ Solaris 8 (*-*-solaris2.8).  Details can be found in the
+ http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01263.html";>
+ announcement.
+
+
+
+
+Support has been removed for Unix International threads on Solaris
+2, so the --enable-threads=solaris configure option and
+the -threads compiler option don't work any longer.
+  
 
 General Optimizer Improvements
 


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


Re: [PATCH] libstdc++ ABI issues with __int128

2011-03-21 Thread Benjamin Kosnik
> The problem is that abicheck only flags as incompatible additions to
> GLIBCXX_3.4, but not other base versions.  Ideally it would flag addition
> to any version that hasn't been added (addition of the version is flagged
> by
> OBJECT:0:CXXABI_1.3.5
> etc. entries (no @s in it).
> This patch for now just complains about additions to any base versions,
> I'll leave the better alternative to you ;)

Yes, this seems like an improvement, thanks. I see that I already have
a note in testsuite_abi.cc about stricter version checking.

-benjamin


Re: [build, doc] Obsolete Solaris 8 support

2011-03-21 Thread Joseph S. Myers
On Mon, 21 Mar 2011, Rainer Orth wrote:

> "Joseph S. Myers"  writes:
> 
> > On Mon, 21 Mar 2011, Rainer Orth wrote:
> >
> >> Therefore I'll soon commit this patch to obsolete Solaris 8 support in
> >> 4.7.  It will be removed in 4.8 then.
> >
> > When obsoleting targets or other features, please update the release notes 
> > (gcc-4.7/changes.html).
> 
> Like this?  Or should I link to the UI threads removal patch, too?

I don't think such a link is needed.

-- 
Joseph S. Myers
jos...@codesourcery.com


[cxx-mem-model] test invalid bitfield twiddling

2011-03-21 Thread Aldy Hernandez

This test is inspired by PR 48124.

[Jakub, let me know if you find any additional variations on this theme.]

In the C++ memory model, non contiguous bitfields are distinct memory 
locations and cannot be accessed by and/or magic if we introduce data races.


In the test below, we can trigger invalid bit twiddling by declaring a 
bit field as volatile and then accessing it.  On x86-64, we end up using 
a 32-bit access which ends up touching the rest of the fields.


Unfortunately, I can't come up with a suitable test without the 
volatile-- I guess that's a good thing (either that, or my bit twiddle 
skills are lacking).


Committing to branch.

p.s. Oh yeah, I found some small buglets in the harness which are fixed 
below.
testsuite/
* lib/gcc-memmodel-gdb-test.exp: Return if no executable.
* gcc.dg/memmodel/memmodel.h (memmodel_done): Add noinline
attribute.
* g++.dg/memmodel/bitfields.C: New.

Index: testsuite/lib/gcc-memmodel-gdb-test.exp
===
--- testsuite/lib/gcc-memmodel-gdb-test.exp (revision 170852)
+++ testsuite/lib/gcc-memmodel-gdb-test.exp (working copy)
@@ -35,6 +35,10 @@ proc memmodel-gdb-test { } {
 set exec_file "[file rootname [file tail $prog]].exe"
 set cmd_file "$testsuite_dir/gcc.dg/memmodel/memmodel.gdb"
 
+if ![file exists $exec_file] {
+   return
+}
+
 send_log "Spawning: $gdb_name -nx -nw -quiet -x $cmd_file ./$exec_file\n"
 set res [remote_spawn target "$gdb_name -nx -nw  -x $cmd_file 
./$exec_file"]
 if { $res < 0 || $res == "" } {
Index: testsuite/gcc.dg/memmodel/memmodel.h
===
--- testsuite/gcc.dg/memmodel/memmodel.h(revision 170852)
+++ testsuite/gcc.dg/memmodel/memmodel.h(working copy)
@@ -1,6 +1,6 @@
 int memmodel_fini = 0;
 
-void
+void __attribute__((noinline))
 memmodel_done ()
 {
   memmodel_fini = 1;
Index: testsuite/g++.dg/memmodel/bitfields.C
===
--- testsuite/g++.dg/memmodel/bitfields.C   (revision 0)
+++ testsuite/g++.dg/memmodel/bitfields.C   (revision 0)
@@ -0,0 +1,73 @@
+/* { dg-do link } */
+/* { dg-options "-O2 --param allow-load-data-races=0 --param 
allow-store-data-races=0" } */
+/* { dg-final { memmodel-gdb-test } } */
+
+/* Test that setting  does not touch either  or .
+   In the C++ memory model, non contiguous bitfields ("a" and "c"
+   here) should be considered as distinct memory locations, so we
+   can't use bit twiddling to set either one.  */
+
+#include 
+#include "memmodel.h"
+
+#define CONSTA 12
+
+static int global;
+struct S
+{
+  /* On x86-64, the volatile causes us to access  with a 32-bit
+ access, and thus trigger this test.  */
+  volatile unsigned int a : 4;
+
+  unsigned char b;
+  unsigned int c : 6;
+} var;
+
+void set_a()
+{
+  var.a = CONSTA;
+}
+
+void memmodel_other_threads()
+{
+  ++global;
+  var.b = global;
+  var.c = global;
+}
+
+int memmodel_step_verify()
+{
+  int ret = 0;
+  if (var.b != global)
+{
+  printf ("FAIL: Unexpected value: var.b is %d, should be %d\n",
+ var.b, global);
+  ret = 1;
+}
+  if (var.c != global)
+{
+  printf ("FAIL: Unexpected value: var.c is %d, should be %d\n",
+ var.c, global);
+  ret = 1;
+}
+  return ret;
+}
+
+int memmodel_final_verify()
+{
+  int ret = memmodel_step_verify();
+  if (var.a != CONSTA)
+{
+  printf ("FAIL: Unexpected value: var.a is %d, should be %d\n",
+ var.a, CONSTA);
+  ret = 1;
+}
+  return ret;
+}
+
+int main()
+{
+  set_a();
+  memmodel_done();
+  return 0;
+}


Re: [PATCH] libstdc++ ABI issues with __int128

2011-03-21 Thread Benjamin Kosnik
> Most of the linux targets are actually __GXX_TYPEINFO_EQUALITY_INLINE 1
> and thus perhaps if we want to maintain some ABI compatibility with 3.4-ish
> inlined typeid comparisons, we might need to export _ZTS* for _ZTI*
> that could somehow be emitted for user code too.

Right, for C++98 types.

> Thus perhaps the _ZT[IS][PK]*[no] change is right, but we can only do it
> only for the builtin types (and, clearly we've been doing that in the past,
> for decltype(nullptr)/_Decimal{32,64,128}/char{16,32}_t.
>
> If/when we decide to break ABI for C++, we could just make all _ZTS* symbols
> hidden.

... so for the new builtin C++0X types where there is no prior compat
issue, _ZTS* can be elided in the current ABI. The for libstdc++.so >
6 we can do much better on a lot of this stuff. I'm trying to store
intelligence about the future in gnu-versioned-namespace.ver.

I need to add a note about this to the abi docs. But I can do that
later and get out of the critical path for you and RC2.

-benjamin


Re: [build, doc] Obsolete Solaris 8 support

2011-03-21 Thread Rainer Orth
"Joseph S. Myers"  writes:

>> > When obsoleting targets or other features, please update the release notes 
>> > (gcc-4.7/changes.html).
>> 
>> Like this?  Or should I link to the UI threads removal patch, too?
>
> I don't think such a link is needed.

Ok, I've checked in the patch.

Thanks.
Rainer

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


Re: [PATCH] libstdc++ ABI issues with __int128

2011-03-21 Thread Jakub Jelinek
On Mon, Mar 21, 2011 at 05:52:52PM +0100, Benjamin Kosnik wrote:
> > The problem is that abicheck only flags as incompatible additions to
> > GLIBCXX_3.4, but not other base versions.  Ideally it would flag addition
> > to any version that hasn't been added (addition of the version is flagged
> > by
> > OBJECT:0:CXXABI_1.3.5
> > etc. entries (no @s in it).
> > This patch for now just complains about additions to any base versions,
> > I'll leave the better alternative to you ;)
> 
> Yes, this seems like an improvement, thanks. I see that I already have
> a note in testsuite_abi.cc about stricter version checking.

Well, such stricter checking wouldn't be completely painless, e.g. currently
both current baseline_symbols.txt and the ones I've posted don't include the
two TLS: lines, because of the fear that not everyone has TLS enabled.
If baseline_symbols.txt right now miss some symbols, it is not a big deal
if it is not in the base version (with my patch base versions), but with
stricter checking it would complain.  Either we'd just say that TLS is
assumed on these targets and add the TLS: lines, or we'd need to invent
some symbol conditionalizing or something.

Jakub


Re: [PATCH][ARM] Fix RVCT interoperation issue

2011-03-21 Thread Andrew Stubbs

On 14/03/11 21:21, Ramana Radhakrishnan wrote:

This is OK for trunk.


Committed, thanks.

Andrew


Fix a few use-after-free issues

2011-03-21 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


This fixes a couple use-after-free problems and one use-after-free
non-problem.

In cfgrtl.c, redirect_branch_edge may delete its first argument, so this
code is clearly erroneous:

  e->flags &= ~EDGE_FALLTHRU;
  redirected = redirect_branch_edge (e, dest);
  gcc_assert (redirected);
  e->flags |= EDGE_FALLTHRU;
  df_set_bb_dirty (e->src);
  return e;

This fix is obvious, use REDIRECTED rather than E after the call to
redirect_branch_edge.

Similarly for redirect_edge_succ_nodup in this fragment:

ret = redirect_edge_succ_nodup (e, dest);
if (dump_file)
fprintf (dump_file, "Fallthru edge %i->%i redirected to %i\n",
 e->src->index, e->dest->index, dest->index);
  }
Luckily in this case the use-after-free only occurs when dumping, so it
won't typically affect end users.


The non-problem is this code in cfg.c:

if (s->probability > REG_BR_PROB_BASE)
s->probability = REG_BR_PROB_BASE;
s->count += e->count;
remove_edge (e);
redirect_edge_var_map_dup (s, e);
e = s;

remove_edge frees E, when we then use in redirect_edge_var_map_dup.
Luckily we only care about the pointer value of E which doesn't change.
 Regardless, I fixed this to keep the static checkers quiet.

Bootstrapped and regression tested on x86_64-unknown-linux-gnu.  Ok for
the trunk?

Jeff
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNh4zMAAoJEBRtltQi2kC7LFMH/j5/rNrFTvxX9mEv0qV4ezGk
fGuuitZfKEqXFY1oSKiyhawPpql0RbmmAJAOg4RHQzMnxMdUFJXcxpLzuXQG6TOr
9IapfQHi7siUKyAGq3OKChXFL+6Gx+NiTP7Ll8l6zSoF41FNEbrkHxfD0FXj/fkI
7JJyOsJEfrAbZiffU6e828Ku6mYwPc6wbDhk1YekFgZKQWfYDbkExZ2/twEyH1hO
yPMHgC0Jd9Nysnj1lxxDeGIW0Jhzej14aC8ugfzzMf/auj1hOIjk4t8k6KKSYvTu
ZzX5rHxfel0xDwAXbum/M38pgnEUznl6kIbLDiJOBJfIA/YBdDk+XTyB99OLcdc=
=QNh1
-END PGP SIGNATURE-
* cfg.c (redirect_edge_succ_nodup): Duplicate the var map
before removing the edge.

* cfgrtl.c (cfg_layout_redirect_edge_and_branch): Do not use
E after it may have been freed by redirect_branch_edge or
redirect_edge_succ_nodup.

Index: cfg.c
===
*** cfg.c   (revision 171074)
--- cfg.c   (working copy)
*** redirect_edge_succ_nodup (edge e, basic_
*** 402,409 
if (s->probability > REG_BR_PROB_BASE)
s->probability = REG_BR_PROB_BASE;
s->count += e->count;
-   remove_edge (e);
redirect_edge_var_map_dup (s, e);
e = s;
  }
else
--- 402,409 
if (s->probability > REG_BR_PROB_BASE)
s->probability = REG_BR_PROB_BASE;
s->count += e->count;
redirect_edge_var_map_dup (s, e);
+   remove_edge (e);
e = s;
  }
else
Index: cfgrtl.c
===
*** cfgrtl.c(revision 171074)
--- cfgrtl.c(working copy)
*** cfg_layout_redirect_edge_and_branch (edg
*** 2537,2545 
  e->flags &= ~EDGE_FALLTHRU;
  redirected = redirect_branch_edge (e, dest);
  gcc_assert (redirected);
! e->flags |= EDGE_FALLTHRU;
! df_set_bb_dirty (e->src);
! return e;
}
/* In case we are redirecting fallthru edge to the branch edge
 of conditional jump, remove it.  */
--- 2537,2545 
  e->flags &= ~EDGE_FALLTHRU;
  redirected = redirect_branch_edge (e, dest);
  gcc_assert (redirected);
! redirected->flags |= EDGE_FALLTHRU;
! df_set_bb_dirty (redirected->src);
! return redirected;
}
/* In case we are redirecting fallthru edge to the branch edge
 of conditional jump, remove it.  */
*** cfg_layout_redirect_edge_and_branch (edg
*** 2556,2562 
ret = redirect_edge_succ_nodup (e, dest);
if (dump_file)
fprintf (dump_file, "Fallthru edge %i->%i redirected to %i\n",
!e->src->index, e->dest->index, dest->index);
  }
else
  ret = redirect_branch_edge (e, dest);
--- 2556,2562 
ret = redirect_edge_succ_nodup (e, dest);
if (dump_file)
fprintf (dump_file, "Fallthru edge %i->%i redirected to %i\n",
!ret->src->index, ret->dest->index, dest->index);
  }
else
  ret = redirect_branch_edge (e, dest);


[patch middle-end c c++]: Optimize cost of comp_type_attributes

2011-03-21 Thread Kai Tietz
Hello,

this patch does some search-cost optimization for comp_type_attributes
target hook. By recent patch about diagnostic of attributes affecting
type indentity, it is possible to avoid some searching for such kind
of type checks.

In general it would be possible to remove this target-hook completely,
but by doing so we would need to introduce an new hook which returns
the current default calling-convention. To avoid this the check just
avoids call of comp_type_attributes target hook for cases where all
type identity affecting attributes are compatible. If the don't match
the target hook gets called to handle target's default calling
convention proper.

ChangeLog gcc/

2011-03-11  Kai Tietz

* c-typeck.c (comptypes_internal): Replace target
hook call of comp_type_attributes by version in tree.c file.
* gimple.c (gimple_types_compatible_p_1): Likewise.
* tree-ssa.c (useless_type_conversion_p): Likewise.
* tree.c (build_type_attribute_qual_variant): Likewise.
(comp_type_attributes): New function.
* tree.h (comp_type_attributes): New prototype.

ChangeLog cp/

2011-03-11  Kai Tietz

* decl.c (decls_match): Replace target hook
call of comp_type_attributes by version in tree.c file.
* search.c (check_final_overrider): Likewise.
* typeck.c (structural_comptypes): Likewise.

Tested for x86_64-pc-linux-gnu, and for x86_64-w64-mingw32. Ok for apply?

Regards,
Kai
Index: gcc/gcc/c-typeck.c
===
--- gcc.orig/gcc/c-typeck.c 2011-01-27 08:57:07.0 +0100
+++ gcc/gcc/c-typeck.c  2011-03-21 11:05:45.345143000 +0100
@@ -1079,7 +1079,7 @@ comptypes_internal (const_tree type1, co
 return 1;
 
   /* 1 if no need for warning yet, 2 if warning cause has been seen.  */
-  if (!(attrval = targetm.comp_type_attributes (t1, t2)))
+  if (!(attrval = comp_type_attributes (t1, t2)))
  return 0;
 
   /* 1 if no need for warning yet, 2 if warning cause has been seen.  */
Index: gcc/gcc/cp/decl.c
===
--- gcc.orig/gcc/cp/decl.c  2011-03-17 18:55:30.0 +0100
+++ gcc/gcc/cp/decl.c   2011-03-21 11:12:00.528285200 +0100
@@ -1012,8 +1012,8 @@ decls_match (tree newdecl, tree olddecl)
types_match =
  compparms (p1, p2)
  && (TYPE_ATTRIBUTES (TREE_TYPE (newdecl)) == NULL_TREE
- || targetm.comp_type_attributes (TREE_TYPE (newdecl),
-  TREE_TYPE (olddecl)) != 0);
+ || comp_type_attributes (TREE_TYPE (newdecl),
+  TREE_TYPE (olddecl)) != 0);
}
   else
types_match = 0;
Index: gcc/gcc/cp/search.c
===
--- gcc.orig/gcc/cp/search.c2011-03-06 12:15:05.0 +0100
+++ gcc/gcc/cp/search.c 2011-03-21 11:12:36.760386100 +0100
@@ -1897,7 +1897,7 @@ check_final_overrider (tree overrider, t
 }
 
   /* Check for conflicting type attributes.  */
-  if (!targetm.comp_type_attributes (over_type, base_type))
+  if (!comp_type_attributes (over_type, base_type))
 {
   error ("conflicting type attributes specified for %q+#D", overrider);
   error ("  overriding %q+#D", basefn);
Index: gcc/gcc/cp/typeck.c
===
--- gcc.orig/gcc/cp/typeck.c2011-03-17 18:55:30.0 +0100
+++ gcc/gcc/cp/typeck.c 2011-03-21 11:13:12.125876900 +0100
@@ -1338,7 +1338,7 @@ structural_comptypes (tree t1, tree t2,
   /* If we get here, we know that from a target independent POV the
  types are the same.  Make sure the target attributes are also
  the same.  */
-  return targetm.comp_type_attributes (t1, t2);
+  return comp_type_attributes (t1, t2);
 }
 
 /* Return true if T1 and T2 are related as allowed by STRICT.  STRICT
Index: gcc/gcc/gimple.c
===
--- gcc.orig/gcc/gimple.c   2010-12-02 20:10:55.0 +0100
+++ gcc/gcc/gimple.c2011-03-21 11:06:27.447989400 +0100
@@ -3616,7 +3616,7 @@ gimple_types_compatible_p_1 (tree t1, tr
 state, sccstack, sccstate, sccstate_obstack))
goto different_types;
 
-  if (!targetm.comp_type_attributes (t1, t2))
+  if (!comp_type_attributes (t1, t2))
goto different_types;
 
   if (TYPE_ARG_TYPES (t1) == TYPE_ARG_TYPES (t2))
Index: gcc/gcc/tree-ssa.c
===
--- gcc.orig/gcc/tree-ssa.c 2011-03-17 18:55:31.0 +0100
+++ gcc/gcc/tree-ssa.c  2011-03-21 11:07:24.362216600 +0100
@@ -1438,7 +1438,7 @@ useless_type_conversion_p (tree outer_ty
 
   /* Defer to the target if necessary.  */
   if (TYPE_ATTRIBUTES (inner_type) || TYPE_ATTRIBUTES (outer_type))
-   return targetm.comp_type_attri

Re: Fix a few use-after-free issues

2011-03-21 Thread Diego Novillo
On Mon, Mar 21, 2011 at 13:37, Jeff Law  wrote:

> Bootstrapped and regression tested on x86_64-unknown-linux-gnu.  Ok for
> the trunk?

OK.


Diego.


Re: [PATCH 02/18] enforce TREE_CHAIN and TREE_TYPE accesses

2011-03-21 Thread Eric Botcazou
> You're right, though; they should probably be marked as such for
> completeness.  OK to commit with those additions and reordering as above
> sight unseen, or would you like to see the patch?

Note that I didn't ask for that, only for a comment explaining why they were 
set aside.  So it's up to you and, yes, you can commit without reposting.

-- 
Eric Botcazou


Re: Fix a few use-after-free issues

2011-03-21 Thread Jakub Jelinek
On Mon, Mar 21, 2011 at 11:37:16AM -0600, Jeff Law wrote:
> Similarly for redirect_edge_succ_nodup in this fragment:
> 
> ret = redirect_edge_succ_nodup (e, dest);
> if (dump_file)
>   fprintf (dump_file, "Fallthru edge %i->%i redirected to %i\n",
>e->src->index, e->dest->index, dest->index);
>   }
> Luckily in this case the use-after-free only occurs when dumping, so it
> won't typically affect end users.

Well, the message is wrong anyway, becase e->dest->index will be
dest->index (with the exception that e has been remove_edge, but then it is
the use after free).  Guess the message should be printed before the
redirect_edge_succ_nodup call, or remember e->dest->index in some local
variable and print that variable after the call.

Jakub


Re: [Ada] Implement switches to reorder record components in gigi

2011-03-21 Thread Eric Botcazou
> Hi Eric, this looks like a nice improvement.  I noticed this mysterious
> undef though - what is it for?
>
> +#undef MOVE_FROM_FIELD_LIST_TO

Not clear what kind of answer you're expecting.  To cancel the previous define?

-- 
Eric Botcazou


Re: [patch] Couple of tweaks to the gimplifier

2011-03-21 Thread Eric Botcazou
> >  1) Set TREE_THIS_NOTRAP on the INDIRECT_REF built for VLA decls.  This
> > is correct since stack memory isn't considered as trapping in the IL.
>
> This is ok.

Thanks.

> >  2) Improve gimplification of complex conditions in COND_EXPR.  They are
> >     naturally generated by the Ada compiler and the patch avoids emitting
> >     redundant branches in GIMPLE, visible at -O0 for the testcase:
>
> Shouldn't
>
> +  /* Remove any COMPOUND_EXPR so the following cases will be caught.  */
> +  STRIP_TYPE_NOPS (TREE_OPERAND (expr, 0));
> +  if (TREE_CODE (TREE_OPERAND (expr, 0)) == COMPOUND_EXPR)
> +gimplify_compound_expr (&TREE_OPERAND (expr, 0), pre_p, true);
>
> happen in gimple_boolify instead so that other callers also benefit?
> That is, add a COMPOUND_EXPR case there?

Not clear to me.  gimple_boolify doesn't gimplify, it boolifies, i.e. only does 
type conversions to boolean.  This looks orthogonal.

> So, what does the GENERIC look like here?

Attached.  Barely readable, like pretty much all GENERIC for Ada, but you can 
see the big IF statement with the COMPOUND_EXPR on the RHS of the &&.

-- 
Eric Botcazou
P (const boolean b, struct  s1, struct  s2)
{
  SAVE_EXPR LB0>;
  SAVE_EXPR UB0>;
  SAVE_EXPR UB0> >= SAVE_EXPR LB0> ? (SAVE_EXPR UB0> - SAVE_EXPR LB0>) + 1 : 0>;
  SAVE_EXPR LB0>;
  SAVE_EXPR UB0>;
  SAVE_EXPR UB0> >= SAVE_EXPR LB0> ? (SAVE_EXPR UB0> - SAVE_EXPR LB0>) + 1 : 0>;
  {
typedef p__TS2bP1___XD p__TS2bP1___XD;
typedef  struct ;
typedef character p__S2b[(size_type) SAVE_EXPR LB0>:SAVE_EXPR UB0> >= SAVE_EXPR LB0> ? (size_type) SAVE_EXPR UB0> : (size_type) SAVE_EXPR LB0> + -1];
typedef p__TS1bP1___XD p__TS1bP1___XD;
typedef  struct ;
typedef character p__S1b[(size_type) SAVE_EXPR LB0>:SAVE_EXPR UB0> >= SAVE_EXPR LB0> ? (size_type) SAVE_EXPR UB0> : (size_type) SAVE_EXPR LB0> + -1];
const integer L3b = (const integer) (SAVE_EXPR UB0> >= SAVE_EXPR LB0> ? (SAVE_EXPR UB0> - SAVE_EXPR LB0>) + 1 : 0>);
const integer L4b = (const integer) (SAVE_EXPR UB0> >= SAVE_EXPR LB0> ? (SAVE_EXPR UB0> - SAVE_EXPR LB0>) + 1 : 0>);
const integer L5b = (const integer) ((integer) L3b + (integer) L4b);
const integer L6b = (integer) L3b != 0 ? (const integer) SAVE_EXPR LB0> : (const integer) SAVE_EXPR LB0>;
const integer R8b = (integer) L5b == 0 ? (const integer) SAVE_EXPR UB0> : (const integer) (((integer) L5b + -1) + (integer) L6b);
typedef p__TTS7bSP1___XD p__TTS7bSP1___XD;
typedef  struct ;
typedef character p__TS7bS[(size_type) L6b:(integer) R8b >= (integer) L6b ? (size_type) R8b : (size_type) L6b + -1];
character S7b[(size_type) L6b:(integer) R8b >= (integer) L6b ? (size_type) R8b : (size_type) L6b + -1];
typedef  struct ;
typedef character p__T9b[1:4];

typedef p__TS2bP1___XD p__TS2bP1___XD;
typedef  struct ;
typedef character p__S2b[(size_type) SAVE_EXPR LB0>:SAVE_EXPR UB0> >= SAVE_EXPR LB0> ? (size_type) SAVE_EXPR UB0> : (size_type) SAVE_EXPR LB0> + -1];
typedef p__TS1bP1___XD p__TS1bP1___XD;
typedef  struct ;
typedef character p__S1b[(size_type) SAVE_EXPR LB0>:SAVE_EXPR UB0> >= SAVE_EXPR LB0> ? (size_type) SAVE_EXPR UB0> : (size_type) SAVE_EXPR LB0> + -1];
typedef  struct ;
typedef character p__T9b[1:4];
if ((boolean) b && (SAVE_EXPR  >= SAVE_EXPR LB0> ? (SAVE_EXPR UB0> - SAVE_EXPR LB0>) + 1 : 0>);
const integer L4b = (const integer) (SAVE_EXPR UB0> >= SAVE_EXPR LB0> ? (SAVE_EXPR UB0> - SAVE_EXPR LB0>) + 1 : 0>);
const integer L5b = (const integer) ((integer) L3b + (integer) L4b);
const integer L6b = (integer) L3b != 0 ? (const integer) SAVE_EXPR LB0> : (const integer) SAVE_EXPR LB0>;
const integer R8b = (integer) L5b == 0 ? (const integer) SAVE_EXPR UB0> : (const integer) (((integer) L5b + -1) + (integer) L6b);
typedef p__TTS7bSP1___XD p__TTS7bSP1___XD;
typedef  struct ;
typedef character p__TS7bS[(size_type) L6b:(integer) R8b >= (integer) L6b ? (size_type) R8b : (size_type) L6b + -1];
character S7b[(size_type) L6b:(integer) R8b >= (integer) L6b ? (size_type) R8b : (size_type) L6b + -1];
system.concat_2.str_concat_2 ({.P_ARRAY=(character[(size_type) .P_BOUNDS->LB0:.P_BOUNDS->UB0 >= .P_BOUNDS->LB0 ? (size_type) .P_BOUNDS->UB0 : (size_type) .P_BOUNDS->LB0 + -1] *) &S7b, .P_BOUNDS=&{.LB0=(integer) L6b, .UB0=(integer) R8b}}, s1, s2);>;, (integer) R8b - (integer) L6b == 3 && VIEW_CONVERT_EXPR(S7b) == "toto";))
  {
.gnat_rcheck_21 ("p.adb", 4);
  }
else
  {

  }
return;
  }


_GLOBAL.SZ0.ada_p (integer p0, integer p1)
{
  return p1 <= p0 ? (bit_size_type) size_type) p0 - (size_type) p1) + 1) * 8) : 0;


_GLOBAL.SZ1.ada_p (integer p0, integer p1)
{
  return p1 <= p0 ? ((size_type) p0 - (size_type) p1) + 1 : 0;




Re: [PATCH] Fix shorten_compare (PR c/48197)

2011-03-21 Thread Jakub Jelinek
On Mon, Mar 21, 2011 at 04:31:31PM +, Joseph S. Myers wrote:
> On Sun, 20 Mar 2011, Jakub Jelinek wrote:
> 
> > 2011-03-20  Jakub Jelinek  
> > 
> > PR c/48197
> > * c-common.c (shorten_compare): If primopN is first sign-extended
> > to opN and then zero-extended to result type, set primopN to opN.
> > 
> > * gcc.c-torture/execute/pr48197.c: New test.
> 
> This is OK, in that I believe it is (a) correct and (b) a sensible place 
> in the current context to fix this to avoid problems with shorten_compare 
> not working with mixed extensions.  It's worth checking if this fixes PR 
> 42544 as well, since that also looks like it involves mixed extensions.

It does, so here is what I've actually committed:

2011-03-20  Jakub Jelinek  

PR c/42544
PR c/48197
* c-common.c (shorten_compare): If primopN is first sign-extended
to opN and then zero-extended to result type, set primopN to opN.

* gcc.c-torture/execute/pr42544.c: New test.
* gcc.c-torture/execute/pr48197.c: New test.

--- gcc/c-family/c-common.c.jj  2011-03-21 13:00:03.0 +0100
+++ gcc/c-family/c-common.c 2011-03-21 18:29:23.0 +0100
@@ -3301,6 +3301,20 @@ shorten_compare (tree *op0_ptr, tree *op
   primop0 = get_narrower (op0, &unsignedp0);
   primop1 = get_narrower (op1, &unsignedp1);
 
+  /* If primopN is first sign-extended from primopN's precision to opN's
+ precision, then zero-extended from opN's precision to
+ *restype_ptr precision, shortenings might be invalid.  */
+  if (TYPE_PRECISION (TREE_TYPE (primop0)) < TYPE_PRECISION (TREE_TYPE (op0))
+  && TYPE_PRECISION (TREE_TYPE (op0)) < TYPE_PRECISION (*restype_ptr)
+  && !unsignedp0
+  && TYPE_UNSIGNED (TREE_TYPE (op0)))
+primop0 = op0;
+  if (TYPE_PRECISION (TREE_TYPE (primop1)) < TYPE_PRECISION (TREE_TYPE (op1))
+  && TYPE_PRECISION (TREE_TYPE (op1)) < TYPE_PRECISION (*restype_ptr)
+  && !unsignedp1
+  && TYPE_UNSIGNED (TREE_TYPE (op1)))
+primop1 = op1;
+
   /* Handle the case that OP0 does not *contain* a conversion
  but it *requires* conversion to FINAL_TYPE.  */
 
--- gcc/testsuite/gcc.c-torture/execute/pr42544.c.jj2011-03-21 
18:25:01.0 +0100
+++ gcc/testsuite/gcc.c-torture/execute/pr42544.c   2011-03-21 
18:24:29.0 +0100
@@ -0,0 +1,14 @@
+/* PR c/42544 */
+
+extern void abort (void);
+
+int
+main ()
+{
+  signed short s = -1;
+  if (sizeof (long long) == sizeof (unsigned int))
+return 0;
+  if ((unsigned int) s >= 0x1ULL)
+abort ();
+  return 0;
+}
--- gcc/testsuite/gcc.c-torture/execute/pr48197.c.jj2011-03-21 
18:29:23.0 +0100
+++ gcc/testsuite/gcc.c-torture/execute/pr48197.c   2011-03-21 
18:29:23.0 +0100
@@ -0,0 +1,25 @@
+/* PR c/48197 */
+
+extern void abort (void);
+static int y = 0x8000;
+
+int
+main ()
+{
+  unsigned int x = (short)y;
+  if (sizeof (0LL) == sizeof (0U))
+return 0;
+  if (0LL > (0U ^ (short)-0x8000))
+abort ();
+  if (0LL > (0U ^ x))
+abort ();
+  if (0LL > (0U ^ (short)y))
+abort ();
+  if ((0U ^ (short)-0x8000) < 0LL)
+abort ();
+  if ((0U ^ x) < 0LL)
+abort ();
+  if ((0U ^ (short)y) < 0LL)
+abort ();
+  return 0;
+}

Jakub


Re: [Ada] Avoid duplicating branches in loop conditions

2011-03-21 Thread Eric Botcazou
> 2011-03-21  Eric Botcazou  
>
>   * gcc-interface/decl.c (elaborate_expression_1): When optimization is
>   disabled, use the variable for bounds of loop iteration scheme.

This quite mysteriously triggers a bogus -Wuninitialized warning on IRIX.

Fixed thusly, tested on i586-suse-linux, applied on the mainline.


2011-03-21  Eric Botcazou  

PR bootstrap/48216
* gcc-interface/decl.c (elaborate_expression_1): Localize GNU_DECL.


-- 
Eric Botcazou
Index: gcc-interface/decl.c
===
--- gcc-interface/decl.c	(revision 171228)
+++ gcc-interface/decl.c	(working copy)
@@ -6006,7 +6006,6 @@ elaborate_expression_1 (tree gnu_expr, E
 {
   const bool expr_global_p = Is_Public (gnat_entity) || global_bindings_p ();
   bool expr_variable_p, use_variable;
-  tree gnu_decl;
 
   /* In most cases, we won't see a naked FIELD_DECL because a discriminant
  reference will have been replaced with a COMPONENT_REF when the type
@@ -6071,15 +6070,17 @@ elaborate_expression_1 (tree gnu_expr, E
 
   /* Now create it, possibly only for debugging purposes.  */
   if (use_variable || need_debug)
-gnu_decl
-  = create_var_decl (create_concat_name (gnat_entity,
-	 IDENTIFIER_POINTER (gnu_name)),
-			 NULL_TREE, TREE_TYPE (gnu_expr), gnu_expr,
-			 !need_debug, Is_Public (gnat_entity),
-			 !definition, expr_global_p, NULL, gnat_entity);
+{
+  tree gnu_decl
+	= create_var_decl (create_concat_name (gnat_entity,
+	   IDENTIFIER_POINTER (gnu_name)),
+			   NULL_TREE, TREE_TYPE (gnu_expr), gnu_expr,
+			   !need_debug, Is_Public (gnat_entity),
+			   !definition, expr_global_p, NULL, gnat_entity);
 
-  if (use_variable)
-return gnu_decl;
+  if (use_variable)
+	return gnu_decl;
+}
 
   return expr_variable_p ? gnat_save_expr (gnu_expr) : gnu_expr;
 }


Re: [testsuite, build] Convert boehm-gc testsuite to DejaGnu (PR boehm-gc/11412)

2011-03-21 Thread Mike Stump
On Mar 21, 2011, at 5:59 AM, Rainer Orth wrote:
> I've applied those changes, and also managed to fix the problems I had
> in Tru64 UNIX testing.  Here's the patch I'd like to commit to 4.7.

> +# Build shared library from LIB.
> +proc boehm-gc-build-shlib { lib flags extra-flags } {

> +# FIXME: Explain options.
> +set shopt "-version-info 1:2:0 -no-undefined -rpath /nowhere"

So, this still seems unportable to me?


Re: [PATCH] libstdc++ ABI issues with __int128

2011-03-21 Thread Benjamin Kosnik
> Well, such stricter checking wouldn't be completely painless, e.g. currently
> both current baseline_symbols.txt and the ones I've posted don't include the
> two TLS: lines, because of the fear that not everyone has TLS enabled.
> If baseline_symbols.txt right now miss some symbols, it is not a big deal
> if it is not in the base version (with my patch base versions), but with
> stricter checking it would complain.  Either we'd just say that TLS is
> assumed on these targets and add the TLS: lines, or we'd need to invent
> some symbol conditionalizing or something.

Ah, yes.

We will keep on doing the present solution for libstdc++.so.6 and
invent something clever later.

-benjamin


Re: [testsuite, build] Convert boehm-gc testsuite to DejaGnu (PR boehm-gc/11412)

2011-03-21 Thread Rainer Orth
Mike Stump  writes:

> On Mar 21, 2011, at 5:59 AM, Rainer Orth wrote:
>> I've applied those changes, and also managed to fix the problems I had
>> in Tru64 UNIX testing.  Here's the patch I'd like to commit to 4.7.
>
>> +# Build shared library from LIB.
>> +proc boehm-gc-build-shlib { lib flags extra-flags } {
>
>> +# FIXME: Explain options.
>> +set shopt "-version-info 1:2:0 -no-undefined -rpath /nowhere"
>
> So, this still seems unportable to me?

Maybe, but this is exactly what the current Makefile.am has:

libstaticrootslib_la_LDFLAGS = -version-info 1:2:0 -no-undefined \
-rpath /nowhere -shared-libgcc

And where exactly do you see the unportability?  All of them are common
libtool options, and -shared-libgcc is handled slightly differently.

Rainer

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


Re: [testsuite, build] Convert boehm-gc testsuite to DejaGnu (PR boehm-gc/11412)

2011-03-21 Thread Paolo Bonzini
On Mon, Mar 21, 2011 at 19:27, Mike Stump  wrote:
> On Mar 21, 2011, at 5:59 AM, Rainer Orth wrote:
>> I've applied those changes, and also managed to fix the problems I had
>> in Tru64 UNIX testing.  Here's the patch I'd like to commit to 4.7.
>
>> +# Build shared library from LIB.
>> +proc boehm-gc-build-shlib { lib flags extra-flags } {
>
>> +    # FIXME: Explain options.
>> +    set shopt "-version-info 1:2:0 -no-undefined -rpath /nowhere"
>
> So, this still seems unportable to me?

These are libtool options.

Paolo


PING: PATCH: PR other/48007: Unwind library doesn't work with UNITS_PER_WORD > sizeof (void *)

2011-03-21 Thread H.J. Lu
On Mon, Mar 14, 2011 at 10:49 AM, H.J. Lu  wrote:
>>>
>>> We shouldn't save call frame hard registers as "void *".  This patch
>>> changes the unwind library to save call frame hard registers as
>>> _Unwind_Word.  OK for 4.7?
>>
>> I think this will break the ABI for the MIPS N32 ABI.  Not to mention
>> the MIPS N32 ABI works fine with the unwinding part this way.  Does
>> someone use the unwinding library to look at the registers in previous
>> stack frames?
>
> It may be psABI/implementation specific.  X32 glibc force unwind calls
> _Unwind_SetGRValue to get a 64bit register value.

 So fix it on that side?

>>>
>>> How? One function in question is
>>>
>>> /* Overwrite the saved value for register INDEX in CONTEXT with VAL.  */
>>>
>>> static inline void
>>> _Unwind_SetGRValue (struct _Unwind_Context *context, int index,
>>>                    _Unwind_Word val)
>>>
>>>
>>> Are you saying it shouldn't be called if UNITS_PER_WORD > sizeof (void *)?
>>>
>>
>> FWIW, the type of GR is _Unwind_Word, not void *.  They may not
>> have the same size.  Why does the DWARF unwind library use
>> void * to store GR? Can a target have an option to save a _Unwind_Word
>> value in _Unwind_Word, instead of void *?
>>
>
> From what I can tell, _Unwind_Context is internal to the unwind library
> and only one copy unwind library can be used in a process. I don't
> think changing _Unwind_Context will impact binary compatibility.
>
> Is my patch OK for 4.7?
>

PING:

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


-- 
H.J.


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

2011-03-21 Thread H.J. Lu
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

-- 
H.J.


[PATCH, alpha]: Fix PR bootstrap/48214: ICE in dwarf2out_var_location

2011-03-21 Thread Uros Bizjak
Hello!

Attached patch fixes recent bootstrap failure on alpha-pc-linux-gnu in
in dwarf2out_var_location, at dwarf2out.c:21983.

2011-03-21  Uros Bizjak  

* config/alpha/alpha.c (alpha_pad_noreturn): Do not emit an unop
between a call and its CALL_ARG_LOCATION note.

Bootstrapped and regression tested on alphaev68-pc-linux-gnu. OK for
mainline SVN?

Uros.
Index: alpha.c
===
--- alpha.c (revision 171208)
+++ alpha.c (working copy)
@@ -9644,10 +9644,20 @@ alpha_pad_noreturn (void)
 
   for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
 {
-  if (!CALL_P (insn)
- || !find_reg_note (insn, REG_NORETURN, NULL_RTX))
+  if (! (CALL_P (insn)
+&& find_reg_note (insn, REG_NORETURN, NULL_RTX)))
 continue;
 
+  /* Make sure we do not split a call and its corresponding
+CALL_ARG_LOCATION note.  */
+  if (CALL_P (insn))
+   {
+ next = NEXT_INSN (insn);
+ if (next && NOTE_P (next)
+ && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
+   insn = next;
+   }
+
   next = next_active_insn (insn);
 
   if (next)


Re: [testsuite, build] Convert boehm-gc testsuite to DejaGnu (PR boehm-gc/11412)

2011-03-21 Thread Mike Stump
On Mar 21, 2011, at 11:33 AM, Paolo Bonzini wrote:
>> So, this still seems unportable to me?
> 
> These are libtool options.

Ah, that's the part I was missing...  Thanks.


Re: [PATCH] libstdc++ ABI issues with __int128

2011-03-21 Thread Jakub Jelinek
On Mon, Mar 21, 2011 at 07:32:14PM +0100, Benjamin Kosnik wrote:
> > Well, such stricter checking wouldn't be completely painless, e.g. currently
> > both current baseline_symbols.txt and the ones I've posted don't include the
> > two TLS: lines, because of the fear that not everyone has TLS enabled.
> > If baseline_symbols.txt right now miss some symbols, it is not a big deal
> > if it is not in the base version (with my patch base versions), but with
> > stricter checking it would complain.  Either we'd just say that TLS is
> > assumed on these targets and add the TLS: lines, or we'd need to invent
> > some symbol conditionalizing or something.
> 
> We will keep on doing the present solution for libstdc++.so.6 and
> invent something clever later.

After offline discussion with Benjamin I've committed
http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01175.html
http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01246.html
and the attached two patches to trunk and 4.6 after regtesting
on x86_64-linux.

Jakub
2011-03-21  Benjamin Kosnik  

* config/abi/pre/gnu.ver: Remove typeinfo name exports for C++0x types.

--- libstdc++-v3/config/abi/pre/gnu.ver
+++ libstdc++-v3/config/abi/pre/gnu.ver
@@ -1231,7 +1231,6 @@ GLIBCXX_3.4.15 {
 
 _ZNSt11regex_errorD*;
 _ZNKSt11regex_error4whatEv;
-_ZTSSt11regex_error;
 _ZTVSt11regex_error;
 _ZTISt11regex_error;
 _ZSt19__throw_regex_errorNSt15regex_constants10error_typeE;
@@ -1239,14 +1238,12 @@ GLIBCXX_3.4.15 {
 # std::bad_weak_ptr
 _ZNSt12bad_weak_ptrD*;
 _ZNKSt12bad_weak_ptr4whatEv;
-_ZTSSt12bad_weak_ptr;
 _ZTVSt12bad_weak_ptr;
 _ZTISt12bad_weak_ptr;
 
 # std::bad_function_call
 _ZNSt17bad_function_callD*;
 _ZTISt17bad_function_call;
-_ZTSSt17bad_function_call;
 _ZTVSt17bad_function_call;
 
 _ZNSt14error_categoryC*;
@@ -1255,12 +1252,10 @@ GLIBCXX_3.4.15 {
 _ZNSt13__future_base12_Result_baseC*;
 _ZNSt13__future_base12_Result_baseD*;
 _ZTINSt13__future_base12_Result_baseE;
-_ZTSNSt13__future_base12_Result_baseE;
 _ZTVNSt13__future_base12_Result_baseE;
 
 _ZNSt13__future_base11_State_baseD*;
 _ZTINSt13__future_base11_State_baseE;
-_ZTSNSt13__future_base11_State_baseE;
 _ZTVNSt13__future_base11_State_baseE;
 
 } GLIBCXX_3.4.14;
@@ -1444,7 +1439,6 @@ CXXABI_1.3.5 {
 # std::nested_exception
 _ZNSt16nested_exceptionD*;
 _ZTISt16nested_exception;
-_ZTSSt16nested_exception;
 _ZTVSt16nested_exception;
 
 } CXXABI_1.3.4;


X063.bz2
Description: BZip2 compressed data


Re: [PATCH] prune warn_compact_unwind warnings on darwin

2011-03-21 Thread Mike Stump
On Mar 12, 2011, at 1:01 PM, Jack Howarth wrote:
> 2011-03-12  Jack Howarth  
> 
> libstdc++-v3/
>   * testsuite/lib/prune.exp: Prune "could not create compact unwind for" 
> warnings.
> 
> gcc/
>   * testsuite/lib/prune.exp: Ditto.

Checked in r171263.  I modified the Changelogs slightly, as Ditto doesn't work 
across changelog files, and I included the routine name (add-changelog does 
this in emacs) and wrapped them.

I didn't put them into the release branch yet...  RM?  You have a preference on 
timing?  Now, after .0 goes out?


Re: [PATCH] prune warn_compact_unwind warnings on darwin

2011-03-21 Thread Jakub Jelinek
On Mon, Mar 21, 2011 at 12:18:43PM -0700, Mike Stump wrote:
> I didn't put them into the release branch yet...  RM?  You have a
> preference on timing?  Now, after .0 goes out?

After .0 goes out.  RC2 is building already and the fewer changes after RC2,
the better.

Jakub


Re: Cleaning up expand optabs code

2011-03-21 Thread Richard Henderson
On 03/19/2011 12:52 PM, Richard Sandiford wrote:
> Given the mode stuff above, I've tried to be quite draconian as far
> as caller-provided modes go.  I think the caller really should know
> what mode they're dealing with.  The one case where I had to hold
> back a bit was create_convert_operand_from, which replaces things like:
> 
>   if (GET_MODE (op0) != mode0 && mode0 != VOIDmode)
> xop0 = convert_modes (mode0,
>   GET_MODE (op0) != VOIDmode
>   ? GET_MODE (op0)
>   : mode,
>   xop0, unsignedp);
> 
> It seems a little suspicious that we only trust "mode" for CONST_INT
> op0s, and not for other cases, but I'd like to leave that for now.
> Maybe a future "clean up"?

Sure.

> Also, I had to change the i386 setmem pattern in order to avoid
> a regression in cold-attribute-1.c.  The current predicate for
> the character operand is "const_int_operand", but the pattern
> handles registers as well.  I'm sure there are going to be other
> things like that, so sorry in advance if this patch goes in and
> breaks a target...

Sure.

>   * reload.c (find_reloads_address_1): Use insn_operand_matches.
>   * reload1.c (gen_reload): Likewise.

All the bits that just use insn_operand_matches are approved.
You can commit those first if you like to reduce the patch size.

>  {
> -  if ((! (*insn_data[(int) CODE_FOR_prefetch].operand[0].predicate)
> -  (op0,
> -   insn_data[(int) CODE_FOR_prefetch].operand[0].mode))
> -   || (GET_MODE (op0) != Pmode))
> - {
> -   op0 = convert_memory_address (Pmode, op0);
> -   op0 = force_reg (Pmode, op0);
> - }
> -  emit_insn (gen_prefetch (op0, op1, op2));
> +  struct expand_operand ops[3];
> +
> +  create_address_operand (&ops[0], op0);
> +  create_integer_operand (&ops[1], INTVAL (op1));
> +  create_integer_operand (&ops[2], INTVAL (op2));
> +  if (maybe_expand_insn (CODE_FOR_prefetch, 3, ops))
> + return;
>  }

Yep, this interface is a definite cleanup.

> @@ -2452,10 +2443,11 @@ expand_builtin_interclass_mathfn (tree e
>if (mode != GET_MODE (op0))
>   op0 = convert_to_mode (mode, op0, 0);
>  
> -  /* Compute into TARGET.
> -  Set TARGET to wherever the result comes back.  */
> -  if (maybe_emit_unop_insn (icode, target, op0, UNKNOWN))
> - return target;
> +  create_output_operand (&ops[0], target, TYPE_MODE (TREE_TYPE (exp)));
> +  if (maybe_legitimize_operands (icode, 0, 1, ops)
> +   && maybe_emit_unop_insn (icode, ops[0].value, op0, UNKNOWN))
> + return ops[0].value;

What are you doing here that maybe_emit_unop_insn doesn't?

> +  if (maybe_expand_insn (unsignedp ? CODE_FOR_extzv : CODE_FOR_extv,
> +  4, ops))
>   {
> -   emit_insn (pat);
> +   xtarget = ops[0].value;
> if (xtarget == xspec_target)
>   return xtarget;
> -   if (xtarget == xspec_target_subreg)
> +   if (ops[0].value == xspec_target_subreg)
>   return xspec_target;

Why this last change?

>x = prepare_operand (icode, x, 2, mode, compare_mode, unsignedp);
>y = prepare_operand (icode, y, 3, mode, compare_mode, unsignedp);
>comparison = gen_rtx_fmt_ee (code, result_mode, x, y);
> -  if (!x || !y
> -  || !insn_data[icode].operand[2].predicate
> -   (x, insn_data[icode].operand[2].mode)
> -  || !insn_data[icode].operand[3].predicate
> -   (y, insn_data[icode].operand[3].mode)
> -  || !insn_data[icode].operand[1].predicate (comparison, VOIDmode))
> +  if (!x || !y)
>  {
>delete_insns_since (last);
>return NULL_RTX;

Seems like we ought to push the IF above generating COMPARISON now.


>  expand_widen_pattern_expr (sepops ops, rtx op0, rtx op1, rtx wide_op,
>  rtx target, int unsignedp)

Geezam.  I hope this one's correct -- the original code is impossible to
follow.  I suspect that it's trying to handle so many different cases at
once that it can't really validate anything at all.

> +  op = 0;
> +  create_output_operand (&eops[op++], target, TYPE_MODE (ops->type));
> +  create_convert_operand_from (&eops[op++], op0, tmode0, unsignedp);
>if (op1)
> +create_convert_operand_from (&eops[op++], op1, tmode1, unsignedp);
>if (wide_op)
> +create_convert_operand_from (&eops[op++], wide_op, wmode, unsignedp);
> +  expand_insn (icode, op, eops);
> +  return eops[0].value;

... the conversion is at least legible.

> +  if (commutative_p)
> +make_operand_commutative (&ops[1], 0);

So this is used exactly once here in expand_binop_directly?

Honestly, I found the description of make_operand_commutative to
be rather weak, and the implementation,

> +  for (i = 0; i + 1 < nops; i++)
> +if (ops[i].commutative < MAX_EXPAND_OPERANDS
> +   && swap_commutative_operands_with_target 
> (ops[ops[i].commutative].value,
> +

Re: [PATCH, alpha]: Fix PR bootstrap/48214: ICE in dwarf2out_var_location

2011-03-21 Thread Richard Henderson
On 03/21/2011 11:40 AM, Uros Bizjak wrote:
> Hello!
> 
> Attached patch fixes recent bootstrap failure on alpha-pc-linux-gnu in
> in dwarf2out_var_location, at dwarf2out.c:21983.
> 
> 2011-03-21  Uros Bizjak  
> 
>   * config/alpha/alpha.c (alpha_pad_noreturn): Do not emit an unop
>   between a call and its CALL_ARG_LOCATION note.

Ok.


r~


Re: [PATCH] Fix PR 48143

2011-03-21 Thread Andrey Belevantsev

On 21.03.2011 18:12, Uros Bizjak wrote:

2011/3/21 Andrey Belevantsev:

Hello,

As noted in the PR audit trail, the scheduler crashes for this bug because
we see an SSE insn without proper reservation.  Uros has pointed several
such insns to me.  The following patch adding athlon_decode attributes is
bootstrapped and tested on x86_64.

Uros, you have preapproved the patch idea, but does it still look ok to you?
  I have mostly copied reservations from bdver1 variants.

Richi, Jakub, do you want this in 4.6.1?  4.6.0?

Andrey


2011-03-21  Andrey Belevantsev

PR rtl-optimization/48143
* config/i386/sse.md (*sse2_cvtpd2dq): Add athlon_decode attribute.
(*sse2_cvttpd2dq, sse2_cvtss2sd, *sse2_cvtpd2ps,
sse2_cvtps2pd): Likewise.


Can you please cross-check these added attribute with the values in
Chapter C.7 (Table 18) and C.8 (Table 19) in [1] ? Otherwise, the
patch is OK.

[1] http://support.amd.com/us/Processor_TechDocs/25112.PDF
Thanks for pointing the document to me, I have failed to find it.  The 
PD2DQ, TPD2DQ, and PD2PS ones should be changed from double to vector then, 
others are fine.  I will retest and commit tomorrow.


Andrey



Thanks,
Uros.




  1   2   >