Re: [PATCH v2] SPARC: Clarify -mapp-regs option

2014-04-01 Thread Eric Botcazou
> I don't have commit access, so can someone please do this for me.

Applied on all active branches.

-- 
Eric Botcazou


[PATCH] Align gimple_statement_base.subcode

2014-04-01 Thread Richard Biener

I just noticed we have a spare flag bit in gimple_statement_base
which causes subcode to start at bit 15 with consequences for
code-generation on the very frequent accesses to this field.  Oops.

This is a regression from 4.6 which has

  /* Padding to get subcode to 16 bit alignment.  */
  unsigned pad  : 1;

eeeh ...

This is caused by improper reversion of

2012-02-28  Aldy Hernandez  

PR middle-end/51752
* gimple.h (gimple_in_transaction): New.
(gimple_set_in_transaction): New.
(struct gimple_statement_base): Add in_transaction field.

Committed to all affected branches as obvious.

Richard.

2014-04-01  Richard Biener  

* gimple.h (struct gimple_statement_base): Align subcode to
16 bits.

Index: gcc/gimple.h
===
--- gcc/gimple.h(revision 208975)
+++ gcc/gimple.h(working copy)
@@ -166,6 +166,9 @@ struct GTY((desc ("gimple_statement_stru
   /* Nonzero if this statement contains volatile operands.  */
   unsigned has_volatile_ops: 1;
 
+  /* Unused.  Make sure to align subcode to 16 bits.  */
+  unsigned pad : 1;
+
   /* The SUBCODE field can be used for tuple-specific flags for tuples
  that do not require subcodes.  Note that SUBCODE should be at
  least as wide as tree codes, as several tuples store tree codes



Re: PR 60604: CANNOT_CHANGE_MODE_CLASS being ignored

2014-04-01 Thread Richard Biener
On Mon, Mar 31, 2014 at 6:42 PM, Richard Sandiford
 wrote:
> PR 60604 shows a case where CANNOT_CHANGE_MODE_CLASS is being ignored
> for a subreg of a floating-point register, causing it to be replaced
> with an invalid (reg ...).
>
> There are various reasons why MIPS floating-point registers can't change
> mode, but one important one for big-endian 32-bit targets is that the
> registers are always little-endian.  This means an SImode subreg of
> a DFmode value refers to the opposite half from what GCC expects.
> (This could be fixed by renumbering the registers internally, but since
> the FPRs can't change mode for other reasons, it doesn't really seem
> worth it.)
>
> Before IRA we have:
>
>(set (reg:DF 44 $f12)
> (reg/v:DF 205 [ x ]))
>(set (subreg:SI (reg:DF 199 [ D.3267 ]) 0)
> (and:SI (subreg:SI (reg/v:DF 205 [ x ]) 0)
> (const_int 2147483647 [0x7fff])))
>(set (subreg:SI (reg:DF 199 [ D.3267 ]) 4)
> (subreg:SI (reg/v:DF 205 [ x ]) 4))
>
> IRA changes this to:
>
>(set (reg:DF 44 $f12)
> (reg/v:DF 205 [ x ]))
>(set (subreg:SI (reg:DF 199 [ D.3267 ]) 0)
> (and:SI (subreg:SI (reg:DF 44 $f12) 0) <
> (const_int 2147483647 [0x7fff])))
>(set (subreg:SI (reg:DF 199 [ D.3267 ]) 4)
> (subreg:SI (reg:DF 44 $f12) 4))<
>
> And reload creates the following reloads:
>
> Reload 0: reload_in (SI) = (reg:SI 44 $f12)
> GR_REGS, RELOAD_FOR_INPUT (opnum = 1), can't combine
> reload_in_reg: (subreg:SI (reg:DF 44 $f12) 0)
> reload_reg_rtx: (reg:SI 2 $2)
> ...
> Reload 0: reload_in (DF) = (reg:DF 44 $f12)
> GR_REGS, RELOAD_FOR_INPUT (opnum = 1)
> reload_in_reg: (reg:DF 44 $f12)
> reload_reg_rtx: (reg:DF 2 $2)
>
> The second entry, for the lowpart (subreg:SI (reg:DF 44 $f12) 4),
> correctly reloads the full $f12 value into a GPR.  But the first entry,
> for the highpart (subreg:SI (reg:DF 44 $f12) 0), gets simplified to
> (reg:SI $f12) in spite of CANNOT_CHANGE_MODE_CLASS.
>
> The difference comes from the fact that push_reload handles lowpart
> subregs differently from others.  The lowpart code is:
>
>   if (in != 0 && GET_CODE (in) == SUBREG
>   && (subreg_lowpart_p (in) || strict_low)
>   && ([...gruesome condition...]
> #ifdef CANNOT_CHANGE_MODE_CLASS
>   || (REG_P (SUBREG_REG (in))
>   && REGNO (SUBREG_REG (in)) < FIRST_PSEUDO_REGISTER
>   && REG_CANNOT_CHANGE_MODE_P
>   (REGNO (SUBREG_REG (in)), GET_MODE (SUBREG_REG (in)), inmode))
> #endif
>   ))
> {
>   ...
> }
>
> with others being handled by:
>
>   if (in != 0 && reload_inner_reg_of_subreg (in, inmode, false))
> {
>   ...
> }
>
> where reload_inner_reg_of_subreg doesn't check CANNOT_CHANGE_MODE_CLASS.
> Simply adding:
>
> #ifdef CANNOT_CHANGE_MODE_CLASS
>   if (REG_CANNOT_CHANGE_MODE_P (REGNO (inner), GET_MODE (inner), mode))
> return true;
> #endif
>
> to it isn't enough though, since that just forces the inner subreg
> to be reloaded into another FPR and then we simplify _that_ FPR to
> an SImode and reload it.
>
> While this is arguably a bug in reload, the situation isn't really
> supposed to happen in practice, since register_operand specifically
> disallows this kind of subreg:
>
> #ifdef CANNOT_CHANGE_MODE_CLASS
>   if (REG_P (sub)
>   && REGNO (sub) < FIRST_PSEUDO_REGISTER
>   && REG_CANNOT_CHANGE_MODE_P (REGNO (sub), GET_MODE (sub), mode)
>   && GET_MODE_CLASS (GET_MODE (sub)) != MODE_COMPLEX_INT
>   && GET_MODE_CLASS (GET_MODE (sub)) != MODE_COMPLEX_FLOAT
>   /* LRA can generate some invalid SUBREGS just for matched
>  operand reload presentation.  LRA needs to treat them as
>  valid.  */
>   && ! LRA_SUBREG_P (op))
> return 0;
> #endif
>
> The problem is that nonmemory_operand and general_operand both have
> slightly different ideas about what a register operand should be and
> neither of them has this check.  register_operand also has:
>
>   /* FLOAT_MODE subregs can't be paradoxical.  Combine will occasionally
>  create such rtl, and we must reject it.  */
>   if (SCALAR_FLOAT_MODE_P (GET_MODE (op))
>   /* LRA can use subreg to store a floating point value in an
>  integer mode.  Although the floating point and the
>  integer modes need the same number of hard registers, the
>  size of floating point mode can be less than the integer
>  mode.  */
>   && ! lra_in_progress
>   && GET_MODE_SIZE (GET_MODE (op)) > GET_MODE_SIZE (GET_MODE (sub)))
> return 0;
>
> which is copied in general_operand but missing from nonmemory_operand.
> This second check doesn't apply to the testcase but it seems unlikely
> that the difference is intentional.
>
> This patch therefore consolidates all the register checks in gen

Re: [PATCH PR60363]XFAIL case ssa-dom-thread-4.c for logical_op_short_circuit targets

2014-04-01 Thread Richard Biener
On Tue, Apr 1, 2014 at 7:42 AM, bin.cheng  wrote:
> Hi,
> Patch for PR60363 is sent at
> http://gcc.gnu.org/ml/gcc-patches/2014-03/msg00857.html , but it needs to
> wait for stage 1.  In the meanwhile this patch is to xfail the case for
> logical_op_short_circuit targets.  Is it ok?

Ok if you verified that this syntax works.

Thanks,
Richard.

> Thanks,
> bin
>
> gcc/testsuite/ChangeLog
> 2014-04-01  Bin Cheng  
>
> PR target/60363
> * gcc.target/tree-ssa/ssa-dom-thread-4.c: Xfail for
> logical_op_short_circuit targets.


RE: [PATCH PR60363]XFAIL case ssa-dom-thread-4.c for logical_op_short_circuit targets

2014-04-01 Thread bin.cheng


> -Original Message-
> From: Richard Biener [mailto:richard.guent...@gmail.com]
> Sent: Tuesday, April 01, 2014 5:14 PM
> To: Bin Cheng
> Cc: GCC Patches
> Subject: Re: [PATCH PR60363]XFAIL case ssa-dom-thread-4.c for
> logical_op_short_circuit targets
> 
> On Tue, Apr 1, 2014 at 7:42 AM, bin.cheng  wrote:
> > Hi,
> > Patch for PR60363 is sent at
> > http://gcc.gnu.org/ml/gcc-patches/2014-03/msg00857.html , but it needs
> > to wait for stage 1.  In the meanwhile this patch is to xfail the case
> > for logical_op_short_circuit targets.  Is it ok?
> 
> Ok if you verified that this syntax works.
I ran the case on both logical_op_short_circuit and
non-logical_op_short_circuit targets.  The case is skipped on
non-logical_op_short_circuit target and expected failed on
logical_op_short_circuit target,  so I think it works.

Thanks,
bin
> 
> Thanks,
> Richard.
> 
> > Thanks,
> > bin
> >
> > gcc/testsuite/ChangeLog
> > 2014-04-01  Bin Cheng  
> >
> > PR target/60363
> > * gcc.target/tree-ssa/ssa-dom-thread-4.c: Xfail for
> > logical_op_short_circuit targets.






[patch] Fix PR bootstrap/60620

2014-04-01 Thread Eric Botcazou
Hi,

the gnattools are now linked with the C++ compiler so, for the native case, it 
has a dependency on libstdc++-v3.  Adding such a dependency for a host tool on 
a target library is debatable, but there is already a precedent with libada.

Tested on x86_64-suse-linux, OK for the mainline?


2014-04-01  Eric Botcazou  

PR bootstrap/60620
* Makefile.def (dependencies): Make gnattools depend on libstdc++-v3. 
* Makefile.in: Regenerate.


-- 
Eric BotcazouIndex: Makefile.def
===
--- Makefile.def	(revision 208971)
+++ Makefile.def	(working copy)
@@ -336,6 +336,7 @@ dependencies = { module=all-libcpp; on=a
 dependencies = { module=all-fixincludes; on=all-libiberty; };
 
 dependencies = { module=all-gnattools; on=all-target-libada; };
+dependencies = { module=all-gnattools; on=all-target-libstdc++-v3; };
 
 dependencies = { module=all-lto-plugin; on=all-libiberty; };
 


Re: [PATCH] Fix PR60505

2014-04-01 Thread Richard Biener
On Fri, 28 Mar 2014, Cong Hou wrote:

> Ping?

Ok.

Thanks,
Richard.

> 
> thanks,
> Cong
> 
> 
> On Wed, Mar 19, 2014 at 11:39 AM, Cong Hou  wrote:
> > On Tue, Mar 18, 2014 at 4:43 AM, Richard Biener  wrote:
> >>
> >> On Mon, 17 Mar 2014, Cong Hou wrote:
> >>
> >> > On Mon, Mar 17, 2014 at 6:44 AM, Richard Biener  
> >> > wrote:
> >> > > On Fri, 14 Mar 2014, Cong Hou wrote:
> >> > >
> >> > >> On Fri, Mar 14, 2014 at 12:58 AM, Richard Biener  
> >> > >> wrote:
> >> > >> > On Fri, 14 Mar 2014, Jakub Jelinek wrote:
> >> > >> >
> >> > >> >> On Fri, Mar 14, 2014 at 08:52:07AM +0100, Richard Biener wrote:
> >> > >> >> > > Consider this fact and if there are alias checks, we can 
> >> > >> >> > > safely remove
> >> > >> >> > > the epilogue if the maximum trip count of the loop is less 
> >> > >> >> > > than or
> >> > >> >> > > equal to the calculated threshold.
> >> > >> >> >
> >> > >> >> > You have to consider n % vf != 0, so an argument on only maximum
> >> > >> >> > trip count or threshold cannot work.
> >> > >> >>
> >> > >> >> Well, if you only check if maximum trip count is <= vf and you know
> >> > >> >> that for n < vf the vectorized loop + it's epilogue path will not 
> >> > >> >> be taken,
> >> > >> >> then perhaps you could, but it is a very special case.
> >> > >> >> Now, the question is when we are guaranteed we enter the scalar 
> >> > >> >> versioned
> >> > >> >> loop instead for n < vf, is that in case of versioning for alias or
> >> > >> >> versioning for alignment?
> >> > >> >
> >> > >> > I think neither - I have plans to do the cost model check together
> >> > >> > with the versioning condition but didn't get around to implement 
> >> > >> > that.
> >> > >> > That would allow stronger max bounds for the epilogue loop.
> >> > >>
> >> > >> In vect_transform_loop(), check_profitability will be set to true if
> >> > >> th >= VF-1 and the number of iteration is unknown (we only consider
> >> > >> unknown trip count here), where th is calculated based on the
> >> > >> parameter PARAM_MIN_VECT_LOOP_BOUND and cost model, with the minimum
> >> > >> value VF-1. If the loop needs to be versioned, then
> >> > >> check_profitability with true value will be passed to
> >> > >> vect_loop_versioning(), in which an enhanced loop bound check
> >> > >> (considering cost) will be built. So I think if the loop is versioned
> >> > >> and n < VF, then we must enter the scalar version, and in this case
> >> > >> removing epilogue should be safe when the maximum trip count <= th+1.
> >> > >
> >> > > You mean exactly in the case where the profitability check ensures
> >> > > that n % vf == 0?  Thus effectively if n == maximum trip count?
> >> > > That's quite a special case, no?
> >> >
> >> >
> >> > Yes, it is a special case. But it is in this special case that those
> >> > warnings are thrown out. Also, I think declaring an array with VF*N as
> >> > length is not unusual.
> >>
> >> Ok, but then for the patch compute the cost model threshold once
> >> in vect_analyze_loop_2 and store it in a new
> >> LOOP_VINFO_COST_MODEL_THRESHOLD.
> >
> >
> > Done.
> >
> >
> >> Also you have to check
> >> the return value from max_stmt_executions_int as that may return
> >> -1 if the number cannot be computed (or isn't representable in
> >> a HOST_WIDE_INT).
> >
> >
> > It will be converted to unsigned type so that -1 means infinity.
> >
> >
> >> You also should check for
> >> LOOP_REQUIRES_VERSIONING_FOR_ALIGNMENT which should have the
> >> same effect on the cost model check.
> >
> >
> > Done.
> >
> >
> >>
> >>
> >> The existing condition is already complicated enough - adding new
> >> stuff warrants comments before the (sub-)checks.
> >
> >
> > OK. Comments added.
> >
> > Below is the revised patch. Bootstrapped and tested on a x86-64 machine.
> >
> >
> > Cong
> >
> >
> >
> > diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> > index e1d8666..eceefb3 100644
> > --- a/gcc/ChangeLog
> > +++ b/gcc/ChangeLog
> > @@ -1,3 +1,18 @@
> > +2014-03-11  Cong Hou  
> > +
> > + PR tree-optimization/60505
> > + * tree-vectorizer.h (struct _stmt_vec_info): Add th field as the
> > + threshold of number of iterations below which no vectorization will be
> > + done.
> > + * tree-vect-loop.c (new_loop_vec_info):
> > + Initialize LOOP_VINFO_COST_MODEL_THRESHOLD.
> > + * tree-vect-loop.c (vect_analyze_loop_operations):
> > + Set LOOP_VINFO_COST_MODEL_THRESHOLD.
> > + * tree-vect-loop.c (vect_transform_loop):
> > + Use LOOP_VINFO_COST_MODEL_THRESHOLD.
> > + * tree-vect-loop.c (vect_analyze_loop_2): Check the maximum number
> > + of iterations of the loop and see if we should build the epilogue.
> > +
> >  2014-03-10  Jakub Jelinek  
> >
> >   PR ipa/60457
> > diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
> > index 41b6875..09ec1c0 100644
> > --- a/gcc/testsuite/ChangeLog
> > +++ b/gcc/testsuite/ChangeLog
> > @@ -1,3 +1,8 @@
> > +2014-03-11  Cong Hou  
> > +
> > + PR tree-optimization/60505
> > + * gcc.dg/vect/pr60505.c: New test.
> > +
> >  20

RE: [patch] Shorten Windows path

2014-04-01 Thread Joey Ye
Ian, thanks for your comments. Please find answers and new version below:

> -Original Message-
> From: Ian Lance Taylor [mailto:i...@google.com]
> Sent: 25 March 2014 21:09
> To: Joey Ye
> Cc: gcc-patches
> Subject: Re: [patch] Shorten Windows path
> 
> On Tue, Mar 25, 2014 at 1:58 AM, Joey Ye  wrote:
> > Ping
> 
> This code looks different on mainline.
> 
> Writing "if ( do_canonical )" is not GCC style.
Fixed
> 
> This patch does not respect the configure option --disable-canonical-system-
> headers.
Solved by put is under the control of default ENABLE_CANONICAL_SYSTEM_HEADERS
> 
> Also I personally don't actually know what the consequences would be.
> Are there any downsides to canonicalizing header names?
Since 4.8 system headers are by default canonicalized. This version only 
additionally canonical non-system headers. I can't think of any downsides.

> 
> Ian

ChangeLog.libcpp:

* files.c (find_file_in_dir): Always try to shorten for DOS non-system 
headers.
* init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.

diff --git a/libcpp/files.c b/libcpp/files.c
index 7e88778..ad68682 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -387,8 +387,14 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool 
*invalid_pch)
   char *copy;
   void **pp;
 
-  /* We try to canonicalize system headers.  */
-  if (CPP_OPTION (pfile, canonical_system_headers) && file->dir->sysp)
+  /* We try to canonicalize system headers.  For DOS based file
+   * system, we always try to shorten non-system headers, as DOS
+   * has a tighter constraint on max path length.  */
+  if (CPP_OPTION (pfile, canonical_system_headers) && file->dir->sysp
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+ || !file->dir->sysp
+#endif
+)
{
  char * canonical_path = maybe_shorter_path (path);
  if (canonical_path)
diff --git a/libcpp/init.c b/libcpp/init.c
index f10413a..b809515 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -27,8 +27,12 @@ along with this program; see the file COPYING3.  If not see
 #include "filenames.h"
 
 #ifndef ENABLE_CANONICAL_SYSTEM_HEADERS
+#ifdef HAVE_DOS_BASED_FILE_SYSTEM
+#define ENABLE_CANONICAL_SYSTEM_HEADERS 1
+#else
 #define ENABLE_CANONICAL_SYSTEM_HEADERS 0
 #endif
+#endif
 
 static void init_library (void);
 static void mark_named_operators (cpp_reader *, int);




[committed, libjava] XFAIL sourcelocation (PR libgcj/55637) backported to 4.8.3

2014-04-01 Thread Dominique Dhumieres
r...@cebitec.uni-bielefeld.de (Rainer Orth) wrote:
> Sure, patch preapproved.

Commited as r208983:

2014-04-01  Dominique d'Humieres 
Rainer Orth  

PR libgcj/55637
* testsuite/libjava.lang/sourcelocation.xfail: New file.

Index: libjava/testsuite/libjava.lang/sourcelocation.xfail
===
--- libjava/testsuite/libjava.lang/sourcelocation.xfail (revision 0)
+++ libjava/testsuite/libjava.lang/sourcelocation.xfail (working copy)
@@ -0,0 +1 @@
+xfail-output

Dominique


Re: Lost __mips_o32 predefine on NetBSD

2014-04-01 Thread Richard Sandiford
Martin Husemann  writes:
> On Mon, Mar 31, 2014 at 08:35:30PM +0100, Richard Sandiford wrote:
>> Are you sure it was ever in FSF GCC?  I went through every revision
>> of netbsd.h in git and couldn't see it.
>
> No, I'm not - guess I never tried a pure gcc on mips.
>
>> I can go ahead and apply the patch anyway if it's the right thing to do.
>> Just wanted to make sure I wasn't missing something.
>
> Matt Thomas should be the authority on this. This was one of the very
> few changes I needed so far for NetBSD/playstation2 (the others all in
> bugzilla already).

OK, in that case I went ahead and applied it.  Thanks for the patch.

Richard


Re: [PATCH][LTO] Fix PR60720

2014-04-01 Thread Richard Biener
On Mon, 31 Mar 2014, Richard Biener wrote:

> 
> The following patch makes sure we wrap symbol references in global
> initializers the same as we do for IL references - inside a MEM_REF
> that guards their context against type changes due to symbol merging
> (and thus in this case against ICEs when processing an ARRAY_REF
> around a non-array object).
> 
> LTO bootstrap & regtest running on x86_64-unknown-linux-gnu.

It turns out that changing the tree structure while doing a DFS
walk is a bad idea so the following patch instead does it at
lto_output time (and restricts it to necessary cases, 
handled-component-refs wrapping the decls).

LTO bootstrapped and tested on x86_64-unknown-linux-gnu, queued for 
stage1.

Richard.

2014-04-01  Richard Biener  

PR lto/60720
* lto-streamer-out.c (wrap_refs): New function.
(lto_output): Wrap symbol references in global initializes in
type-preserving MEM_REFs.

* gcc.dg/lto/pr60720_0.c: New testcase.
* gcc.dg/lto/pr60720_1.c: Likewise.

Index: gcc/lto-streamer-out.c
===
*** gcc/lto-streamer-out.c  (revision 208955)
--- gcc/lto-streamer-out.c  (working copy)
*** copy_function (struct cgraph_node *node)
*** 2024,2029 
--- 2024,2052 
lto_end_section ();
  }
  
+ /* Wrap symbol references in *TP inside a type-preserving MEM_REF.  */
+ 
+ static tree
+ wrap_refs (tree *tp, int *ws, void *)
+ {
+   tree t = *tp;
+   if (handled_component_p (t)
+   && TREE_CODE (TREE_OPERAND (t, 0)) == VAR_DECL)
+ {
+   tree decl = TREE_OPERAND (t, 0);
+   tree ptrtype = build_pointer_type (TREE_TYPE (decl));
+   TREE_OPERAND (t, 0) = build2 (MEM_REF, TREE_TYPE (decl),
+   build1 (ADDR_EXPR, ptrtype, decl),
+   build_int_cst (ptrtype, 0));
+   TREE_THIS_VOLATILE (TREE_OPERAND (t, 0)) = TREE_THIS_VOLATILE (decl);
+   *ws = 0;
+ }
+   else if (TREE_CODE (t) == CONSTRUCTOR)
+ ;
+   else if (!EXPR_P (t))
+ *ws = 0;
+   return NULL_TREE;
+ }
  
  /* Main entry point from the pass manager.  */
  
*** lto_output (void)
*** 2045,2068 
for (i = 0; i < n_nodes; i++)
  {
symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
!   cgraph_node *node = dyn_cast  (snode);
!   if (node
! && lto_symtab_encoder_encode_body_p (encoder, node)
! && !node->alias)
{
  #ifdef ENABLE_CHECKING
! gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl)));
! bitmap_set_bit (output, DECL_UID (node->decl));
  #endif
! decl_state = lto_new_out_decl_state ();
! lto_push_out_decl_state (decl_state);
! if (gimple_has_body_p (node->decl) || !flag_wpa)
!   output_function (node);
! else
!   copy_function (node);
! gcc_assert (lto_get_out_decl_state () == decl_state);
! lto_pop_out_decl_state ();
! lto_record_function_out_decl_state (node->decl, decl_state);
}
  }
  
