Re: [libjava] XFAIL sourcelocation (PR libgcj/55637)

2014-03-30 Thread Dominique Dhumieres
> The libjava sourcelocation output test has been FAILing on mainline for
> more than a year, with no sign of anything happening to resolve that.
> To reduce testsuite noise, I suggest to XFAIL the test.  ...

Would it be possible to backport the fix to 4.8?

TIA,

Dominique


std::experimental::optional operator!=

2014-03-30 Thread Lars Gullik Bjønnes
--- Begin Message ---

Hi,

When trying to convert some code using boost::optional to using
std::experimental::optional instead if come over the issue that I had to
implement operator!= for the contained types.

When looking at n3793 it states that operator!= should be implemented
with !(t1 == t2), and not t1 != t2 as the implementation in gcc 4.9 is
doing. This is the case for both the operator!= implementation where
optional is compared against T.

The other operators look ok, and only operator== and operator< are used
in their implementations.

Can this be fixed before 4.9?

(changelog not done)
>From 6a93dcb458f055d94d13386ef68a39893327be84 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= 
Date: Sat, 29 Mar 2014 15:46:47 +0100
Subject: [PATCH] optional: implement operator!= in terms of operator==

---
 libstdc++-v3/include/experimental/optional | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/experimental/optional b/libstdc++-v3/include/experimental/optional
index 5f2d93f..2a3f29d 100644
--- a/libstdc++-v3/include/experimental/optional
+++ b/libstdc++-v3/include/experimental/optional
@@ -736,12 +736,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template
 constexpr bool
 operator!=(const optional<_Tp>& __lhs, _Tp const& __rhs)
-{ return !__lhs || *__lhs != __rhs; }
+{ return !__lhs || !(*__lhs == __rhs); }
 
   template
 constexpr bool
 operator!=(const _Tp& __lhs, const optional<_Tp>& __rhs)
-{ return !__rhs || __lhs != *__rhs; }
+{ return !__rhs || !(__lhs == *__rhs); }
 
   template
 constexpr bool
-- 
1.9.1.352.gd393d14


-- 
Lgb
___
help-gplusplus mailing list
help-gplusp...@gnu.org
https://lists.gnu.org/mailman/listinfo/help-gplusplus
--- End Message ---


-- 
Lgb


[Ada] Fix PR ada/60703

2014-03-30 Thread Eric Botcazou
Self-explanatory.  Applied on all active branches.


2014-03-30  Eric Botcazou  

PR ada/60703
* system-linux-alpha.ads: Adjust for Ada 2005.
* system-linux-mips.ads: Likewise.
* system-linux-mips64el.ads: Likewise.
* system-linux-mipsel.ads: Likewise.
* system-linux-s390.ads: Likewise.
* system-linux-s390x.ads: Likewise.
* system-linux-sparc.ads: Likewise.
* system-linux-sparcv9.ads: Likewise.
* system-rtems.ads: Likewise.
* system-vxworks-arm.ads: Likewise.


-- 
Eric BotcazouIndex: system-linux-s390x.ads
===
--- system-linux-s390x.ads	(revision 208931)
+++ system-linux-s390x.ads	(working copy)
@@ -7,7 +7,7 @@
 -- S p e c  --
 --  (GNU-Linux/s390x Version)   --
 --  --
---  Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+--  Copyright (C) 1992-2014, Free Software Foundation, Inc. --
 --  --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -35,9 +35,10 @@
 --
 
 package System is
-pragma Pure (System);
---  Note that we take advantage of the implementation permission to
---  make this unit Pure instead of Preelaborable, see RM 13.7(36)
+   pragma Pure;
+   --  Note that we take advantage of the implementation permission to make
+   --  this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
+   --  2005, this is Pure in any case (AI-362).
 
type Name is (SYSTEM_NAME_GNAT);
System_Name : constant Name := SYSTEM_NAME_GNAT;
@@ -61,6 +62,7 @@ pragma Pure (System);
--  Storage-related Declarations
 
type Address is private;
+   pragma Preelaborable_Initialization (Address);
Null_Address : constant Address;
 
Storage_Unit : constant := 8;
Index: system-linux-alpha.ads
===
--- system-linux-alpha.ads	(revision 208931)
+++ system-linux-alpha.ads	(working copy)
@@ -7,7 +7,7 @@
 -- S p e c  --
 --(GNU-Linux/alpha Version) --
 --  --
---  Copyright (C) 1992-2012, Free Software Foundation, Inc. --
+--  Copyright (C) 1992-2014, Free Software Foundation, Inc. --
 --  --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -35,9 +35,10 @@
 --
 
 package System is
-pragma Pure (System);
---  Note that we take advantage of the implementation permission to
---  make this unit Pure instead of Preelaborable, see RM 13.7(36)
+   pragma Pure;
+   --  Note that we take advantage of the implementation permission to make
+   --  this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
+   --  2005, this is Pure in any case (AI-362).
 
type Name is (SYSTEM_NAME_GNAT);
System_Name : constant Name := SYSTEM_NAME_GNAT;
@@ -61,6 +62,7 @@ pragma Pure (System);
--  Storage-related Declarations
 
type Address is private;
+   pragma Preelaborable_Initialization (Address);
Null_Address : constant Address;
 
Storage_Unit : constant := 8;
Index: system-vxworks-arm.ads
===
--- system-vxworks-arm.ads	(revision 208931)
+++ system-vxworks-arm.ads	(working copy)
@@ -7,7 +7,7 @@
 -- S p e c  --
 --  (VxWorks Version ARM)   --
 --  --
---  Copyright (C) 1992-2013, Free Software Foundation, Inc. --
+--  Copyright (C) 1992-2014, Free Software Foundation, Inc. --
 --  --
 -- This specification is derived from the Ada Reference Manual for use with --
 -- GNAT. The copyright notice above, and the license provisions that follow --
@@ -35,10 +35,10 @@
 --
 
 package System is
-pragma Pure (System);
---  Note that we take advantage of the implementation permission to make this
---  unit Pure instead of Preelaborable;

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

2014-03-30 Thread Uros Bizjak
On Fri, Mar 28, 2014 at 10:46 PM, Joseph S. Myers
 wrote:

> In addition to the failures fixed by this patch, there are many
> gcc.dg/vect tests where having additional vector extensions enabled
> breaks their expectations; I'm not sure of the best way to handle
> those.  And you get
>
> FAIL: gcc.target/i386/avx512f-vfmaddXXXpd-2.c (test for excess errors)
> FAIL: gcc.target/i386/avx512f-vfmaddXXXps-2.c (test for excess errors)
> FAIL: gcc.target/i386/avx512f-vfmaddsubXXXpd-2.c (test for excess errors)
> FAIL: gcc.target/i386/avx512f-vfmaddsubXXXps-2.c (test for excess errors)
> FAIL: gcc.target/i386/avx512f-vfmsubXXXpd-2.c (test for excess errors)
> FAIL: gcc.target/i386/avx512f-vfmsubXXXps-2.c (test for excess errors)
> FAIL: gcc.target/i386/avx512f-vfmsubaddXXXpd-2.c (test for excess errors)
> FAIL: gcc.target/i386/avx512f-vfmsubaddXXXps-2.c (test for excess errors)
> FAIL: gcc.target/i386/avx512f-vfnmaddXXXpd-2.c (test for excess errors)
> FAIL: gcc.target/i386/avx512f-vfnmaddXXXps-2.c (test for excess errors)
> FAIL: gcc.target/i386/avx512f-vfnmsubXXXpd-2.c (test for excess errors)
> FAIL: gcc.target/i386/avx512f-vfnmsubXXXps-2.c (test for excess errors)
>
> which are assembler errors such as "operand type mismatch for
> `vfmaddpd'" - it looks like the compiler isn't really prepared for the
> -mavx512f -mfma4 combination, but I'm not sure what the best way to
> handle it is (producing invalid output doesn't seem right, however).

Attached patch splits AVX512F modes out of existing FMA patterns.
These modes are not supported by patterns that also support FMA4
insns.

2014-03-30  Uros Bizjak  

* config/i386/sse.md (FMAMODE_NOVF512): New mode iterator.
(fma_fmadd_):
Split out
fma_fmadd_.
Use FMAMODE_NOVF512 mode iterator.
(fma_fmsub_): Ditto.
(fma_fnmadd_): Ditto.
(fma_fnmsub_): Ditto.
(fma_fmaddsub_):
Split out
fma_fmaddsub_.
Use VF_128_256 mode iterator.
(fma_fmsubadd_):
Ditto.

Bootstrapped and regression tested on x86_64-pc-linux-gnu {,-m32}. I
have also eyeballed the asm - no FMA4 insn was emitted for AVX512F
modes.

Committed to mainline SVN.

Uros.
Index: config/i386/sse.md
===
--- config/i386/sse.md  (revision 208944)
+++ config/i386/sse.md  (working copy)
@@ -2712,8 +2712,7 @@
(fma:FMAMODEM
  (match_operand:FMAMODEM 1 "nonimmediate_operand")
  (match_operand:FMAMODEM 2 "nonimmediate_operand")
- (match_operand:FMAMODEM 3 "nonimmediate_operand")))]
-  "")
+ (match_operand:FMAMODEM 3 "nonimmediate_operand")))])
 
 (define_expand "fms4"
   [(set (match_operand:FMAMODEM 0 "register_operand")
@@ -2720,8 +2719,7 @@
(fma:FMAMODEM
  (match_operand:FMAMODEM 1 "nonimmediate_operand")
  (match_operand:FMAMODEM 2 "nonimmediate_operand")
- (neg:FMAMODEM (match_operand:FMAMODEM 3 "nonimmediate_operand"]
-  "")
+ (neg:FMAMODEM (match_operand:FMAMODEM 3 "nonimmediate_operand"])
 
 (define_expand "fnma4"
   [(set (match_operand:FMAMODEM 0 "register_operand")
@@ -2728,8 +2726,7 @@
(fma:FMAMODEM
  (neg:FMAMODEM (match_operand:FMAMODEM 1 "nonimmediate_operand"))
  (match_operand:FMAMODEM 2 "nonimmediate_operand")
- (match_operand:FMAMODEM 3 "nonimmediate_operand")))]
-  "")
+ (match_operand:FMAMODEM 3 "nonimmediate_operand")))])
 
 (define_expand "fnms4"
   [(set (match_operand:FMAMODEM 0 "register_operand")
@@ -2736,18 +2733,18 @@
(fma:FMAMODEM
  (neg:FMAMODEM (match_operand:FMAMODEM 1 "nonimmediate_operand"))
  (match_operand:FMAMODEM 2 "nonimmediate_operand")
- (neg:FMAMODEM (match_operand:FMAMODEM 3 "nonimmediate_operand"]
-  "")
+ (neg:FMAMODEM (match_operand:FMAMODEM 3 "nonimmediate_operand"])
 
 ;; The builtins for intrinsics are not constrained by SSE math enabled.
-(define_mode_iterator FMAMODE [(SF "TARGET_FMA || TARGET_FMA4 || 
TARGET_AVX512F")
-  (DF "TARGET_FMA || TARGET_FMA4 || 
TARGET_AVX512F")
-  (V4SF "TARGET_FMA || TARGET_FMA4")
-  (V2DF "TARGET_FMA || TARGET_FMA4")
-  (V8SF "TARGET_FMA || TARGET_FMA4")
-  (V4DF "TARGET_FMA || TARGET_FMA4")
-  (V16SF "TARGET_AVX512F")
-  (V8DF "TARGET_AVX512F")])
+(define_mode_iterator FMAMODE
+  [(SF "TARGET_FMA || TARGET_FMA4 || TARGET_AVX512F")
+   (DF "TARGET_FMA || TARGET_FMA4 || TARGET_AVX512F")
+   (V4SF "TARGET_FMA || TARGET_FMA4")
+   (V2DF "TARGET_FMA || TARGET_FMA4")
+   (V8SF "TARGET_FMA || TARGET_FMA4")
+   (V4DF "TARGET_FMA || TARGET_FMA4")
+   (V16SF "TARGET_AVX512F")
+   (V8DF "TARGET_AVX512F")])
 
 (define_expand "fma4i_fmadd_"
   [(set (match_operand:FMAMODE 0 "register_operand")
@@ -2754,8 +2751,7 @@
(fma:FMAMODE
  (match_operand:FMAMODE 1 "nonim

New Swedish PO file for 'gcc' (version 4.9-b20140202)

2014-03-30 Thread Translation Project Robot
Hello, gentle maintainer.

This is a message from the Translation Project robot.

A revised PO file for textual domain 'gcc' has been submitted
by the Swedish team of translators.  The file is available at:

http://translationproject.org/latest/gcc/sv.po

(This file, 'gcc-4.9-b20140202.sv.po', has just now been sent to you in
a separate email.)

All other PO files for your package are available in:

http://translationproject.org/latest/gcc/

Please consider including all of these in your next release, whether
official or a pretest.

Whenever you have a new distribution with a new version number ready,
containing a newer POT file, please send the URL of that distribution
tarball to the address below.  The tarball may be just a pretest or a
snapshot, it does not even have to compile.  It is just used by the
translators when they need some extra translation context.

The following HTML page has been updated:

http://translationproject.org/domain/gcc.html

If any question arises, please contact the translation coordinator.

Thank you for all your work,

The Translation Project robot, in the
name of your translation coordinator.




Re: [C PATCH] Warn if inline attributes conflict (PR c/18079)

2014-03-30 Thread Richard Sandiford
Marek Polacek  writes:
> @@ -,7 +,16 @@ handle_noinline_attribute (tree *node, tree name,
>  int ARG_UNUSED (flags), bool *no_add_attrs)
>  {
>if (TREE_CODE (*node) == FUNCTION_DECL)
> -DECL_UNINLINABLE (*node) = 1;
> +{
> +  if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (*node)))
> + {
> +   warning (OPT_Wattributes, "%qE attribute ignored due to conflict "
> +"with % attribute", name);
> +   *no_add_attrs = true;
> + }
> +  else
> + DECL_UNINLINABLE (*node) = 1;
> +}
>else
>  {
>warning (OPT_Wattributes, "%qE attribute ignored", name);
> @@ -6704,9 +6713,16 @@ handle_always_inline_attribute (tree *node, tree name,
>  {
>if (TREE_CODE (*node) == FUNCTION_DECL)
>  {
> -  /* Set the attribute and mark it for disregarding inline
> -  limits.  */
> -  DECL_DISREGARD_INLINE_LIMITS (*node) = 1;
> +  if (lookup_attribute ("noinline", DECL_ATTRIBUTES (*node)))
> + {
> +   warning (OPT_Wattributes, "%qE attribute ignored due to conflict "
> +"with % attribute", name);

Sorry for the nit, but maybe it'd be better to use %qs for the second
attributes, so that we can use the same translation string for all conflicts.
Same with the later messages (where the quotes that come with %qs are
probably needed too).

Thanks,
Richard


Re: [PATH, SH] Small builtin_strlen improvement

2014-03-30 Thread Oleg Endo
Hi,

On Wed, 2014-03-26 at 08:58 +0100, Christian Bruel wrote:

> This patches adds a few instructions to the inlined builtin_strlen to
> unroll the remaining bytes for word-at-a-time loop. This enables to have
> 2 distinct execution paths (no fall-thru in the byte-at-a-time loop),
> allowing block alignment assignation. This partially improves the
> problem reported with by Oleg. in [Bug target/0539] New: [SH] builtin
> string functions ignore loop and label alignment

Actually, my original concern was the (mis)alignment of the 4 byte inner
loop.  AFAIR it's better for the SH pipeline if the first insn of a loop
is 4 byte aligned.

> 
> whereas the test now expands (-O2 -m4) as
> mov r4,r0
> tst #3,r0
> mov r4,r2
> bf/s.L12
> mov r4,r3
> mov #0,r2
> .L4:
> mov.l   @r4+,r1
> cmp/str r2,r1
> bf  .L4
> add #-4,r4
> mov.b   @r4,r1
> tst r1,r1
> bt  .L2
> add #1,r4
> mov.b   @r4,r1
> tst r1,r1
> bt  .L2
> add #1,r4
> mov.b   @r4,r1
> tst r1,r1
> mov #-1,r1
> negcr1,r1
> add r1,r4
> .L2:
> mov r4,r0
> rts
> sub r3,r0
> .align 1
> .L12:
> mov.b   @r4+,r1
> tst r1,r1
> bf/s.L12
> mov r2,r3
> add #1,r3
> mov r4,r0
> rts
> sub r3,r0
> 
> 
> Best tuning compared to the "compact" version I got on is ~1% for c++
> regular expression benchmark, but well, code looks best this way.

I haven't done any measurements but doesn't this introduce some
performance regressions here and there due to the increased code size?
Maybe the byte unrolling should not be done at -O2 but at -O3?

Moreover, post-inc addressing on the bytes could be used.  Ideally we'd
get something like this:

mov r4,r0
tst #3,r0
bf/s.L12
mov r4,r3
mov #0,r2
.L4:
mov.l   @r4+,r1
cmp/str r2,r1
bf  .L4

add #-4,r4

mov.b   @r4+,r1
tst r1,r1
bt  .L2

mov.b   @r4+,r1
tst r1,r1
bt  .L2

mov.b   @r4+,r1
tst r1,r1
mov #-1,r1
subcr1,r4
sett
.L2:
mov r4,r0
rts
subcr3,r0
.align 1
.L12:
mov.b   @r4+,r1
tst r1,r1
bf .L12

mov r4,r0
rts
subcr3,r0


I'll have a look at the missed 'subc' cases.

Cheers,
Oleg



Re: [libjava] XFAIL sourcelocation (PR libgcj/55637)

2014-03-30 Thread Rainer Orth
domi...@lps.ens.fr (Dominique Dhumieres) writes:

>> The libjava sourcelocation output test has been FAILing on mainline for
>> more than a year, with no sign of anything happening to resolve that.
>> To reduce testsuite noise, I suggest to XFAIL the test.  ...
>
> Would it be possible to backport the fix to 4.8?

Sure, patch preapproved.

Rainer

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


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

2014-03-30 Thread Jan Hubicka
> 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.
> 
> testsuite/
>   * g++.dg/ipa/pr60640-1.C: New test.
>   * g++.dg/ipa/pr60640-2.C: Likewise.
> 
> Index: src/gcc/cgraph.h
> ===
> --- src.orig/gcc/cgraph.h
> +++ src/gcc/cgraph.h
> @@ -890,7 +890,7 @@ struct cgraph_edge * cgraph_clone_edge (
>   unsigned, gcov_type, int, bool);
>  struct cgraph_node * cgraph_clone_node (struct cgraph_node *, tree, 
> gcov_type,
>   int, bool, vec,
> - bool, struct cgraph_node *);
> + bool, struct cgraph_node *, bitmap);
>  tree clone_function_name (tree decl, const char *);
>  struct cgraph_node * cgraph_create_virtual_clone (struct cgraph_node 
> *old_node,
> vec,
> Index: src/gcc/cgraphclones.c
> ===
> --- src.orig/gcc/cgraphclones.c
> +++ src/gcc/cgraphclones.c
> @@ -168,6 +168,183 @@ cgraph_clone_edge (struct cgraph_edge *e
>return new_edge;
>  }
>  
> +/* Build variant of function type ORIG_TYPE skipping ARGS_TO_SKIP and the
> +   return value if SKIP_RETURN is true.  */
> +
> +static tree
> +build_function_type_skip_args (tree orig_type, bitmap args_to_skip,
> +bool skip_return)
> +{
> +  tree new_type = NULL;
> +  tree args, new_args = NULL, t;
> +  tree new_reversed;
> +  int i = 0;
> +
> +  for (args = TYPE_ARG_TYPES (orig_type); args && args != void_list_node;
> +   args = TREE_CHAIN (args), i++)
> +if (!args_to_skip || !bitmap_bit_p (args_to_skip, i))
> +  new_args = tree_cons (NULL_TREE, TREE_VALUE (args), new_args);
> +
> +  new_reversed = nreverse (new_args);
> +  if (args)
> +{
> +  if (new_reversed)
> +TREE_CHAIN (new_args) = void_list_node;
> +  else
> + new_reversed = void_list_node;
> +}
> +
> +  /* Use copy_node to preserve as much as possible from original type
> + (debug info, attribute lists etc.)
> + Exception is METHOD_TYPEs must have THIS argument.
> + When we are asked to remove it, we need to build new FUNCTION_TYPE
> + instead.  */
> +  if (TREE_CODE (orig_type) != METHOD_TYPE
> +  || !args_to_skip
> +  || !bitmap_bit_p (args_to_skip, 0))
> +{
> +  new_type = build_distinct_type_copy (orig_type);
> +  TYPE_ARG_TYPES (new_type) = new_reversed;
> +}
> +  else
> +{
> +  new_type
> += build_distinct_type_copy (build_function_type (TREE_TYPE 
> (orig_type),
> +  new_reversed));
> +  TYPE_CONTEXT (new_type) = TYPE_CONTEXT (orig_type);
> +}
> +
> +  if (skip_return)
> +TREE_TYPE (new_type) = void_type_node;
> +
> +  /* This is a new type, not a copy of an old type.  Need to reassociate
> + variants.  We can handle everything except the main variant lazily.  */
> +  t = TYPE_MAIN_VARIANT (orig_type);
> +  if (t != orig_type)
> +{
> +  t = build_function_type_skip_args (t, args_to_skip, skip_return);
> +  TYPE_MAIN_VARIANT (new_type) = t;
> +  TYPE_NEXT_VARIANT (new_type) = TYPE_NEXT_VARIANT (t);
> +  TYPE_NEXT_VARIANT (t) = new_type;
> +}
> +  else
> +{
> +  TYPE_MAIN_VARIANT (new_type) = new_type;
> +  TYPE_NEXT_VARIANT (new_type) = NULL;
> +}
> +
> +  return new_type;
> +}
> +
> +/* Build variant of function decl ORIG_DECL skipping ARGS_TO_SKIP and the
> +   return value if SKIP_RETURN is true.
> +
> +   Arguments from DECL_ARGUMENTS list can't be removed now, since they are
> +   linked by TREE_CHAIN directly.  The caller is responsible for eliminating
> +   them when they are being duplicated (i.e. copy_arguments_for_versioning). 
>  */
> +
> +static tree
> +build_function_decl_skip_args (tree orig_decl, bitmap args_to_skip,
> +