--- 2068,2100 
for (i = 0; i < n_nodes; i++)
  {
symtab_node *snode = lto_symtab_encoder_deref (encoder, i);
!   if (cgraph_node *node = dyn_cast  (snode))
{
+ if (lto_symtab_encoder_encode_body_p (encoder, node)
+ && !node->alias)
+   {
  #ifdef ENABLE_CHECKING
! gcc_assert (!bitmap_bit_p (output, DECL_UID (node->decl)));
! bitmap_set_bit (output, DECL_UID (node->decl));
  #endif
! decl_state = lto_new_out_decl_state ();
! lto_push_out_decl_state (decl_state);
! if (gimple_has_body_p (node->decl) || !flag_wpa)
!   output_function (node);
! else
!   copy_function (node);
! gcc_assert (lto_get_out_decl_state () == decl_state);
! lto_pop_out_decl_state ();
! lto_record_function_out_decl_state (node->decl, decl_state);
!   }
!   }
!   else if (varpool_node *node = dyn_cast  (snode))
!   {
! /* Wrap symbol references inside the ctor in a type
!preserving MEM_REF.  */
! tree ctor = DECL_INITIAL (node->decl);
! if (ctor && !in_lto_p)
!   walk_tree (&ctor, wrap_refs, NULL, NULL);
}
  }
  
Index: gcc/testsuite/gcc.dg/lto/pr60720_0.c
===
*** gcc/testsuite/gcc.dg/lto/pr60720_0.c(revision 0)
--- gcc/testsuite/gcc.dg/lto/pr60720_0.c(working copy)
***
*** 0 
--- 1,15 
+ /* { dg-lto-do run } */
+ /* { dg-extra-ld-options { -w } } */
+ 
+ /* ???  lto.exp does not allow to scan for
+:1:12: warning: type of 'x' does not match original declaration
+ extern int x[];
+^
+:1:5: note: previously declared here
+ int x;
+ ^  */
+ 
+ extern int x[];
+ int *foo[] = { &x[0] };
+ 
+ 

Re: Please revert the patches in bug #54040 and #59346 and special case x32

2014-04-01 Thread Svante Signell
On Wed, 2014-03-26 at 00:25 +0100, Eric Botcazou wrote:
> > Should I file a bug to get feedback on this issue? I know Ada is not the
> > most prioritized language for gcc, but anyway. The current
> > implementation is not POSIX-compliant.
> 
> Can you post a complete patch doing the reversion?  Breaking POSIX and every 
> Unix for the sake of x32 is definitely too much in my opinion.

Attached is a patch reverting the two commits for PR ada/54040:
http://gcc.gnu.org/git/?p=gcc.git&a=search&h=HEAD&st=commit&s=PR+ada%
2F54040

I will try to create a patch for x32, but need to get such an image
built and running to do that. Until then, it is better that x32 is
broken and all other architectures are not (at least in my opinion).

diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 352d655..935c6c3 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -2231,11 +2231,11 @@ ifeq ($(strip $(filter-out %x32 linux%,$(target_cpu) $(target_os))),)
   a-synbar.adshttp://www.gnu.org/licenses/>.  --
---  --
---  --
---
-
---  This is the x32 version of this package
-
---  This package encapsulates cpu specific differences between implementations
---  of GNU/Linux, in order to share s-osinte-linux.ads.
-
---  PLEASE DO NOT add any with-clauses to this package or remove the pragma
---  Preelaborate. This package is designed to be a bottom-level (leaf) package
-
-package System.Linux is
-   pragma Preelaborate;
-
-   
-   -- time_t --
-   
-
-   type time_t is new Long_Long_Integer;
-
-   ---
-   -- Errno --
-   ---
-
-   EAGAIN: constant := 11;
-   EINTR : constant := 4;
-   EINVAL: constant := 22;
-   ENOMEM: constant := 12;
-   EPERM : constant := 1;
-   ETIMEDOUT : constant := 110;
-
-   -
-   -- Signals --
-   -
-
-   SIGHUP : constant := 1; --  hangup
-   SIGINT : constant := 2; --  interrupt (rubout)
-   SIGQUIT: constant := 3; --  quit (ASCD FS)
-   SIGILL : constant := 4; --  illegal instruction (not reset)
-   SIGTRAP: constant := 5; --  trace trap (not reset)
-   SIGIOT : constant := 6; --  IOT instruction
-   SIGABRT: constant := 6; --  used by abort, replace SIGIOT in the  future
-   SIGFPE : constant := 8; --  floating point exception
-   SIGKILL: constant := 9; --  kill (cannot be caught or ignored)
-   SIGBUS : constant := 7; --  bus error
-   SIGSEGV: constant := 11; --  segmentation violation
-   SIGPIPE: constant := 13; --  write on a pipe with no one to read it
-   SIGALRM: constant := 14; --  alarm clock
-   SIGTERM: constant := 15; --  software termination signal from kill
-   SIGUSR1: constant := 10; --  user defined signal 1
-   SIGUSR2: constant := 12; --  user defined signal 2
-   SIGCLD : constant := 17; --  alias for SIGCHLD
-   SIGCHLD: constant := 17; --  child status change
-   SIGPWR : constant := 30; --  power-fail restart
-   SIGWINCH   : constant := 28; --  window size change
-   SIGURG : constant := 23; --  urgent condition on IO channel
-   SIGPOLL: constant := 29; --  pollable event occurred
-   SIGIO  : constant := 29; --  I/O now possible (4.2 BSD)
-   SIGLOST: constant := 29; --  File lock lost
-   SIGSTOP: constant := 19; --  stop (cannot be caught or ignored)
-   SIGTSTP: constant := 20; --  user stop requested from tty
-   SIGCONT: constant := 18; --  stopped process has been continued
-   SIGTTIN: constant := 21; --  background tty read attempted
-   SIGTTOU: constant := 22; --  background tty write attempted
-   SIGVTALRM  : constant := 26; --  virtual timer expired
-   SIGPROF: constant := 27; --  profiling timer expired
-   SIGXCPU: constant := 24; --  CPU time limit exceeded
-   SIGXFSZ: constant := 25; --  filesize limit exceeded
-   SIGUNUSED  : constant := 31; --  unused signal (GNU/Linux)
-   SIGSTKFLT  : constant := 16; --  coprocessor stack fault (Linux)
-   SIGLTHRRES : constant := 32; --  GNU/LinuxThreads restart signal
-   SIGLTHRCAN : constant := 33; --  GNU/LinuxThreads cancel signal
-   SIGLTHRDBG : constant := 34; --  GNU/LinuxThreads debugger signal
-
-   --  struct_sigaction offsets
-
-   sa_handler_pos : constant := 0;
-   sa_mask_pos: constant := Standard'Address_Size / 8;
-   sa_flags_pos   : constant := 128 + sa_mask_pos;
-
-   SA_SIGINFO  : constant := 16#04#;
-   SA_ONSTACK  : constant := 16#0800#;
-
-end System.Linux;
diff --git a/gcc/ada/s-linux.ads b/gcc/ada/s-linux.ads
index 2339e29..c8a7ad1 100644
--- a/gcc/ada/s-linux.ads
+++ b/gcc/ada/s-linux.ads
@@ -38,12 +38,6 @@
 package System.Linux is
pragma Preelabor

Re: std::quoted doesn't respect padding

2014-04-01 Thread Jonathan Wakely

[CCing gcc-patches]

On 11/03/14 11:18 -0400, Ed Smith-Rowland wrote:

On 02/14/2014 07:56 PM, Jonathan Wakely wrote:

We need to implement this fix (probably after 4.9 is released though)

http://cplusplus.github.io/LWG/lwg-active.html#2344


Here is a patch (Stage 1 obviously).


A couple of things I didn't notice earlier ...


Index: include/std/iomanip
===
--- include/std/iomanip (revision 208430)
+++ include/std/iomanip (working copy)
@@ -41,6 +41,7 @@

#if __cplusplus >= 201103L
#include 
+#include  // used in quoted.


We really only need  for __cplusplus > 201103L, otherwise we
include it unnecessarily for C++11.



-   return __os;
+   return __os << __ostr.str();
  }


It should be slightly more efficient to do __os << __ostr.rdbuf() here,
and in the other operator<< overload, since that copies directly from
the stringbuf to __os's own streambuf, rather than creating a
temporary std::string and copying from that.



[PATCH, nios2] Misc. fixes

2014-04-01 Thread Chung-Lin Tang
This contains a few small changes/fixes, committed to trunk.

(1) a typo in nios2_function_profiler.
(2) unneeded parameter in nios2_large_got_address().
(3) remove two no longer needed unspec enums.
(4) Provide basic implementation of the delegitimize address hook, to
silent a unrecognized UNSPECs warning when building with -g.
(5) Adjust the nios2-linux LINK_SPEC to define the dynamic linker name
to /lib/ld-linux-nios2.so.1, which is the current upstreamed arrangement.

Chung-Lin

2014-04-01  Chung-Lin Tang  

* config/nios2/nios2.md (unspec): Remove UNSPEC_TLS, UNSPEC_TLS_LDM.
* config/nios2/nios2.c (nios2_function_profiler): Fix addi operand
typo.
(nios2_large_got_address): Remove unneeded 'sym' parameter.
(nios2_got_address): Update nios2_large_got_address call site.
(nios2_delegitimize_address): New function.
(TARGET_DELEGITIMIZE_ADDRESS): Define to nios2_delegitimize_address.
* config/nios2/linux.h (GLIBC_DYNAMIC_LINKER): Define.
(LINK_SPEC): Specify dynamic linker using GNU_USER_DYNAMIC_LINKER.
Index: config/nios2/linux.h
===
--- config/nios2/linux.h	(revision 208987)
+++ config/nios2/linux.h	(working copy)
@@ -26,11 +26,16 @@
 }   \
   while (0)
 
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-nios2.so.1"
+
 #undef LINK_SPEC
 #define LINK_SPEC LINK_SPEC_ENDIAN \
-  " %{shared:-shared} \
-%{static:-Bstatic} \
-%{rdynamic:-export-dynamic}"
+ "%{shared:-shared} \
+  %{!shared: \
+%{!static: \
+  %{rdynamic:-export-dynamic} \
+  -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
+%{static:-static}}"
 
 /* This toolchain implements the ABI for Linux Systems documented in the
Nios II Processor Reference Handbook.  */
Index: config/nios2/nios2.md
===
--- config/nios2/nios2.md	(revision 208987)
+++ config/nios2/nios2.md	(working copy)
@@ -74,8 +74,6 @@
   UNSPEC_PIC_SYM
   UNSPEC_PIC_CALL_SYM
   UNSPEC_PIC_GOTOFF_SYM
-  UNSPEC_TLS
-  UNSPEC_TLS_LDM
   UNSPEC_LOAD_TLS_IE
   UNSPEC_ADD_TLS_LE
   UNSPEC_ADD_TLS_GD
Index: config/nios2/nios2.c
===
--- config/nios2/nios2.c	(revision 208987)
+++ config/nios2/nios2.c	(working copy)
@@ -695,7 +695,7 @@ nios2_function_profiler (FILE *file, int labelno A
   fprintf (file, "\taddi\tr3, r3, %%lo(_gp_got - 1b)\n");
   fprintf (file, "\tadd\tr2, r2, r3\n");
   fprintf (file, "\tmovhi\tr3, %%call_hiadj(_mcount)\n");
-  fprintf (file, "\taddi\tr3, %%call_lo(_mcount)\n");
+  fprintf (file, "\taddi\tr3, r3, %%call_lo(_mcount)\n");
   fprintf (file, "\tadd\tr3, r2, r3\n");
   fprintf (file, "\tldw\tr2, 0(r3)\n");
   fprintf (file, "\tcallr\tr2\n");
@@ -1183,7 +1183,7 @@ nios2_unspec_offset (rtx loc, int unspec)
 
 /* Generate GOT pointer based address with large offset.  */
 static rtx
-nios2_large_got_address (rtx sym, rtx offset)
+nios2_large_got_address (rtx offset)
 {
   rtx addr = gen_reg_rtx (Pmode);
   emit_insn (gen_add3_insn (addr, pic_offset_table_rtx,
@@ -1199,7 +1199,7 @@ nios2_got_address (rtx loc, int unspec)
   crtl->uses_pic_offset_table = 1;
 
   if (nios2_large_offset_p (unspec))
-return nios2_large_got_address (loc, offset);
+return nios2_large_got_address (offset);
 
   return gen_rtx_PLUS (Pmode, pic_offset_table_rtx, offset);
 }
@@ -1805,6 +1805,30 @@ nios2_legitimize_address (rtx x, rtx oldx ATTRIBUT
   return x;
 }
 
+static rtx
+nios2_delegitimize_address (rtx x)
+{
+  x = delegitimize_mem_from_attrs (x);
+
+  if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == UNSPEC)
+{
+  switch (XINT (XEXP (x, 0), 1))
+	{
+	case UNSPEC_PIC_SYM:
+	case UNSPEC_PIC_CALL_SYM:
+	case UNSPEC_PIC_GOTOFF_SYM:
+	case UNSPEC_ADD_TLS_GD:
+	case UNSPEC_ADD_TLS_LDM:
+	case UNSPEC_LOAD_TLS_IE:
+	case UNSPEC_ADD_TLS_LE:
+	  x = XVECEXP (XEXP (x, 0), 0, 0);
+	  gcc_assert (GET_CODE (x) == SYMBOL_REF);
+	  break;
+	}
+}
+  return x;
+}
+
 /* Main expander function for RTL moves.  */
 int
 nios2_emit_move_sequence (rtx *operands, enum machine_mode mode)
@@ -3259,6 +3283,9 @@ nios2_merge_decl_attributes (tree olddecl, tree ne
 #undef TARGET_LEGITIMIZE_ADDRESS
 #define TARGET_LEGITIMIZE_ADDRESS nios2_legitimize_address
 
+#undef TARGET_DELEGITIMIZE_ADDRESS
+#define TARGET_DELEGITIMIZE_ADDRESS nios2_delegitimize_address
+
 #undef TARGET_LEGITIMATE_ADDRESS_P
 #define TARGET_LEGITIMATE_ADDRESS_P nios2_legitimate_address_p
 


Re: [PATCH, PR 60640] When creating virtual clones, clone thunks too

2014-04-01 Thread Martin Jambor
Hi,

On Fri, Mar 28, 2014 at 09:43:53PM +0100, Jan Hubicka wrote:
> > Hi,
> > 
> > this patch fixes PR 60640 by creating thunks to clones when that is
> > necessary to properly redirect edges to them.  I mostly does what
> > cgraph_add_thunk does and what analyze_function does to thunks.  It
> > fixes the testcases on trunk (it does not apply to 4.8, I have not
> > looked how easily fixable that it) and passes bootstrap and testing on
> > x86_64-linux.
> > 
> > OK for trunk?
> > 
> > Thanks,
> > 
> > Martin
> > 
> > 
> > 2014-03-26  Martin Jambor  
> > 
> > * cgraph.h (cgraph_clone_node): New parameter added to declaration.
> > Adjust all callers.
> > * cgraphclones.c (build_function_type_skip_args): Moved upwards in the
> > file.
> > (build_function_decl_skip_args): Likewise.
> > (duplicate_thunk_for_node): New function.
> > (redirect_edge_duplicating_thunks): Likewise.
> > (cgraph_clone_node): New parameter args_to_skip, pass it to
> > redirect_edge_duplicating_thunks which is called instead of
> > cgraph_redirect_edge_callee.
> > (cgraph_create_virtual_clone): Pass args_to_skip to cgraph_clone_node.
> > +/* Duplicate thunk THUNK but make it to refer to NODE.  ARGS_TO_SKIP, if
> > +   non-NULL, determines which parameters should be omitted.  */
> > +
> > +static cgraph_node *
> > +duplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node,
> > + bitmap args_to_skip)
> > +{
> > +  cgraph_node *new_thunk, *thunk_of;
> > +  thunk_of = cgraph_function_or_thunk_node (thunk->callees->callee);
> > +
> > +  if (thunk_of->thunk.thunk_p)
> > +node = duplicate_thunk_for_node (thunk_of, node, args_to_skip);
> > +
> > +  tree new_decl;
> > +  if (!args_to_skip)
> > +new_decl = copy_node (thunk->decl);
> > +  else
> > +new_decl = build_function_decl_skip_args (thunk->decl, args_to_skip, 
> > false);
> > +
> > +  gcc_checking_assert (!DECL_STRUCT_FUNCTION (new_decl));
> > +  gcc_checking_assert (!DECL_INITIAL (new_decl));
> > +  gcc_checking_assert (!DECL_RESULT (new_decl));
> > +  gcc_checking_assert (!DECL_RTL_SET_P (new_decl));
> > +
> > +  DECL_NAME (new_decl) = clone_function_name (thunk->decl, 
> > "artificial_thunk");
> > +  SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl));
> > +  DECL_EXTERNAL (new_decl) = 0;
> > +  DECL_SECTION_NAME (new_decl) = NULL;
> > +  DECL_COMDAT_GROUP (new_decl) = 0;
> > +  TREE_PUBLIC (new_decl) = 0;
> > +  DECL_COMDAT (new_decl) = 0;
> > +  DECL_WEAK (new_decl) = 0;
> > +  DECL_VIRTUAL_P (new_decl) = 0;
> > +  DECL_STATIC_CONSTRUCTOR (new_decl) = 0;
> > +  DECL_STATIC_DESTRUCTOR (new_decl) = 0;
> 
> We probably ought to factor out this to common subfunction.

I did that in the new patch below.

> > +
> > +  new_thunk = cgraph_create_node (new_decl);
> > +  new_thunk->definition = true;
> > +  new_thunk->thunk = thunk->thunk;
> > +  new_thunk->unique_name = in_lto_p;
> > +  new_thunk->externally_visible = 0;
> > +  new_thunk->local.local = 1;
> > +  new_thunk->lowered = true;
> > +  new_thunk->former_clone_of = thunk->decl;
> > +
> > +  struct cgraph_edge *e = cgraph_create_edge (new_thunk, node, NULL, 0,
> > + CGRAPH_FREQ_BASE);
> > +  e->call_stmt_cannot_inline_p = true;
> > +  cgraph_call_edge_duplication_hooks (thunk->callees, e);
> > +  if (!expand_thunk (new_thunk, false))
> > +new_thunk->analyzed = true;
> > +  cgraph_call_node_duplication_hooks (thunk, new_thunk);
> > +  return new_thunk;
> > +}
> > +
> > +/* If E does not lead to a thunk, simply redirect it to N.  Otherwise 
> > create
> > +   one or more equivalent thunks for N and redirect E to the first in the
> > +   chain.  */
> > +
> > +void
> > +redirect_edge_duplicating_thunks (struct cgraph_edge *e, struct 
> > cgraph_node *n,
> > + bitmap args_to_skip)
> > +{
> > +  cgraph_node *orig_to = cgraph_function_or_thunk_node (e->callee);
> > +  if (orig_to->thunk.thunk_p)
> > +n = duplicate_thunk_for_node (orig_to, n, args_to_skip);
> 
> Is there anything that would pevent us from creating a new thunk for
> each call?

No, given how late we have discovered it, it probably only happens
very rarely.  Moreover, since you have plans to always inline only
directly called thunks for the next release, which should be the
ultimate solution, I did not think it was necessary or even
appropriate at this stage.

> 
> Also I think you need to avoid this logic when THIS parameter is being 
> optimized out
> (i.e. it is part of skip_args)

You are of course right.  However, skipping the creation of a new
thunk when we are also removing parameter this leads to verification
errors again, so I had to also teach the verifier that this case is
actually OK.  Moreover, although it seems that currently all
non-this_adjusting thunks are expanded before IPA-CP runs, I made sure
the skipping logic checked that flag.

Accidently, the two original testcases are removing parameter this so

[PATCH][LTO] Support -fno-use-linker-plugin with auto-loaded plugin

2014-04-01 Thread Richard Biener

BFD supports plugin auto-loading for plugins placed in 
/usr/lib/bfd-plugins (if you make it work for GNU LTO objects by
fixing PR14698).  If it does so then we claim LTO IR objects
via the plugin machinery even if -fno-use-linker-plugin is
specified (in that case the gcc driver won't pass a -plugin option
to ld already).  Thus the following patch makes the auto-load
plus -fno-use-linker-plugin combination work by failing at
plugin-load time if that option is in COLLECT_GCC_OPTIONS.

Built and tested on x86_64-unknown-linux-gnu.

Ok?

(I have to repeat myself that we have too many supported
LTO-modes-of-operation)

Thanks,
Richard.

2014-04-01  Richard Biener  

lto-plugin/
* lto-plugin.c (onload): Fail to load if -fno-use-linker-plugin
is set in COLLECT_GCC_OPTIONS.

Index: lto-plugin/lto-plugin.c
===
*** lto-plugin/lto-plugin.c (revision 208978)
--- lto-plugin/lto-plugin.c (working copy)
*** onload (struct ld_plugin_tv *tv)
*** 1067,1071 
--- 1067,1078 
 "could not register the all_symbols_read callback");
  }
  
+   /* Support -fno-use-linker-plugin by failing to load the plugin
+  for the case where it is auto-loaded by BFD.  */
+   char *collect_gcc_options = getenv ("COLLECT_GCC_OPTIONS");
+   if (collect_gcc_options
+   && strstr (collect_gcc_options, "'-fno-use-linker-plugin'"))
+ return LDPS_ERR;
+ 
return LDPS_OK;
  }


[PATCH][LTO] Rework -flto-partition=, add =one case

2014-04-01 Thread Richard Biener

This reworks the option to use the Enum support we have now and
adds a =one case (to eventually get rid of one LTO operation mode,
=none ...).  I was tempted to support -flto-partition=
and get rid of --param lto-partitions (thereby also supporting =1),
but that param specifies the maximum number of partitions and
still uses the balanced algorithm, thus the result would be
confusing (and of little use I suppose, as opposed to =1 which should
give you the same answer as =none).

Not tested yet, queued for stage1.

Thanks,
Richard.

2014-04-01  Richard Biener  

* common.opt (lto_partition_model): New enum.
(flto-partition=): Merge separate options with a single with argument,
add -flto-partition=one support.
* flag-types.h (enum lto_partition_model): Declare.
* opts.c (finish_options): Remove duplicate -flto-partition=
option check.
* lto-wrapper.c (run_gcc): Adjust.

lto/
* lto.c: Include params.h.
(do_whole_program_analysis): Switch on flag_lto_partition value,
add support for LTO_PARTITION_ONE.
* lto-partition.h (lto_balanced_map): Adjust.
* lto-partition.c (lto_balanced_map): Get number of desired
partitions as argument to support -flto-partition=one.



Index: gcc/common.opt
===
--- gcc/common.opt  (revision 208978)
+++ gcc/common.opt  (working copy)
@@ -1491,21 +1491,27 @@ flto=
 Common RejectNegative Joined Var(flag_lto)
 Link-time optimization with number of parallel jobs or jobserver.
 
-flto-partition=1to1
-Common Var(flag_lto_partition_1to1)
-Partition symbols and vars at linktime based on object files they originate 
from
-
-flto-partition=balanced
-Common Var(flag_lto_partition_balanced)
-Partition functions and vars at linktime into approximately same sized buckets
-
-flto-partition=max
-Common Var(flag_lto_partition_max)
-Put every symbol into separate partition
-
-flto-partition=none
-Common Var(flag_lto_partition_none)
-Disable partioning and streaming
+Enum
+Name(lto_partition_model) Type(enum lto_partition_model) UnknownError(unknown 
LTO partitioning model %qs)
+
+EnumValue
+Enum(lto_partition_model) String(none) Value(LTO_PARTITION_NONE)
+
+EnumValue
+Enum(lto_partition_model) String(one) Value(LTO_PARTITION_ONE)
+
+EnumValue
+Enum(lto_partition_model) String(balanced) Value(LTO_PARTITION_BALANCED)
+
+EnumValue
+Enum(lto_partition_model) String(1to1) Value(LTO_PARTITION_1TO1)
+
+EnumValue
+Enum(lto_partition_model) String(max) Value(LTO_PARTITION_MAX)
+
+flto-partition=
+Common Joined RejectNegative Enum(lto_partition_model) Var(flag_lto_partition) 
Init(LTO_PARTITION_BALANCED)
+Specify the algorithm to partition symbols and vars at linktime
 
 ; The initial value of -1 comes from Z_DEFAULT_COMPRESSION in zlib.h.
 flto-compression-level=
Index: gcc/flag-types.h
===
--- gcc/flag-types.h(revision 208978)
+++ gcc/flag-types.h(working copy)
@@ -229,4 +229,14 @@ enum vtv_priority {
   VTV_STANDARD_PRIORITY = 1,
   VTV_PREINIT_PRIORITY  = 2
 };
+
+/* flag_lto_partition initialization values.  */
+enum lto_partition_model {
+  LTO_PARTITION_NONE = 0,
+  LTO_PARTITION_ONE = 1,
+  LTO_PARTITION_BALANCED = 2,
+  LTO_PARTITION_1TO1 = 3,
+  LTO_PARTITION_MAX = 4
+};
+
 #endif /* ! GCC_FLAG_TYPES_H */
Index: gcc/opts.c
===
--- gcc/opts.c  (revision 208978)
+++ gcc/opts.c  (working copy)
@@ -824,14 +824,6 @@ finish_options (struct gcc_options *opts
  opts->x_flag_fat_lto_objects = 1;
}
 }
-  if ((opts->x_flag_lto_partition_balanced != 0) + 
(opts->x_flag_lto_partition_1to1 != 0)
-   + (opts->x_flag_lto_partition_none != 0) >= 1)
-{
-  if ((opts->x_flag_lto_partition_balanced != 0)
-  + (opts->x_flag_lto_partition_1to1 != 0)
-  + (opts->x_flag_lto_partition_none != 0) > 1)
-   error_at (loc, "only one -flto-partition value can be specified");
-}
 
   /* We initialize opts->x_flag_split_stack to -1 so that targets can set a
  default value if they choose based on other options.  */
Index: gcc/lto/lto.c
===
--- gcc/lto/lto.c   (revision 208978)
+++ gcc/lto/lto.c   (working copy)
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3.
 #include "data-streamer.h"
 #include "context.h"
 #include "pass_manager.h"
+#include "params.h"
 
 
 /* Number of parallel tasks to run, -1 if we want to use GNU Make jobserver.  
*/
@@ -3266,12 +3268,16 @@ do_whole_program_analysis (void)
   timevar_pop (TV_WHOPR_WPA);
 
   timevar_push (TV_WHOPR_PARTITIONING);
-  if (flag_lto_partition_1to1)
+  if (flag_lto_partition == LTO_PARTITION_1TO1)
 lto_1_to_1_map ();
-  else if (flag_lto_partition_max)
+  else if (flag_lto_partition == LTO_PARTITION_MAX)
 lto_max_map ();
+  

PING [Patch] Silence test failures on darwin9

2014-04-01 Thread Dominique Dhumieres
Patch submitted at

http://gcc.gnu.org/ml/gcc-patches/2014-03/msg01477.html

Results for powerpc-apple-darwin9 with the patches at

http://gcc.gnu.org/ml/gcc-testresults/2014-03/msg02361.html

and without them at 

http://gcc.gnu.org/ml/gcc-testresults/2014-02/msg01256.html

OK for trunk? OK to backport the suitable patches for pr54083 and
pr54407 to 4.8 and 4.7 branches?

TIA

Dominique


[PATCH] Fix PR60729, expand_abs and -ftrapv

2014-04-01 Thread Richard Biener

It looks like expand_abs and clients use absv_optab even for
FP modes which IMHO is wrong.  The following restricts it
to MODE_INT (not sure what modes the v variants should be present,
but existing checks use MODE_INT and libgcc only provides SImode and
DImode fallbacks).

I've took the liberty to fix the smax expansion path to properly
use negv_optab if required.

Bootstrap and regtest running on x86_64-unknown-linux-gnu, ok?

While in general -ftrap support is in a sorry state we shouldn't
ICE with it ...

Thanks,
Richard.

2014-04-01  Richard Biener  

PR middle-end/60729
* optabs.c (expand_abs_nojump): Honor flag_trapv only for
MODE_INTs.  Properly use negv_optab.
(expand_abs): Likewise.

* g++.dg/vect/pr60729.cc: New testcase.

Index: gcc/optabs.c
===
*** gcc/optabs.c(revision 208988)
--- gcc/optabs.c(working copy)
*** expand_abs_nojump (enum machine_mode mod
*** 3384,3390 
  {
rtx temp;
  
!   if (! flag_trapv)
  result_unsignedp = 1;
  
/* First try to do it with a special abs instruction.  */
--- 3384,3391 
  {
rtx temp;
  
!   if (GET_MODE_CLASS (mode) != MODE_INT
!   || ! flag_trapv)
  result_unsignedp = 1;
  
/* First try to do it with a special abs instruction.  */
*** expand_abs_nojump (enum machine_mode mod
*** 3407,3413 
  {
rtx last = get_last_insn ();
  
!   temp = expand_unop (mode, neg_optab, op0, NULL_RTX, 0);
if (temp != 0)
temp = expand_binop (mode, smax_optab, op0, temp, target, 0,
 OPTAB_WIDEN);
--- 3408,3415 
  {
rtx last = get_last_insn ();
  
!   temp = expand_unop (mode, result_unsignedp ? neg_optab : negv_optab,
! op0, NULL_RTX, 0);
if (temp != 0)
temp = expand_binop (mode, smax_optab, op0, temp, target, 0,
 OPTAB_WIDEN);
*** expand_abs (enum machine_mode mode, rtx
*** 3449,3455 
  {
rtx temp, op1;
  
!   if (! flag_trapv)
  result_unsignedp = 1;
  
temp = expand_abs_nojump (mode, op0, target, result_unsignedp);
--- 3451,3458 
  {
rtx temp, op1;
  
!   if (GET_MODE_CLASS (mode) != MODE_INT
!   || ! flag_trapv)
  result_unsignedp = 1;
  
temp = expand_abs_nojump (mode, op0, target, result_unsignedp);
Index: gcc/testsuite/g++.dg/vect/pr60729.cc
===
*** gcc/testsuite/g++.dg/vect/pr60729.cc(revision 0)
--- gcc/testsuite/g++.dg/vect/pr60729.cc(working copy)
***
*** 0 
--- 1,10 
+ // { dg-do compile }
+ // { dg-additional-options "-ftrapv" }
+ 
+ void doSomething(int dim, double *Y, double *A) 
+ {
+   for (int k=0; k

[COMMITTED] Fix target/60704

2014-04-01 Thread Richard Henderson
Yet more fallout from my float->int changes.

This time the failure is during sched1, where we try to constrain_operands to
figure out what the sched parameters are for the insn.  Except that since this
is before register allocation, where we are going to force the operand to
memory, there were no alternatives that match.

This seems a bit of a hacky solution, keeping the register alternative enabled
until we get to register allocation, but it's restricted in scope to the i386
backend and thus gets extra points at this stage.

Another possibility is to have constrain_alternatives randomly pick an
alternative, assuming the register allocator will DTRT or barf later.

Thoughts?


r~
PR target/60704
* config/i386/i386.md (*float2_sse): Leave the second
alternative enabled before register allocation.


diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index ca16173..25e2e93 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -4739,8 +4739,13 @@
&& X87_ENABLE_FLOAT (mode,
 mode)")
 (eq_attr "alternative" "1")
+  /* ??? For sched1 we need constrain_operands to be able to
+ select an alternative.  Leave this enabled before RA.  */
   (symbol_ref "TARGET_INTER_UNIT_CONVERSIONS
-   || optimize_function_for_size_p (cfun)")
+   || optimize_function_for_size_p (cfun)
+   || !(reload_completed
+|| reload_in_progress
+|| lra_in_progress)")
]
(symbol_ref "true")))
])


Re: [COMMITTED] Fix target/60704

2014-04-01 Thread H.J. Lu
On Tue, Apr 1, 2014 at 7:48 AM, Richard Henderson  wrote:
> Yet more fallout from my float->int changes.
>
> This time the failure is during sched1, where we try to constrain_operands to
> figure out what the sched parameters are for the insn.  Except that since this
> is before register allocation, where we are going to force the operand to
> memory, there were no alternatives that match.
>
> This seems a bit of a hacky solution, keeping the register alternative enabled
> until we get to register allocation, but it's restricted in scope to the i386
> backend and thus gets extra points at this stage.
>
> Another possibility is to have constrain_alternatives randomly pick an
> alternative, assuming the register allocator will DTRT or barf later.
>
> Thoughts?

Shouldn't it include the testcase?

-- 
H.J.


Re: [PATCH][LTO] Rework -flto-partition=, add =one case

2014-04-01 Thread Jan Hubicka
> 
> This reworks the option to use the Enum support we have now and
> adds a =one case (to eventually get rid of one LTO operation mode,
> =none ...).  I was tempted to support -flto-partition=
> and get rid of --param lto-partitions (thereby also supporting =1),

Yep, I preffer to have one switch to chose algorithm and other to set
its parameter as you do now. At the moment partitioning is quite a non-issue
since only important IPA passes works on whole thing, but that may change and
we may want to play with different partitionings.
(I have plans for that for incremental compilation and other things)

> but that param specifies the maximum number of partitions and
> still uses the balanced algorithm, thus the result would be
> confusing (and of little use I suppose, as opposed to =1 which should
> give you the same answer as =none).

=none still seems somewhat useful - for setups where you do multiple parallel
compilations it will be faster than WHOPR and it helps developing IPA passes
since you do not need to worry about WHOPR complexities at start.

But with the code to bring function bodies at demand, this is less important.
I believe with passmanager being bit more flexible, the code paths can be
almost completely shared. Have few patches on this and pass queue reorg for
next stage1, so will try to push them out.

Honza


Re: [PATCH][LTO] Support -fno-use-linker-plugin with auto-loaded plugin

2014-04-01 Thread Jan Hubicka
> 
> BFD supports plugin auto-loading for plugins placed in 
> /usr/lib/bfd-plugins (if you make it work for GNU LTO objects by
> fixing PR14698).  If it does so then we claim LTO IR objects
> via the plugin machinery even if -fno-use-linker-plugin is
> specified (in that case the gcc driver won't pass a -plugin option
> to ld already).  Thus the following patch makes the auto-load
> plus -fno-use-linker-plugin combination work by failing at
> plugin-load time if that option is in COLLECT_GCC_OPTIONS.
> 
> Built and tested on x86_64-unknown-linux-gnu.
> 
> Ok?
> 
> (I have to repeat myself that we have too many supported
> LTO-modes-of-operation)

Yep, I definitely do not disagree with this, despite my comments
on =none ;)
> 
> Thanks,
> Richard.
> 
> 2014-04-01  Richard Biener  
> 
>   lto-plugin/
>   * lto-plugin.c (onload): Fail to load if -fno-use-linker-plugin
>   is set in COLLECT_GCC_OPTIONS.

Yep, this seems make sense and looks like an obvoius patch to me ;)

Honza
> 
> Index: lto-plugin/lto-plugin.c
> ===
> *** lto-plugin/lto-plugin.c   (revision 208978)
> --- lto-plugin/lto-plugin.c   (working copy)
> *** onload (struct ld_plugin_tv *tv)
> *** 1067,1071 
> --- 1067,1078 
>"could not register the all_symbols_read callback");
>   }
>   
> +   /* Support -fno-use-linker-plugin by failing to load the plugin
> +  for the case where it is auto-loaded by BFD.  */
> +   char *collect_gcc_options = getenv ("COLLECT_GCC_OPTIONS");
> +   if (collect_gcc_options
> +   && strstr (collect_gcc_options, "'-fno-use-linker-plugin'"))
> + return LDPS_ERR;
> + 
> return LDPS_OK;
>   }


Re: [COMMITTED] Fix target/60704

2014-04-01 Thread Richard Henderson
On 04/01/2014 08:22 AM, H.J. Lu wrote:
> On Tue, Apr 1, 2014 at 7:48 AM, Richard Henderson  wrote:
>> Yet more fallout from my float->int changes.
>>
>> This time the failure is during sched1, where we try to constrain_operands to
>> figure out what the sched parameters are for the insn.  Except that since 
>> this
>> is before register allocation, where we are going to force the operand to
>> memory, there were no alternatives that match.
>>
>> This seems a bit of a hacky solution, keeping the register alternative 
>> enabled
>> until we get to register allocation, but it's restricted in scope to the i386
>> backend and thus gets extra points at this stage.
>>
>> Another possibility is to have constrain_alternatives randomly pick an
>> alternative, assuming the register allocator will DTRT or barf later.
>>
>> Thoughts?
> 
> Shouldn't it include the testcase?

Oops.  Forgot to add the file to the commit.  Now done.


r~



Fwd: [PATCH] pedantic warning behavior when casting void* to ptr-to-func, 4.8 and 4.9

2014-04-01 Thread Daniel Gutson
I just realized I posted the patch in the wrong list.


-- Forwarded message --
From: Daniel Gutson 
Date: Tue, Apr 1, 2014 at 10:43 AM
Subject: [PATCH] pedantic warning behavior when casting void* to
ptr-to-func, 4.8 and 4.9
To: gcc Mailing List 


Hi,

   I observed two different behaviors in gcc 4.8.2 and 4.9 regarding
the same issue, IMO both erroneous.

Regarding 4.8.2, #pragma GCC diagnostic ignored "-pedantic" doesn't
work in cases such as:
void* p = 0;
#pragma GCC diagnostic ignored "-pedantic"
F* f2 = reinterpret_cast(p);

(see testcase in the patch).

The attached patch attempts to fix this issue. Since I no longer have
write access, please
apply this for me if correct (is the 4.8 branch still alive for adding fixes?).

Regarding 4.9, gcc fails to complain at all when -pedantic is passed,
even specifying -std=c++03.
Please let me know if this is truly a bug, in which case I could also
fix it for the latest version as well
(if so, please let me know if I should look into trunk or any other branch).

Thanks,

   Daniel.

2014-03-31  Daniel Gutson  

gcc/cp/
* typeck.c (build_reinterpret_cast_1): Pass proper argument to
warn() in pedantic.

gcc/testsuite/g++.dg/
* diagnostic/pedantic.C: New test case.
--- gcc-4.8.2-orig/gcc/cp/typeck.c	2014-03-31 22:29:42.736367936 -0300
+++ gcc-4.8.2/gcc/cp/typeck.c	2014-03-31 14:26:43.536747050 -0300
@@ -6639,7 +6639,7 @@
 	   where possible, and it is necessary in some cases.  DR 195
 	   addresses this issue, but as of 2004/10/26 is still in
 	   drafting.  */
-	warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
+	warning (OPT_Wpedantic, "ISO C++ forbids casting between pointer-to-function and pointer-to-object");
   return fold_if_not_in_template (build_nop (type, expr));
 }
   else if (TREE_CODE (type) == VECTOR_TYPE)
--- gcc-4.8.2-orig/gcc/testsuite/g++.dg/diagnostic/pedantic.C	1969-12-31 21:00:00.0 -0300
+++ gcc-4.8.2/gcc/testsuite/g++.dg/diagnostic/pedantic.C	2014-03-31 17:24:42.532607344 -0300
@@ -0,0 +1,12 @@
+// { dg-do compile }
+// { dg-options "-pedantic" }
+typedef void F(void);
+
+void foo()
+{
+void* p = 0;
+F* f1 = reinterpret_cast(p);// { dg-warning "ISO" }
+#pragma GCC diagnostic ignored "-pedantic"
+F* f2 = reinterpret_cast(p);
+}
+


Re: [Fortran][PATCH][gomp4]: Transform OpenACC loop directive

2014-04-01 Thread Ilmir Usmanov

Hi Tobias!

Thanks a lot for your review!

On 26.03.2014 03:16, Tobias Burnus wrote:



* And do concurrent also supports masks:

This is doable: generate mask conditions inside of the deepest for 
loop (see applied patch).




That will work in the most common cases but not in general. At least 
it is my understanding that Fortran requires that one first evaluates 
the mask expression before one enters the loop. That's made explicit 
for FORALL and DO CONCURRENT uses a forall header and does some refs 
to FORALL (esp. 7.2.4.2.2 and 7.2.4.2.3), but it does not state so 
explicitly.



I missed that, thanks!

I believe that there is no general way to support nested DO CONCURRENT 
loops with mask expressions if they must be collapsed.


I mean if we have example like

outer: DO CONCURRENT (i=1:5, j=1:5, i .ne. j)
  inner: DO CONCURRENT (i=1:5, b(i,j) .eq. 1)
! do something
  ENDDO inner
ENDDO outer

we must generate mask of inner loop inside of outer one. Hence, the loop 
cannot be collapsed.


Is this acceptable?

--
Ilmir.
>From b3a6435a08612951ec8a330877e002a92a9b00f4 Mon Sep 17 00:00:00 2001
From: Ilmir Usmanov 
Date: Tue, 1 Apr 2014 21:02:50 +0400
Subject: [PATCH] Transform OpenACC loop directive to GENERIC

---
	gcc/fortran/
	* openmp.c (resolve_oacc_nested_loops): New check.
	* trans-openmp.c (gfc_trans_oacc_loop_generate_for): New helper function.
	(gfc_trans_oacc_loop): New function.
	(gfc_trans_oacc_combined_directive, gfc_trans_oacc_directive): Call it.
	gcc/
	* omp-low.c (scan_sharing_clauses): Skip OpenACC LOOP clauses.
	gcc/testsuite/
	* gfortran.dg/goacc/loop-3.f95: New check.
	* gfortran.dg/goacc/loop-4.f95: New test.
	* gfortran.dg/goacc/loop-tree.f95: Likewise.
	

diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 447faf8..2be8ba6 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -2573,6 +2573,9 @@ resolve_oacc_nested_loops (gfc_code *code, gfc_code* do_code, int collapse,
 	  break;
 	}
   gcc_assert (do_code->op == EXEC_DO || do_code->op == EXEC_DO_CONCURRENT);
+  if (do_code->op == EXEC_DO_CONCURRENT && do_code->expr1)
+	gfc_error ("OpenACC LOOP directive doesn't support DO CONCURRENT loops "
+		   "with mask expressions at %L", &do_code->loc);
   if (do_code->ext.iterator->var->ts.type != BT_INTEGER)
 	gfc_error ("!$ACC LOOP iteration variable must be of type integer at %L",
 		   &do_code->loc);
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 29364f4..6997625 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -1571,11 +1571,258 @@ typedef struct dovar_init_d {
   tree init;
 } dovar_init;
 
+/* Helper function to generate a single for loop.  */
+static void
+gfc_trans_oacc_loop_generate_for (stmtblock_t *pblock, gfc_se *se, 
+  gfc_expr *var_expr, gfc_expr *start_expr,
+  gfc_expr *end_expr, gfc_expr *step_expr,
+  int i, tree *init, tree *cond, tree *incr,
+  vec* inits)
+{
+  int simple = 0;
+  tree dovar, from, to, step, type, tmp, count = NULL_TREE;
+
+  /* Evaluate all the expressions.  */
+  gfc_init_se (se, NULL);
+  gfc_conv_expr_lhs (se, var_expr);
+  gfc_add_block_to_block (pblock, &se->pre);
+  dovar = se->expr;
+  type = TREE_TYPE (dovar);
+  gcc_assert (TREE_CODE (type) == INTEGER_TYPE);
+
+  gfc_init_se (se, NULL);
+  gfc_conv_expr_val (se, start_expr);
+  gfc_add_block_to_block (pblock, &se->pre);
+  from = gfc_evaluate_now (se->expr, pblock);
+
+  gfc_init_se (se, NULL);
+  gfc_conv_expr_val (se, end_expr);
+  gfc_add_block_to_block (pblock, &se->pre);
+  to = gfc_evaluate_now (se->expr, pblock);
+
+  gfc_init_se (se, NULL);
+  gfc_conv_expr_val (se, step_expr);
+  gfc_add_block_to_block (pblock, &se->pre);
+  step = gfc_evaluate_now (se->expr, pblock);
+
+  /* Special case simple loops.  */
+  if (TREE_CODE (dovar) == VAR_DECL)
+{
+  if (integer_onep (step))
+	simple = 1;
+  else if (tree_int_cst_equal (step, integer_minus_one_node))
+	simple = -1;
+}
+
+  /* Loop body.  */
+  if (simple)
+{
+  TREE_VEC_ELT (*init, i) = build2_v (MODIFY_EXPR, dovar, from);
+  /* The condition should not be folded.  */
+  TREE_VEC_ELT (*cond, i) = build2_loc (input_location, simple > 0
+	? LE_EXPR : GE_EXPR,
+	boolean_type_node, dovar, to);
+  TREE_VEC_ELT (*incr, i) = fold_build2_loc (input_location, PLUS_EXPR,
+		 type, dovar, step);
+  TREE_VEC_ELT (*incr, i) = fold_build2_loc (input_location,
+		 MODIFY_EXPR,
+		 type, dovar,
+		 TREE_VEC_ELT (*incr, i));
+}
+  else
+{
+  /* STEP is not 1 or -1.  Use:
+	 for (count = 0; count < (to + step - from) / step; count++)
+	   {
+	 dovar = from + count * step;
+	 body;
+	   cycle_label:;
+	   }  */
+  tmp = fold_build2_loc (input_location, MINUS_EXPR, type, step, from);
+  tmp = fold_build2_loc (input_location, PLUS_EXPR, type, to, tmp);
+  tmp = fold_build2_loc (input_location, TRUNC_DIV_EXPR, type, tmp,
+			 step);
+  tm

Re: C++ PATCH for c++/60642 (abi_tag and templates)

2014-04-01 Thread Jason Merrill

On 03/31/2014 02:49 PM, Jason Merrill wrote:

This bug report pointed out that we weren't properly decorating template
mangled names with the appropriate abi_tags.  This patch fixes this by
making sure that the mangler only looks at the abi_tag from the
template, and the parser warns that we'll ignore tags on specializations
and instantiations.  This means a change of mangling in abi-tag3.C, but
this is necessary to handle incomplete types properly; we need to be
able to name the type without requiring it to be defined.


After sending this mail it occurred to me that we want to warn about 
trying to attach a tag to an instantiation or specialization, so this 
patch does that, and only looks at the template for ABI tags.


Tested x86_64-pc-linux-gnu, applying to trunk.


commit cd57276dfd0e397ec5d3033ff24ca6c0a6afe8ae
Author: Jason Merrill 
Date:   Wed Mar 26 16:19:32 2014 -0400

	PR c++/60642
	* decl2.c (is_late_template_attribute): Don't defer abi_tag.
	* mangle.c (write_unqualified_name): Fix abi_tag on templates.
	* pt.c (get_template_info): Handle NAMESPACE_DECL.
	(most_general_template): Handle more kinds of template.
	* tree.c (handle_abi_tag_attribute): Ignore abi_tag on template
	instantiations and specializations.

diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index dfc532d..6c52e53 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1169,8 +1169,9 @@ is_late_template_attribute (tree attr, tree decl)
   /* Also defer most attributes on dependent types.  This is not
 	 necessary in all cases, but is the better default.  */
   else if (dependent_type_p (type)
-	   /* But attribute visibility specifically works on
-		  templates.  */
+	   /* But attributes abi_tag and visibility specifically apply
+		  to templates.  */
+	   && !is_attribute_p ("abi_tag", name)
 	   && !is_attribute_p ("visibility", name))
 	return true;
   else
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 251edb1..da82dd6 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -180,7 +180,7 @@ static void write_unscoped_template_name (const tree);
 static void write_nested_name (const tree);
 static void write_prefix (const tree);
 static void write_template_prefix (const tree);
-static void write_unqualified_name (const tree);
+static void write_unqualified_name (tree);
 static void write_conversion_operator_name (const tree);
 static void write_source_name (tree);
 static void write_literal_operator_name (tree);
@@ -1195,7 +1195,7 @@ write_unqualified_id (tree identifier)
 }
 
 static void
-write_unqualified_name (const tree decl)
+write_unqualified_name (tree decl)
 {
   MANGLE_TRACE_TREE ("unqualified-name", decl);
 
@@ -1280,10 +1280,21 @@ write_unqualified_name (const tree decl)
 write_source_name (DECL_NAME (decl));
 }
 
-  tree attrs = (TREE_CODE (decl) == TYPE_DECL
-		? TYPE_ATTRIBUTES (TREE_TYPE (decl))
-		: DECL_ATTRIBUTES (decl));
-  write_abi_tags (lookup_attribute ("abi_tag", attrs));
+  /* We use the ABI tags from the primary template, ignoring tags on any
+ specializations.  This is necessary because C++ doesn't require a
+ specialization to be declared before it is used unless the use
+ requires a complete type, but we need to get the tags right on
+ incomplete types as well.  */
+  if (tree tmpl = most_general_template (decl))
+decl = DECL_TEMPLATE_RESULT (tmpl);
+  /* Don't crash on an unbound class template.  */
+  if (decl)
+{
+  tree attrs = (TREE_CODE (decl) == TYPE_DECL
+		? TYPE_ATTRIBUTES (TREE_TYPE (decl))
+		: DECL_ATTRIBUTES (decl));
+  write_abi_tags (lookup_attribute ("abi_tag", attrs));
+}
 }
 
 /* Write the unqualified-name for a conversion operator to TYPE.  */
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index c791d03..bfb49d7 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -320,6 +320,9 @@ get_template_info (const_tree t)
   if (!t || t == error_mark_node)
 return NULL;
 
+  if (TREE_CODE (t) == NAMESPACE_DECL)
+return NULL;
+
   if (DECL_P (t) && DECL_LANG_SPECIFIC (t))
 tinfo = DECL_TEMPLATE_INFO (t);
 
@@ -18758,23 +18761,18 @@ most_specialized_instantiation (tree templates)
 tree
 most_general_template (tree decl)
 {
-  /* If DECL is a FUNCTION_DECL, find the TEMPLATE_DECL of which it is
- an immediate specialization.  */
-  if (TREE_CODE (decl) == FUNCTION_DECL)
+  if (TREE_CODE (decl) != TEMPLATE_DECL)
 {
-  if (DECL_TEMPLATE_INFO (decl)) {
-	decl = DECL_TI_TEMPLATE (decl);
-
-	/* The DECL_TI_TEMPLATE can be an IDENTIFIER_NODE for a
-	   template friend.  */
-	if (TREE_CODE (decl) != TEMPLATE_DECL)
-	  return NULL_TREE;
-  } else
+  if (tree tinfo = get_template_info (decl))
+	decl = TI_TEMPLATE (tinfo);
+  /* The TI_TEMPLATE can be an IDENTIFIER_NODE for a
+	 template friend, or a FIELD_DECL for a capture pack.  */
+  if (TREE_CODE (decl) != TEMPLATE_DECL)
 	return NULL_TREE;
 }
 
   /* Look for more and more general templates.  */
-  wh

[PATCH] powerpc, document vec_vgbbd

2014-04-01 Thread Michael Meissner
It was pointed out to me that I neglated to document the powerpc ISA 2.07
builtin function vec_vbggd.  After making sure the documentation built, I
checked in the following patch as being obvious:

2014-04-01  Michael Meissner  

* doc/extend.texi (PowerPC AltiVec/VSX Built-in Functions):
Document vec_vgbbd.

Index: gcc/doc/extend.texi
===
--- gcc/doc/extend.texi (revision 208989)
+++ gcc/doc/extend.texi (working copy)
@@ -15099,6 +15099,9 @@ vector unsigned short vec_vclzh (vector 
 vector int vec_vclzw (vector int);
 vector unsigned int vec_vclzw (vector int);
 
+vector signed char vec_vgbbd (vector signed char);
+vector unsigned char vec_vgbbd (vector unsigned char);
+
 vector long long vec_vmaxsd (vector long long, vector long long);
 
 vector unsigned long long vec_vmaxud (vector unsigned long long,

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797



C++ PATCH for c++/60713 (ICE with PMF in init-list)

2014-04-01 Thread Jason Merrill
The gimplifier was getting confused because we didn't set 
TREE_SIDE_EFFECTS on the CONSTRUCTOR.


Tested x86_64-pc-linux-gnu, applying to trunk.
commit 00cbdd8b8a83dd7b8e386fc713bb2b1dab173d81
Author: Jason Merrill 
Date:   Tue Apr 1 14:06:46 2014 -0400

	PR c++/60713
	* typeck2.c (PICFLAG_SIDE_EFFECTS): New.
	(picflag_from_initializer): Return it.
	(process_init_constructor): Handle it.

diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index bd21ad8..68e518a 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1103,6 +1103,7 @@ digest_init_flags (tree type, tree init, int flags)
 #define PICFLAG_ERRONEOUS 1
 #define PICFLAG_NOT_ALL_CONSTANT 2
 #define PICFLAG_NOT_ALL_SIMPLE 4
+#define PICFLAG_SIDE_EFFECTS 8
 
 /* Given an initializer INIT, return the flag (PICFLAG_*) which better
describe it.  */
@@ -1113,7 +1114,12 @@ picflag_from_initializer (tree init)
   if (init == error_mark_node)
 return PICFLAG_ERRONEOUS;
   else if (!TREE_CONSTANT (init))
-return PICFLAG_NOT_ALL_CONSTANT;
+{
+  if (TREE_SIDE_EFFECTS (init))
+	return PICFLAG_SIDE_EFFECTS;
+  else
+	return PICFLAG_NOT_ALL_CONSTANT;
+}
   else if (!initializer_constant_valid_p (init, TREE_TYPE (init)))
 return PICFLAG_NOT_ALL_SIMPLE;
   return 0;
@@ -1493,7 +1499,12 @@ process_init_constructor (tree type, tree init, tsubst_flags_t complain)
   TREE_TYPE (init) = type;
   if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == NULL_TREE)
 cp_complete_array_type (&TREE_TYPE (init), init, /*do_default=*/0);
-  if (flags & PICFLAG_NOT_ALL_CONSTANT)
+  if (flags & PICFLAG_SIDE_EFFECTS)
+{
+  TREE_CONSTANT (init) = false;
+  TREE_SIDE_EFFECTS (init) = true;
+}
+  else if (flags & PICFLAG_NOT_ALL_CONSTANT)
 /* Make sure TREE_CONSTANT isn't set from build_constructor.  */
 TREE_CONSTANT (init) = false;
   else
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist81.C b/gcc/testsuite/g++.dg/cpp0x/initlist81.C
new file mode 100644
index 000..5978c63
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist81.C
@@ -0,0 +1,25 @@
+// PR c++/60713
+// { dg-options "-O" }
+// { dg-do compile { target c++11 } }
+
+template < class x0, class x1, class x2, class x3, class x4 >
+int *x5 (x0 *, x2 (x1::*)(x3, x4));
+
+class x6
+{
+void x7 ();
+struct x8
+{
+int *x9;
+};
+void x10 (x8);
+void x11 (int *, int *);
+};
+
+void
+x6::x7 ()
+{
+x10 ({
+x5 (this, &x6::x11)
+});
+}


C++ PATCH for c++/60708 (ICE with array temporary)

2014-04-01 Thread Jason Merrill
We need to make sure that the type we're converting to has its TYPE_SIZE 
set appropriately.


Tested x86_64-pc-linux-gnu, applying to trunk.
commit 4d056b7b21032f78270f6ae398c15508b5fae8b2
Author: Jason Merrill 
Date:   Tue Apr 1 14:31:35 2014 -0400

	PR c++/60708
	* call.c (build_array_conv): Call complete_type.

diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 877f6d9..ae0d4ff 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -948,6 +948,9 @@ build_array_conv (tree type, tree ctor, int flags, tsubst_flags_t complain)
   bool user = false;
   enum conversion_rank rank = cr_exact;
 
+  /* We might need to propagate the size from the element to the array.  */
+  complete_type (type);
+
   if (TYPE_DOMAIN (type)
   && !variably_modified_type_p (TYPE_DOMAIN (type), NULL_TREE))
 {
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist82.C b/gcc/testsuite/g++.dg/cpp0x/initlist82.C
new file mode 100644
index 000..3b9ccad
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist82.C
@@ -0,0 +1,20 @@
+// PR c++/60708
+// { dg-do compile { target c++11 } }
+
+template  struct mypair {
+  mypair(T, U) {}
+};
+
+template struct S {
+ mypair get_pair() noexcept {
+   return mypair(nullptr, 0);
+ }
+};
+
+static void foo(const mypair (&a)[2]) noexcept { }
+
+int main()
+{
+  S s;
+  foo({s.get_pair(), s.get_pair()});
+}


Re: [PATCH] Fix PR c++/44859

2014-04-01 Thread Jason Merrill

Applied, thanks.

Jason


C++ PATCH for c++/60374 (ICE with missing typename and variadics)

2014-04-01 Thread Jason Merrill
For a normal template argument, we notice missing typename and adjust 
the argument appropriately, but we weren't doing that for a pack 
expansion, leading to confusion later on when we tried to treat a 
SCOPE_REF as a type.  But since the standard requires that any variadic 
template must be well-formed for non-zero pack length, we can go ahead 
and compare the pack expansion pattern to the first template parameter 
to see if they match.


Tested x86_64-pc-linux-gnu, applying to trunk.
commit a6e5d2436bf09049eba9d2f04d12e33621760947
Author: Jason Merrill 
Date:   Tue Apr 1 16:22:01 2014 -0400

	PR c++/60374
	* pt.c (coerce_template_parms): Check that the pack expansion
	pattern works with the first matching parameter.

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index bfb49d7..9de00d5 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6933,6 +6933,26 @@ coerce_template_parms (tree parms,
 	{
   if (PACK_EXPANSION_P (arg))
 {
+	  /* "If every valid specialization of a variadic template
+		 requires an empty template parameter pack, the template is
+		 ill-formed, no diagnostic required."  So check that the
+		 pattern works with this parameter.  */
+	  tree pattern = PACK_EXPANSION_PATTERN (arg);
+	  tree conv = convert_template_argument (TREE_VALUE (parm),
+		 pattern, new_args,
+		 complain, parm_idx,
+		 in_decl);
+	  if (conv == error_mark_node)
+		{
+		  inform (input_location, "so any instantiation with a "
+			 "non-empty parameter pack would be ill-formed");
+		  ++lost;
+		}
+	  else if (TYPE_P (conv) && !TYPE_P (pattern))
+		/* Recover from missing typename.  */
+		TREE_VEC_ELT (inner_args, arg_idx)
+		  = make_pack_expansion (conv);
+
   /* We don't know how many args we have yet, just
  use the unconverted ones for now.  */
   new_inner_args = inner_args;
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic154.C b/gcc/testsuite/g++.dg/cpp0x/variadic154.C
new file mode 100644
index 000..198f9c5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic154.C
@@ -0,0 +1,8 @@
+// PR c++/60374
+// { dg-do compile { target c++11 } }
+
+template struct A {};
+
+template struct A {}; // { dg-error "typename|partial|T" }
+
+A a;
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic155.C b/gcc/testsuite/g++.dg/cpp0x/variadic155.C
new file mode 100644
index 000..d912317
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic155.C
@@ -0,0 +1,4 @@
+// { dg-do compile { target c++11 } }
+
+template  struct A {};
+template  struct B: A {}; // { dg-error "type" }

commit 522f1b1012384a1d96608690fa79079585038e55
Author: Jason Merrill 
Date:   Tue Apr 1 15:31:59 2014 -0400

	* pt.c (process_partial_specialization): Say "not deducible"
	rather than "not used".  Use inform.

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 9de00d5..7f4ef8b 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -4139,15 +4139,17 @@ process_partial_specialization (tree decl)
   for (i = 0; i < ntparms; ++i)
 if (tpd.parms[i] == 0)
   {
-	/* One of the template parms was not used in the
+	/* One of the template parms was not used in a deduced context in the
 	   specialization.  */
 	if (!did_error_intro)
 	  {
-	error ("template parameters not used in partial specialization:");
+	error ("template parameters not deducible in "
+		   "partial specialization:");
 	did_error_intro = true;
 	  }
 
-	error ("%qD", TREE_VALUE (TREE_VEC_ELT (inner_parms, i)));
+	inform (input_location, "%qD",
+		TREE_VALUE (TREE_VEC_ELT (inner_parms, i)));
   }
 
   if (did_error_intro)
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr31439.C b/gcc/testsuite/g++.dg/cpp0x/pr31439.C
index f753735..df50e41 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr31439.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr31439.C
@@ -1,7 +1,7 @@
 // { dg-do compile { target c++11 } }
 template struct A;
 
-template struct A<> {}; // { dg-error "not used in partial specialization|anonymous|declaration" }
+template struct A<> {}; // { dg-error "not deducible|anonymous|declaration" }
 
 template struct A : A {}; // { dg-error "incomplete type" }
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-33964.C b/gcc/testsuite/g++.dg/cpp0x/vt-33964.C
index 9e40737..8cbc0d6 100644
--- a/gcc/testsuite/g++.dg/cpp0x/vt-33964.C
+++ b/gcc/testsuite/g++.dg/cpp0x/vt-33964.C
@@ -6,7 +6,7 @@ struct foo
 };
 
 template
-struct foo< typename Args::is_applied... > // { dg-error "not used|Args" }
+struct foo< typename Args::is_applied... > // { dg-error "not deducible|Args" }
 {
 static bool const value = false;
 };
diff --git a/gcc/testsuite/g++.dg/template/crash97.C b/gcc/testsuite/g++.dg/template/crash97.C
index 3d177f4..7d2161f 100644
--- a/gcc/testsuite/g++.dg/template/crash97.C
+++ b/gcc/testsuite/g++.dg/template/crash97.C
@@ -2,7 +2,7 @@
 
 template struct A {};
 
-template struct A // { dg-error "not used|template\\-parameter" }
+template struct A // { dg-error "not deducible|templa

[patch] Fix broken links in libstdc++ manual

2014-04-01 Thread Jonathan Wakely

Fix some broken links in the libstdc++ docs.

Committed to trunk


commit 201c0a880621618055a572fb1dbb4a7cc39896f4
Author: Jonathan Wakely 
Date:   Tue Apr 1 20:45:54 2014 +0100

* doc/xml/manual/backwards_compatibility.xml (backwards.third.headers):
Update link.
* doc/xml/manual/policy_data_structures_biblio.xml (bibliography):
Fix broken links.
* doc/xml/manual/shared_ptr.xml (shared_ptr.impl): Likewise.
* doc/xml/manual/using_exceptions.xml (bibliography): Likewise.
* doc/xml/manual/concurrency_extensions.xml
(manual.ext.concurrency.impl.atomic_fallbacks): Likewise.
* doc/html/*: Regenerate.

diff --git a/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml 
b/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml
index 3cb7bac..89c7cc6 100644
--- a/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml
+++ b/libstdc++-v3/doc/xml/manual/backwards_compatibility.xml
@@ -614,8 +614,8 @@ libstdc++-v3.

For those of you new to ISO C++ (welcome, time travelers!), no,
   that isn't a typo. Yes, the headers really have new names.
-  Marshall Cline's C++ FAQ Lite has a good explanation in http://www.w3.org/1999/xlink"; 
xlink:href="http://www.parashift.com/c++-faq-lite/coding-standards.html#faq-27.4";>item
-  [27.4].
+  Marshall Cline's C++ FAQ Lite has a good explanation in http://www.w3.org/1999/xlink"; 
xlink:href="http://www.parashift.com/c++-faq-lite/std-headers.html";>What's
+  the difference between  and  headers?.

 
  Some include adjustment may be required. What follows is an
diff --git a/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml 
b/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml
index aef588d..b9bab53 100644
--- a/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml
+++ b/libstdc++-v3/doc/xml/manual/concurrency_extensions.xml
@@ -255,7 +255,7 @@ hardware, hand-crafted assembly is selected. This is the 
case for the following
 And for the rest, a simulated atomic lock via pthreads.
 
 
- Detailed information about compiler intrinsics for atomic operations 
can be found in the GCC http://www.w3.org/1999/xlink"; 
xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html";> 
documentation.
+ Detailed information about compiler intrinsics for atomic operations 
can be found in the GCC http://www.w3.org/1999/xlink"; 
xlink:href="http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html";> 
documentation.
 
 
  More details on the library fallbacks from the porting section.
diff --git a/libstdc++-v3/doc/xml/manual/policy_data_structures_biblio.xml 
b/libstdc++-v3/doc/xml/manual/policy_data_structures_biblio.xml
index 49cacf0..3c4c320 100644
--- a/libstdc++-v3/doc/xml/manual/policy_data_structures_biblio.xml
+++ b/libstdc++-v3/doc/xml/manual/policy_data_structures_biblio.xml
@@ -181,7 +181,7 @@
 
   
http://www.w3.org/1999/xlink";
- xlink:href="www.boost.org/doc/libs/release/libs/timer/">
+ xlink:href="http://www.boost.org/doc/libs/release/libs/timer/";>
  Boost Timer Library

   
@@ -208,7 +208,7 @@
 
   
http://www.w3.org/1999/xlink";
- xlink:href="www.boost.org/doc/libs/release/libs/pool/">
+ xlink:href="http://www.boost.org/doc/libs/release/libs/pool/";>
  Boost Pool Library

   
@@ -236,7 +236,7 @@
 
   
http://www.w3.org/1999/xlink";
- xlink:href="www.boost.org/doc/libs/release/libs/type_traits/">
+ 
xlink:href="http://www.boost.org/doc/libs/release/libs/type_traits/";>
  Boost Type Traits Library

   
diff --git a/libstdc++-v3/doc/xml/manual/shared_ptr.xml 
b/libstdc++-v3/doc/xml/manual/shared_ptr.xml
index a89c972..950e4e0 100644
--- a/libstdc++-v3/doc/xml/manual/shared_ptr.xml
+++ b/libstdc++-v3/doc/xml/manual/shared_ptr.xml
@@ -243,7 +243,7 @@ available policies are:


 Selected when GCC supports a builtin atomic compare-and-swap operation
-on the target processor (see http://www.w3.org/1999/xlink"; 
xlink:href="http://gcc.gnu.org/onlinedocs/gcc/Atomic-Builtins.html";>Atomic
+on the target processor (see http://www.w3.org/1999/xlink"; 
xlink:href="http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html";>Atomic
 Builtins.)  The reference counts are maintained using a lock-free
 algorithm and GCC's atomic builtins, which provide the required memory
 synchronisation.
diff --git a/libstdc++-v3/doc/xml/manual/using_exceptions.xml 
b/libstdc++-v3/doc/xml/manual/using_exceptions.xml
index 5eb0022..698b2fb 100644
--- a/libstdc++-v3/doc/xml/manual/using_exceptions.xml
+++ b/libstdc++-v3/doc/xml/manual/using_exceptions.xml
@@ -480,7 +480,7 @@ is called.
   
   
http://www.w3.org/1999/xlink";
- 
xlink:href="www.open-std.org/jtc1/sc22/wg21/docs/papers/1997/N1077.pdf">
+ 
xlink:href="http://www.open-std.org/jtc1/sc22/

[PATCH] aarch64 suuport for libitm

2014-04-01 Thread Richard Henderson
Comments?  If approved, should this go in for 4.9, or wait for stage1?
Certainly it's self-contained...


r~
* configure.tgt: Handle aarch64 as target.
* config/aarch64/sjlj.S: New file.
* config/aarch64/target.h: New file.


diff --git a/libitm/config/aarch64/sjlj.S b/libitm/config/aarch64/sjlj.S
new file mode 100644
index 000..4a5e758
--- /dev/null
+++ b/libitm/config/aarch64/sjlj.S
@@ -0,0 +1,90 @@
+/* Copyright (C) 2014 Free Software Foundation, Inc.
+   Contributed by Richard Henderson .
+
+   This file is part of the GNU Transactional Memory Library (libitm).
+
+   Libitm 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 of the License, or
+   (at your option) any later version.
+
+   Libitm 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   .  */
+
+#include "asmcfi.h"
+
+   .text
+   .align  2
+   .global _ITM_beginTransaction
+   .type   _ITM_beginTransaction, %function
+
+_ITM_beginTransaction:
+   cfi_startproc
+   mov x1, sp
+   stp x29, x30, [sp, -11*16]!
+   cfi_adjust_cfa_offset(11*16)
+   cfi_rel_offset(x30, 8)
+   stp x19, x20, [sp, 1*16]
+   stp x21, x22, [sp, 2*16]
+   stp x23, x24, [sp, 3*16]
+   stp x25, x26, [sp, 4*16]
+   stp x27, x28, [sp, 5*16]
+   stp d8, d9,   [sp, 6*16]
+   stp d10, d11, [sp, 7*16]
+   stp d12, d13, [sp, 8*16]
+   stp d14, d15, [sp, 9*16]
+   str x1, [sp, 10*16]
+
+   /* Invoke GTM_begin_transaction with the struct we just built.  */
+   mov x1, sp
+   bl  GTM_begin_transaction
+
+   /* Return; we don't need to restore any of the call-saved regs.  */
+   ldr x30, [sp, 8]
+   add sp, sp, #11*16
+   cfi_adjust_cfa_offset(-11*16)
+   cfi_restore(x30)
+   ret
+   cfi_endproc
+   .size   _ITM_beginTransaction, . - _ITM_beginTransaction
+
+   .align  2
+   .global GTM_longjmp
+   .hidden GTM_longjmp
+   .type   GTM_longjmp, %function
+
+GTM_longjmp:
+   /* The first parameter becomes the return value (x0).
+  The third parameter is ignored for now.  */
+   cfi_startproc
+   ldp x19, x20, [x1, 1*16]
+   ldp x21, x22, [x1, 2*16]
+   ldp x23, x24, [x1, 3*16]
+   ldp x25, x26, [x1, 4*16]
+   ldp x27, x28, [x1, 5*16]
+   ldp d8, d9,   [x1, 6*16]
+   ldp d10, d11, [x1, 7*16]
+   ldp d12, d13, [x1, 8*16]
+   ldp d14, d15, [x1, 9*16]
+   ldr x3, [x1, 10*16]
+   ldp x29, x30, [x1]
+   cfi_def_cfa(x1, 0)
+   mov sp, x3
+   br  x30
+   cfi_endproc
+   .size   GTM_longjmp, . - GTM_longjmp
+
+#ifdef __linux__
+.section .note.GNU-stack, "", %progbits
+#endif
diff --git a/libitm/config/aarch64/target.h b/libitm/config/aarch64/target.h
new file mode 100644
index 000..efd26ab
--- /dev/null
+++ b/libitm/config/aarch64/target.h
@@ -0,0 +1,49 @@
+/* Copyright (C) 2014 Free Software Foundation, Inc.
+   Contributed by Richard Henderson .
+
+   This file is part of the GNU Transactional Memory Library (libitm).
+
+   Libitm 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 of the License, or
+   (at your option) any later version.
+
+   Libitm 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.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   .  */
+
+namespace GTM HIDDEN {
+
+typedef struct gtm_jmpbuf
+{
+  unsigned long fp;/* x29 */
+  unsigned long pc;/* x30 

Fix various x86 tests for --with-arch=bdver3 --with-cpu=bdver3

2014-04-01 Thread Joseph S. Myers
When I fixed various tests in
 for failures
with --with-arch=bdver3, I missed that a so-configured compiler still
defaults to -mtune=generic.  If you override that as well with
--with-cpu=bdver3, further failures appear, and this patch fixes some
of them.

Most of these changes add -mno-prefer-avx128 to AVX tests not
expecting a -mprefer-avx128 default.  In addition, some tests have
-mtune=generic added where the behavior tested for depends on some
tuning parameter that I identified: X86_TUNE_EXT_80387_CONSTANTS or
X86_TUNE_SSE_LOAD0_BY_PXOR.

Tested x86_64-linux-gnu.  OK to commit?

There are other failures this patch does not resolve in a
--with-arch=bdver3 --with-cpu=bdver3 configuration.  Some of these are
AVX tests whose failures are not resolved by adding -mno-prefer-avx128
(and so this patch does not add -mno-prefer-avx128 to those tests);
others may be cases where -mtune=generic is appropriate but I haven't
identified the specific tuning parameter that shows code generation
differences depending on tuning are correct and so a -mtune= option
should be used.

FAIL: gcc.target/i386/avx2-vpand-1.c scan-assembler vpand[ \\t]+[^\n]*%ymm[0-9]
FAIL: gcc.target/i386/avx2-vpand-3.c scan-assembler-times vpand[ 
\\t]+[^\n]*%ymm[0-9] 1
FAIL: gcc.target/i386/avx2-vpandn-1.c scan-assembler vpandn[ 
\\t]+[^\n]*%ymm[0-9]
FAIL: gcc.target/i386/avx2-vpor-1.c scan-assembler vpor[ \\t]+[^\n]*%ymm[0-9]
FAIL: gcc.target/i386/avx2-vpxor-1.c scan-assembler vpxor[ \\t]+[^\n]*%ymm[0-9]
FAIL: gcc.target/i386/avx256-unaligned-load-2.c scan-assembler 
(sse2_loaddqu|vmovdqu[^\n\r]*movv16qi_internal)
FAIL: gcc.target/i386/avx256-unaligned-load-2.c scan-assembler vinsert.128
FAIL: gcc.target/i386/avx512f-vec-init.c scan-assembler-times vmovdqa64[ 
\\t]+%zmm 2
FAIL: gcc.target/i386/avx512f-vmovdqu32-1.c scan-assembler-times 
vmovdqu[36][24][ \\t]+[^\n]*\\)[^\n]*%zmm[0-9][^{] 1
FAIL: gcc.target/i386/avx512f-vmovupd-1.c scan-assembler-times vmovupd[ 
\\t]+[^\n]*\\)[^\n]*%zmm[0-9][^{] 1
FAIL: gcc.target/i386/avx512f-vpandd-1.c scan-assembler-times vpandd[ 
\\t]+[^\n]*%zmm[0-9][^{] 4
FAIL: gcc.target/i386/avx512f-vpandd-1.c scan-assembler-times vpandd[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
FAIL: gcc.target/i386/avx512f-vpandd-1.c scan-assembler-times vpandd[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
FAIL: gcc.target/i386/avx512f-vpandnd-1.c scan-assembler-times vpandnd[ 
\\t]+[^\n]*%zmm[0-9][^{] 4
FAIL: gcc.target/i386/avx512f-vpandnd-1.c scan-assembler-times vpandnd[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
FAIL: gcc.target/i386/avx512f-vpandnd-1.c scan-assembler-times vpandnd[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
FAIL: gcc.target/i386/avx512f-vpandnq-1.c scan-assembler-times vpandnq[ 
\\t]+[^\n]*%zmm[0-9][^{] 3
FAIL: gcc.target/i386/avx512f-vpandnq-1.c scan-assembler-times vpandnq[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
FAIL: gcc.target/i386/avx512f-vpandnq-1.c scan-assembler-times vpandnq[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
FAIL: gcc.target/i386/avx512f-vpandq-1.c scan-assembler-times vpandq[ 
\\t]+[^\n]*%zmm[0-9][^{] 3
FAIL: gcc.target/i386/avx512f-vpandq-1.c scan-assembler-times vpandq[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
FAIL: gcc.target/i386/avx512f-vpandq-1.c scan-assembler-times vpandq[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
FAIL: gcc.target/i386/avx512f-vpord-1.c scan-assembler-times vpord[ 
\\t]+[^\n]*%zmm[0-9][^{] 4
FAIL: gcc.target/i386/avx512f-vpord-1.c scan-assembler-times vpord[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
FAIL: gcc.target/i386/avx512f-vpord-1.c scan-assembler-times vpord[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
FAIL: gcc.target/i386/avx512f-vporq-1.c scan-assembler-times vporq[ 
\\t]+[^\n]*%zmm[0-9][^{] 3
FAIL: gcc.target/i386/avx512f-vporq-1.c scan-assembler-times vporq[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
FAIL: gcc.target/i386/avx512f-vporq-1.c scan-assembler-times vporq[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
FAIL: gcc.target/i386/avx512f-vpxord-1.c scan-assembler-times vpxord[ 
\\t]+[^\n]*%zmm[0-9][^{] 4
FAIL: gcc.target/i386/avx512f-vpxord-1.c scan-assembler-times vpxord[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
FAIL: gcc.target/i386/avx512f-vpxord-1.c scan-assembler-times vpxord[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
FAIL: gcc.target/i386/avx512f-vpxorq-1.c scan-assembler-times vpxorq[ 
\\t]+[^\n]*%zmm[0-9][^{] 3
FAIL: gcc.target/i386/avx512f-vpxorq-1.c scan-assembler-times vpxorq[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
FAIL: gcc.target/i386/avx512f-vpxorq-1.c scan-assembler-times vpxorq[ 
\\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
FAIL: gcc.target/i386/pr49002-1.c scan-assembler vmovapd[\t ]*[^,]*,[\t ]*%xmm
FAIL: gcc.target/i386/pr53712.c scan-assembler-times movdqu 1
FAIL: gcc.target/i386/pr53907.c scan-assembler movdqa
FAIL: gcc.target/i386/pr59539-1.c scan-assembler-times vmovdqu 1
FAIL: gcc.target/i386/pr59539-2.c scan-assembler-times vmovdqu 1

2014-04-01  Joseph Myers  

* gcc.target/i386/387-3.c, gcc.target/i386/387-4.c,
gcc.target/i386/pr30970.c: Use -mtune=g

Re: [PATCH] aarch64 suuport for libitm

2014-04-01 Thread Andrew Pinski
On Tue, Apr 1, 2014 at 3:24 PM, Richard Henderson  wrote:
> Comments?  If approved, should this go in for 4.9, or wait for stage1?
> Certainly it's self-contained...

On Cavium's thunder processor the cache line size is going to be
bigger than 64 bytes, what is your solution to improve performance on
target's like Thunder?

Also I think the default page size for most Linux distros is going to
be 64k on aarch64 including Redhat Linux so it makes sense not to
define FIXED_PAGE_SIZE.

I will implement the ILP32 version of this patch once it goes in,
there needs a few changes in gtm_jmpbuf due to long and pointers being
32bit but the assembly storing 64bits always.

Thanks,
Andrew


>
>
> r~


[PATCH] PowerPC, PR60735: _Decimal64 moves broken on -mspe

2014-04-01 Thread Michael Meissner
In backporting the power8 changes to the 4.8 branch, one of the testers of
these patches noticed that libgcc cannot be built on a linux SPE target.  The
reason was the _Decimal64 type did not have a proper move insn in the SPE
environment.  This patch fixes that issue.  In looking at the patch, I
discovered two other thinkos that are fixed in this patch.

The first problem is the movdf/movdd insns for 32-bit without hardware floating
point, checked whether we had hardware single precision support, when it should
have been checking that we had hardware double precision support.

The second problem was that some of the types believed they could use the
floating point registers in a SPE or software emulation enviornment.  So I
added additional code to turn off the use of the FPRs in this case.

I have done bootstraps and make check on 64-bit PowerPC linux systems with no
regression.  In addition, I tested the code generated using cross compilers to
the Linux SPE system.  Is this patch acceptible to be checked in the trunk (and
to the 4.8 branch when the other patches are approved)?

2014-04-01  Michael Meissner  

PR target/60735
* config/rs6000/rs6000.c (rs6000_hard_regno_mode_ok): If we have
software floating point or no floating point registers, do not
allow any type in the FPRs.  Eliminate a test for SPE SIMD types
in GPRs that occurs after we tested for GPRs that would never be
true.

* config/rs6000/rs6000.md (mov_softfloat32, FMOVE64):
Rewrite tests to use TARGET_DOUBLE_FLOAT and TARGET_E500_DOUBLE,
since the FMOVE64 type is DFmode/DDmode.  If TARGET_E500_DOUBLE,
specifically allow DDmode, since that does not use the SPE SIMD
instructions.

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797
Index: gcc/config/rs6000/rs6000.c
===
--- gcc/config/rs6000/rs6000.c  (revision 208989)
+++ gcc/config/rs6000/rs6000.c  (working copy)
@@ -1752,6 +1752,9 @@ rs6000_hard_regno_mode_ok (int regno, en
  modes and DImode.  */
   if (FP_REGNO_P (regno))
 {
+  if (TARGET_SOFT_FLOAT || !TARGET_FPRS)
+   return 0;
+
   if (SCALAR_FLOAT_MODE_P (mode)
  && (mode != TDmode || (regno % 2) == 0)
  && FP_REGNO_P (last_regno))
@@ -1780,10 +1783,6 @@ rs6000_hard_regno_mode_ok (int regno, en
 return (VECTOR_MEM_ALTIVEC_OR_VSX_P (mode)
|| mode == V1TImode);
 
-  /* ...but GPRs can hold SIMD data on the SPE in one register.  */
-  if (SPE_SIMD_REGNO_P (regno) && TARGET_SPE && SPE_VECTOR_MODE (mode))
-return 1;
-
   /* We cannot put non-VSX TImode or PTImode anywhere except general register
  and it must be able to fit within the register set.  */
 
Index: gcc/config/rs6000/rs6000.md
===
--- gcc/config/rs6000/rs6000.md (revision 208989)
+++ gcc/config/rs6000/rs6000.md (working copy)
@@ -9394,8 +9394,9 @@ (define_insn "*mov_softfloat32"
   [(set (match_operand:FMOVE64 0 "nonimmediate_operand" "=Y,r,r,r,r,r")
(match_operand:FMOVE64 1 "input_operand" "r,Y,r,G,H,F"))]
   "! TARGET_POWERPC64 
-   && ((TARGET_FPRS && TARGET_SINGLE_FLOAT) 
-   || TARGET_SOFT_FLOAT || TARGET_E500_SINGLE)
+   && ((TARGET_FPRS && TARGET_DOUBLE_FLOAT) 
+   || TARGET_SOFT_FLOAT
+   || (mode == DDmode && TARGET_E500_DOUBLE))
&& (gpc_reg_operand (operands[0], mode)
|| gpc_reg_operand (operands[1], mode))"
   "#"


Re: [PATCH] Guard special installs in install-driver

2014-04-01 Thread Mike Stump
On Mar 31, 2014, at 4:50 AM, Richard Biener  wrote:
>   -$(INSTALL_PROGRAM) xgcc$(exeext) 
> $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
> ! -rm -f 
> $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext)
> ! -( cd $(DESTDIR)$(bindir) && \
> !$(LN) $(GCC_INSTALL_NAME)$(exeext) 
> $(target_noncanonical)-gcc-$(version)$(exeext) )
> ! -if [ ! -f gcc-cross$(exeext) ] ; then \
> rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
> ( cd $(DESTDIR)$(bindir) && \
>   $(LN) $(GCC_INSTALL_NAME)$(exeext) 
> $(target_noncanonical)-gcc-tmp$(exeext) && \
> --- 3205,3217 
>  install-driver: installdirs xgcc$(exeext)
>   -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
>   -$(INSTALL_PROGRAM) xgcc$(exeext) 
> $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
> ! -if [ "$(GCC_INSTALL_NAME)" != "$(target_noncanonical)-gcc-$(version)" 
> ]; then \
> !   -rm -f 
> $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext) \
> !   -( cd $(DESTDIR)$(bindir) && \
> !  $(LN) $(GCC_INSTALL_NAME)$(exeext) 
> $(target_noncanonical)-gcc-$(version)$(exeext) ) \
> ! fi

Certainly safer for release like this, but, gotta wonder if we can avoid the 
ignoring of errors with the added check…  I’d have to work out why they did 
that in the first place and run a build and play a bit to be as sure as I’d 
like to be…  but, a cross and a native build I think should test it adequately.

Re: [Patch] Silence test failures on darwin9

2014-04-01 Thread Mike Stump
On Mar 26, 2014, at 3:33 PM, Dominique Dhumieres  wrote:
> OK for trunk?

Ok.


Re: PING [Patch] Silence test failures on darwin9

2014-04-01 Thread Mike Stump
On Apr 1, 2014, at 6:38 AM, Dominique Dhumieres  wrote:
> Patch submitted at
> 
> http://gcc.gnu.org/ml/gcc-patches/2014-03/msg01477.html

> OK to backport the suitable patches for pr54083 and
> pr54407 to 4.8 and 4.7 branches?

Sure, as long as you let it bake a little on trunk.  :-).


[PATCH][1/3] Fix PR54733 Optimize endian independent load/store

2014-04-01 Thread Thomas Preud'homme
I took the lack of answer for this patch as an indication that the patch is too
big. This is the first patch in a series of three. Its purpose is to create 
some new
effective target for architecture having byte swap instructions and make use
of them in the existing byte swap tests. One effective target is created for
each size (16, 32 and 64) as not all architectures support byte swap of all
sizes.

Here is the gcc/testsuite/ChangeLog entry:

2014-04-01  Thomas Preud'homme  

* lib/target-supports.exp: New effective targets for architectures
capable of performing byte swap.
* gcc.dg/optimize-bswapdi-1.c: Convert to new bswap target.
* gcc.dg/optimize-bswapdi-2.c: Likewise.
* gcc.dg/optimize-bswapsi-1.c: Likewise.

The patch is attached to this email. Is this ok for stage1?

Best regards,

Thomas

gcc32rm-84.3.part1.diff
Description: Binary data


[PATCH][2/3] Fix PR54733 Optimize endian independent load/store

2014-04-01 Thread Thomas Preud'homme
Here is the second patch in the series. Its purpose is to extend the current 
bswap
optimization to handle bitwise operations on memory sources (array and
structures). This patch extends the concept of symbolic number used in the
bswap pass to memorize some extra informations for bitwise operations on
memory source: base of the access (beginning of the array or structure), offset
to the base and size of the access. All the logic to work on memory source is in
how to merge two symbolic numbers into one according to the offsets of the
two initial symbolic number and the target endianness: the symbolic number
with bigger offset would see its values incremented on a little endian machine.

Note that as it stands the patch does not work for arrays indexed with variable
(such a tab[a] || (tab[a+1] << 8)) because fold_const does not fold (a + 1) - 
a. If it
was found that some software uses that, adding a new folding would make this
code cover more cases. This patch also adds a few testcases to check both (i) 
that
the optimization works as expected and (ii) that the result are correct.

The ChangeLog are as follows:

*** gcc/ChangeLog ***

2014-04-01  Thomas Preud'homme  

PR tree-optimization/54733
* tree-ssa-math-opts.c (find_bswap_1): Add support for memory source.
(find_bswap): Likewise.
(execute_optimize_bswap): Likewise.

*** gcc/testsuite/ChangeLog ***

2014-04-01  Thomas Preud'homme  

PR tree-optimization/54733
* gcc.dg/optimize-bswapdi-3.c: New test to check extension of bswap
optimization to support memory sources.
* gcc.dg/optimize-bswaphi-1.c: Likewise.
* gcc.dg/optimize-bswapsi-2.c: Likewise.
* gcc.c-torture/execute/bswap-2.c: Likewise.

Is this ok for stage 1?

Best regards,

Thomas

gcc32rm-84.3.part2.diff
Description: Binary data


[PATCH][3/3] Fix PR54733 Optimize endian independent load/store

2014-04-01 Thread Thomas Preud'homme
Here is the third and last patch in the series. Its purpose is to add support
for bitwise operation from a source operand that are equivalent to a load
in the target's endianness.

The ChangeLog are as follows:

*** gcc/ChangeLog ***

2014-04-01  Thomas Preud'homme  

PR tree-optimization/54733
* tree-ssa-math-opts.c (find_bswap_1): Renamed to ...
(find_bswap_or_nop_1): This.
(find_bswap): Renamed to ...
(find_bswap_or_nop): This. Also add detection of bitwise operations
equivalent to load in host endianness.
(execute_optimize_bswap): Likewise.

*** gcc/testsuite/ChangeLog ***

2014-04-01  Thomas Preud'homme  

PR tree-optimization/54733
* gcc.dg/optimize-bswapdi-3.c: Extend test to check detection of
bitwise operation equivalent to load in host endianness.
* gcc.dg/optimize-bswaphi-1.c: Likewise.
* gcc.dg/optimize-bswapsi-2.c: Likewise.

Is this ok for stage 1?

Best regards,

Thomas

gcc32rm-84.3.part3.diff
Description: Binary data


Re: [PATCH] PowerPC, PR60735: _Decimal64 moves broken on -mspe

2014-04-01 Thread David Edelsohn
On Tue, Apr 1, 2014 at 7:55 PM, Michael Meissner
 wrote:
> In backporting the power8 changes to the 4.8 branch, one of the testers of
> these patches noticed that libgcc cannot be built on a linux SPE target.  The
> reason was the _Decimal64 type did not have a proper move insn in the SPE
> environment.  This patch fixes that issue.  In looking at the patch, I
> discovered two other thinkos that are fixed in this patch.
>
> The first problem is the movdf/movdd insns for 32-bit without hardware 
> floating
> point, checked whether we had hardware single precision support, when it 
> should
> have been checking that we had hardware double precision support.
>
> The second problem was that some of the types believed they could use the
> floating point registers in a SPE or software emulation enviornment.  So I
> added additional code to turn off the use of the FPRs in this case.
>
> I have done bootstraps and make check on 64-bit PowerPC linux systems with no
> regression.  In addition, I tested the code generated using cross compilers to
> the Linux SPE system.  Is this patch acceptible to be checked in the trunk 
> (and
> to the 4.8 branch when the other patches are approved)?
>
> 2014-04-01  Michael Meissner  
>
> PR target/60735
> * config/rs6000/rs6000.c (rs6000_hard_regno_mode_ok): If we have
> software floating point or no floating point registers, do not
> allow any type in the FPRs.  Eliminate a test for SPE SIMD types
> in GPRs that occurs after we tested for GPRs that would never be
> true.
>
> * config/rs6000/rs6000.md (mov_softfloat32, FMOVE64):
> Rewrite tests to use TARGET_DOUBLE_FLOAT and TARGET_E500_DOUBLE,
> since the FMOVE64 type is DFmode/DDmode.  If TARGET_E500_DOUBLE,
> specifically allow DDmode, since that does not use the SPE SIMD
> instructions.

Okay for trunk and the 4.8 backport.

Thanks, David


Re: [PATCH][2/3] Fix PR54733 Optimize endian independent load/store

2014-04-01 Thread Marc Glisse

On Wed, 2 Apr 2014, Thomas Preud'homme wrote:

Note that as it stands the patch does not work for arrays indexed with 
variable (such a tab[a] || (tab[a+1] << 8)) because fold_const does not 
fold (a + 1) - a.


Uh? It does fold a+1-a for me. What it doesn't do is look through the 
definition of b in b-a. Richard+GSoC will supposedly soon provide a 
function that does that.


--
Marc Glisse


Re: Fix various x86 tests for --with-arch=bdver3 --with-cpu=bdver3

2014-04-01 Thread Uros Bizjak
On Wed, Apr 2, 2014 at 12:27 AM, Joseph S. Myers
 wrote:
> When I fixed various tests in
>  for failures
> with --with-arch=bdver3, I missed that a so-configured compiler still
> defaults to -mtune=generic.  If you override that as well with
> --with-cpu=bdver3, further failures appear, and this patch fixes some
> of them.
>
> Most of these changes add -mno-prefer-avx128 to AVX tests not
> expecting a -mprefer-avx128 default.  In addition, some tests have
> -mtune=generic added where the behavior tested for depends on some
> tuning parameter that I identified: X86_TUNE_EXT_80387_CONSTANTS or
> X86_TUNE_SSE_LOAD0_BY_PXOR.
>
> Tested x86_64-linux-gnu.  OK to commit?
>
> There are other failures this patch does not resolve in a
> --with-arch=bdver3 --with-cpu=bdver3 configuration.  Some of these are
> AVX tests whose failures are not resolved by adding -mno-prefer-avx128
> (and so this patch does not add -mno-prefer-avx128 to those tests);
> others may be cases where -mtune=generic is appropriate but I haven't
> identified the specific tuning parameter that shows code generation
> differences depending on tuning are correct and so a -mtune= option
> should be used.
>
> FAIL: gcc.target/i386/avx2-vpand-1.c scan-assembler vpand[ 
> \\t]+[^\n]*%ymm[0-9]
> FAIL: gcc.target/i386/avx2-vpand-3.c scan-assembler-times vpand[ 
> \\t]+[^\n]*%ymm[0-9] 1
> FAIL: gcc.target/i386/avx2-vpandn-1.c scan-assembler vpandn[ 
> \\t]+[^\n]*%ymm[0-9]
> FAIL: gcc.target/i386/avx2-vpor-1.c scan-assembler vpor[ \\t]+[^\n]*%ymm[0-9]
> FAIL: gcc.target/i386/avx2-vpxor-1.c scan-assembler vpxor[ 
> \\t]+[^\n]*%ymm[0-9]
> FAIL: gcc.target/i386/avx256-unaligned-load-2.c scan-assembler 
> (sse2_loaddqu|vmovdqu[^\n\r]*movv16qi_internal)
> FAIL: gcc.target/i386/avx256-unaligned-load-2.c scan-assembler vinsert.128
> FAIL: gcc.target/i386/avx512f-vec-init.c scan-assembler-times vmovdqa64[ 
> \\t]+%zmm 2
> FAIL: gcc.target/i386/avx512f-vmovdqu32-1.c scan-assembler-times 
> vmovdqu[36][24][ \\t]+[^\n]*\\)[^\n]*%zmm[0-9][^{] 1
> FAIL: gcc.target/i386/avx512f-vmovupd-1.c scan-assembler-times vmovupd[ 
> \\t]+[^\n]*\\)[^\n]*%zmm[0-9][^{] 1
> FAIL: gcc.target/i386/avx512f-vpandd-1.c scan-assembler-times vpandd[ 
> \\t]+[^\n]*%zmm[0-9][^{] 4
> FAIL: gcc.target/i386/avx512f-vpandd-1.c scan-assembler-times vpandd[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
> FAIL: gcc.target/i386/avx512f-vpandd-1.c scan-assembler-times vpandd[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
> FAIL: gcc.target/i386/avx512f-vpandnd-1.c scan-assembler-times vpandnd[ 
> \\t]+[^\n]*%zmm[0-9][^{] 4
> FAIL: gcc.target/i386/avx512f-vpandnd-1.c scan-assembler-times vpandnd[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
> FAIL: gcc.target/i386/avx512f-vpandnd-1.c scan-assembler-times vpandnd[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
> FAIL: gcc.target/i386/avx512f-vpandnq-1.c scan-assembler-times vpandnq[ 
> \\t]+[^\n]*%zmm[0-9][^{] 3
> FAIL: gcc.target/i386/avx512f-vpandnq-1.c scan-assembler-times vpandnq[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
> FAIL: gcc.target/i386/avx512f-vpandnq-1.c scan-assembler-times vpandnq[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
> FAIL: gcc.target/i386/avx512f-vpandq-1.c scan-assembler-times vpandq[ 
> \\t]+[^\n]*%zmm[0-9][^{] 3
> FAIL: gcc.target/i386/avx512f-vpandq-1.c scan-assembler-times vpandq[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
> FAIL: gcc.target/i386/avx512f-vpandq-1.c scan-assembler-times vpandq[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
> FAIL: gcc.target/i386/avx512f-vpord-1.c scan-assembler-times vpord[ 
> \\t]+[^\n]*%zmm[0-9][^{] 4
> FAIL: gcc.target/i386/avx512f-vpord-1.c scan-assembler-times vpord[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
> FAIL: gcc.target/i386/avx512f-vpord-1.c scan-assembler-times vpord[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
> FAIL: gcc.target/i386/avx512f-vporq-1.c scan-assembler-times vporq[ 
> \\t]+[^\n]*%zmm[0-9][^{] 3
> FAIL: gcc.target/i386/avx512f-vporq-1.c scan-assembler-times vporq[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
> FAIL: gcc.target/i386/avx512f-vporq-1.c scan-assembler-times vporq[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
> FAIL: gcc.target/i386/avx512f-vpxord-1.c scan-assembler-times vpxord[ 
> \\t]+[^\n]*%zmm[0-9][^{] 4
> FAIL: gcc.target/i386/avx512f-vpxord-1.c scan-assembler-times vpxord[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
> FAIL: gcc.target/i386/avx512f-vpxord-1.c scan-assembler-times vpxord[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
> FAIL: gcc.target/i386/avx512f-vpxorq-1.c scan-assembler-times vpxorq[ 
> \\t]+[^\n]*%zmm[0-9][^{] 3
> FAIL: gcc.target/i386/avx512f-vpxorq-1.c scan-assembler-times vpxorq[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}[^{] 1
> FAIL: gcc.target/i386/avx512f-vpxorq-1.c scan-assembler-times vpxorq[ 
> \\t]+[^\n]*%zmm[0-9]{%k[1-7]}{z} 1
> FAIL: gcc.target/i386/pr49002-1.c scan-assembler vmovapd[\t ]*[^,]*,[\t ]*%xmm
> FAIL: gcc.target/i386/pr53712.c scan-assembler-times movdqu 1
> FAIL: gcc.target/i386/pr53907.c scan-assembler movdqa
> FAIL: gcc.target/i386/p