[Bug middle-end/80362] [5/6 Regression] gcc miscompiles arithmetic with signed char

2017-04-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80362

Richard Biener  changed:

   What|Removed |Added

  Known to work||7.0.1
Summary|[5/6/7 Regression] gcc  |[5/6 Regression] gcc
   |miscompiles arithmetic with |miscompiles arithmetic with
   |signed char |signed char

--- Comment #4 from Richard Biener  ---
Fixed on trunk sofar.

[Bug fortran/80291] [OOP] ICE in gfc_conv_expr_descriptor, at fortran/trans-array.c:6662

2017-04-10 Thread snowfed at mail dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80291

--- Comment #7 from snowfed  ---
In the slightly reduced version of the test case cell is not allocated when
reaching associate structure. Maybe, allocate(cell) is worth being added. For
example, when I compile the example with ifort and run it I get SIGSEGV.

[Bug target/80381] AVX512: -O3, _mm512_srai_epi32, the last argument must be an 8-bit immediate

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80381

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||jakub at gcc dot gnu.org
 Resolution|--- |INVALID

--- Comment #2 from Jakub Jelinek  ---
This is another user error.
_mm512_srai_epi32 second argument must be a constant integer literal, n is not
a constant integer literal, nor is there any chance that even with
optimizations you get one, you pass a function argument to that.

So, if you want to pass sometimes a variable, sometimes a constant, use
_mm512_sra_epi32(a.v, _mm_set_epi64x(0, n))
instead of
_mm512_srai_epi32(a.v, n);
or perhaps
__builtin_constant_p (n) ? _mm512_srai_epi32(a.v, n) : _mm512_sra_epi32(a.v,
_mm_set_epi64x(0, n));
The optimizer will optimize the first line exactly as the second one if n is a
constant after optimizations, but it will not error out otherwise.

[Bug target/80382] New: ICE with error: unrecognizable insn

2017-04-10 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80382

Bug ID: 80382
   Summary: ICE with error: unrecognizable insn
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

This testcase (which took ~5 days of reducing) ICEs with -O3 -std=c++11
-mtune=power8 -mcpu=power8 -mno-lra:

test.C: In constructor ‘sbis::rpc::ProcessPool::ProcessPool(const String&,
sbis::rpc::ProcessPoolType, sbis::EventLoopService*,
sbis::EventReactionService*, const String&)’:
test.C:195:37: error: unrecognizable insn:
   mSemaphore(U(G()), edCREATE) {}
 ^
(insn 16 15 17 2 (set (reg:PTI 169)
(unspec:PTI [
(mem/v:TI (plus:DI (reg/f:DI 160 [ this ])
(const_int 8 [0x8])) [-1  S16 A128])
] UNSPEC_LSQ)) "test.C":47 -1
 (nil))
test.C:195:37: internal compiler error: in extract_insn, at recog.c:2311
0xcca398 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/home/marek/src/gcc/gcc/rtl-error.c:108
0xcca3c9 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/home/marek/src/gcc/gcc/rtl-error.c:116
0xc9bcf1 extract_insn(rtx_insn*)
/home/marek/src/gcc/gcc/recog.c:2311
0xa689f3 instantiate_virtual_regs_in_insn
/home/marek/src/gcc/gcc/function.c:1589
0xa689f3 instantiate_virtual_regs
/home/marek/src/gcc/gcc/function.c:1957
0xa689f3 execute
/home/marek/src/gcc/gcc/function.c:2006
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

namespace std {
template  class allocator;
template  struct char_traits;
}
typedef int size_t;
namespace std {
template  class basic_string {};
}

namespace mpl_ {}
namespace boost {
namespace mpl {
using namespace mpl_;
}
}
namespace mpl_ {
struct void_;
template  struct bool_;
typedef bool_ false_;
template  struct bool_ { static const bool value = C_; };
}
namespace boost {
namespace mpl {
template  struct if_c;
template  struct if_c {
  typedef T2 type;
};
template  struct is_not_void_ : false_ {};
}
}
namespace {
typedef std::basic_string
String;
}

namespace mpl_ {
template  struct size_t { static const ::size_t value = N; };
}
namespace std {
typedef enum { memory_order_relaxed } memory_order;
template  struct atomic {
  _Tp _M_i;
  atomic(_Tp) {}
  _Tp load(memory_order _m) {
_Tp tmp;
__atomic_load(&_M_i, , _m);
  }
};
}

namespace boost {
namespace {
namespace detail {
using std::atomic;
using std::memory_order_relaxed;
}
using detail::atomic;
using detail::memory_order_relaxed;
}
namespace parameter {
struct void_;
template  struct optional;
template  struct parameters { template  struct bind; };
template  struct binding;
}
namespace lockfree {
namespace tag {
struct fixed_sized;
struct capacity;
}
namespace detail {
template  struct has_arg {
  typedef parameter::binding type;
  static const bool value = mpl::is_not_void_::value;
};
template  struct extract_capacity {
  static const bool has_capacity = has_arg::value;
  typedef typename mpl::if_c::type,
 mpl::size_t<0>>::type capacity_t;
  static const size_t capacity = capacity_t::value;
};
template  struct extract_allocator;
template 
struct extract_fixed_sized {
  static const bool has_fixed_sized =
  has_arg::value;
  typedef
  typename mpl::if_c::type,
 mpl::bool_>::type type;
  static const bool value = type::value;
};
template  class tagged_ptr {
  typedef size_t tag_t;
  T *ptr;
  tag_t tag;
};
template  class freelist_stack {
public:
  typedef tagged_ptr tagged_node_handle;
  template  freelist_stack(Allocator);
};
template  struct compiletime_sized_freelist_storage;
template  struct runtime_sized_freelist_storage;
template  class fixed_size_freelist;
template 
struct select_freelist {
  typedef mpl::if_c,
runtime_sized_freelist_storage>
  fixed_sized_storage_type;
  typedef typename mpl::if_c,
 freelist_stack>::type 

[Bug rtl-optimization/80357] [7 Regression] ICE in model_update_limit_points_in_group, at haifa-sched.c:1982 on powerpc64le-linux-gnu

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80357

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-04-10
 CC||jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Please submit a full bug report, with preprocessed source if appropriate.

[Bug middle-end/80375] [5/6/7 Regression] ICE in expand_expr_real_2, at expr.c:9382 with -ftrapv

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80375

--- Comment #3 from Jakub Jelinek  ---
Patch attached to the other PR.  Note this is an ABI change, basically undoing
the ABI change for 32-bit targets made by
http://gcc.gnu.org/ml/gcc-patches/1999-07/msg00031.html
(at that point the ABI was dependent on the host, now as we have 64-bit hwint
it is always there), but one gets pedwarn each time they use this, so hopefully
shouldn't affect much code.

[Bug middle-end/79788] ICE in expand_expr_real_2, at expr.c:9557

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79788

--- Comment #7 from Jakub Jelinek  ---
Created attachment 41166
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41166=edit
gcc7-pr79788.patch

Untested patch that caps the widest literal type at long long on ILP32 targets.

[Bug middle-end/80375] [5/6/7 Regression] ICE in expand_expr_real_2, at expr.c:9382 with -ftrapv

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80375

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
You really don't need -ftrapv to get ICEs with these too high precision
expressions, e.g.
long long
foo (long long x, long long y)
{
  if (y > 1234567891234567891234567891234567812 / x)
return x;
  return 0;
}
ICEs too, again since as far as I can check.
So I really don't believe the "since 5.1" part here.

[Bug fortran/78881] [F03] reading from string with DTIO procedure does not work properly

2017-04-10 Thread ro at CeBiTec dot Uni-Bielefeld.DE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78881

--- Comment #25 from ro at CeBiTec dot Uni-Bielefeld.DE  ---
> --- Comment #24 from Jerry DeLisle  ---
[...]
> Can you try this patch. From what I read there can be issues with char pointer
> sizes between these architectures.
>
> diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
> index 1e56b5de..daa741b4 100644
> --- a/libgfortran/io/transfer.c
> +++ b/libgfortran/io/transfer.c
> @@ -272,7 +272,7 @@ read_sf_internal (st_parameter_dt *dtp, int * length)
>return NULL;
>  }
>
> -  if (base && *base == 0)
> +  if (base && *base == '\0')
>  {
>generate_error (>common, LIBERROR_EOR, NULL);
>return NULL;

Doesn't make any difference.

Btw., I happened to notice that this "int * length" (and many more
instances throughout the file and probably all of libgfortran) is
in violation of the GNU Coding Standard: this should be "int *length"
instead.

Rainer

[Bug gcov-profile/80224] gcov -i crashes with two arguments

2017-04-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80224

Martin Liška  changed:

   What|Removed |Added

  Known to work||7.0
  Known to fail|7.0 |

--- Comment #3 from Martin Liška  ---
Fixed on trunk, queued for backport to active branches.

[Bug ipa/80277] ipa-icf overlooking functions with identical assemble and semantics

2017-04-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80277

Martin Liška  changed:

   What|Removed |Added

   Target Milestone|--- |8.0

[Bug gcov-profile/80224] gcov -i crashes with two arguments

2017-04-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80224

--- Comment #2 from Martin Liška  ---
Author: marxin
Date: Mon Apr 10 11:37:14 2017
New Revision: 246804

URL: https://gcc.gnu.org/viewcvs?rev=246804=gcc=rev
Log:
Support multiple files w/ -i option in gcov (PR gcov-profile/80224).

2017-04-10  Martin Liska  

PR gcov-profile/80224
* gcov.c (print_usage): Fix usage string.
(get_gcov_intermediate_filename): Remove.
(output_gcov_file): Use both for normal and intermediate format.
(generate_results): Do not initialize special file for
intermediate format.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/gcov.c

[Bug target/79905] ICE in canonical types differ for identical types __vector(4) int and V4i {aka __vector(4) int}

2017-04-10 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79905

Nathan Sidwell  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #13 from Nathan Sidwell  ---
patch applied

[Bug tree-optimization/80304] [7 Regression] Wrong result with do concurrent

2017-04-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80304

--- Comment #24 from Richard Biener  ---
Author: rguenth
Date: Mon Apr 10 11:27:05 2017
New Revision: 246803

URL: https://gcc.gnu.org/viewcvs?rev=246803=gcc=rev
Log:
2017-04-10  Richard Biener  

PR tree-optimization/80304
* tree-ssa-loop-im.c (ref_indep_loop_p_1): Also recurse
for safelen.

* gcc.dg/torture/pr80304.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr80304.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-loop-im.c

[Bug tree-optimization/80304] [7 Regression] Wrong result with do concurrent

2017-04-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80304

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #25 from Richard Biener  ---
Fixed. (hopefully)

[Bug target/79905] ICE in canonical types differ for identical types __vector(4) int and V4i {aka __vector(4) int}

2017-04-10 Thread nathan at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79905

--- Comment #12 from Nathan Sidwell  ---
Author: nathan
Date: Mon Apr 10 11:25:44 2017
New Revision: 246802

URL: https://gcc.gnu.org/viewcvs?rev=246802=gcc=rev
Log:
PR target/79905
* config/rs6000/rs6000.c (rs6000_vector_type): New.
(rs6000_init_builtins): Use it.

PR target/79905
* g++.dg/torture/pr79905.C: New.

Added:
trunk/gcc/testsuite/g++.dg/torture/pr79905.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

--- Comment #5 from Jakub Jelinek  ---
Created attachment 41165
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41165=edit
gcc7-pr80370.patch

Untested fix.

[Bug gcov-profile/48361] gcov freezes when using --all-blocks (-a) flag.

2017-04-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48361

Martin Liška  changed:

   What|Removed |Added

 Status|REOPENED|WAITING

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread vittorio.romeo at outlook dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

--- Comment #4 from Vittorio Romeo  ---
Even shorter:


template  struct tuple_size { static constexpr int value = 1; };
template  struct tuple_element { typedef int type; };
template  struct tuple {};
template  int get(T);

int
main ()
{
  [](auto) { [](tuple b) { auto [c] = b; }; }(0);
}

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

[Bug c++/80381] AVX512: -O3, _mm512_srai_epi32, the last argument must be an 8-bit immediate

2017-04-10 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80381

--- Comment #1 from Marc Glisse  ---
Did someone check the places pointed by -Wconversion -Wsystem-headers? Some are
clearly false positive, but some seem suspicious (at least with an older
snapshot, maybe they have been fixed already).

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

--- Comment #3 from Jakub Jelinek  ---
Guess at least get should return int or int & rather than void:

template  struct tuple_size;
template  struct tuple_element;
template  struct tuple {};
template  struct tuple_size { static constexpr int
value = 1; };
template  struct tuple_element<0, tuple> {
typedef T type; };
template  int get (tuple);
int
main ()
{
  [](auto) { [](tuple b) { auto [c] = b; }; }(0);
}

[Bug c++/80381] New: AVX512: -O3, _mm512_srai_epi32, the last argument must be an 8-bit immediate

2017-04-10 Thread m...@sven-woop.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80381

Bug ID: 80381
   Summary: AVX512: -O3, _mm512_srai_epi32, the last argument must
be an 8-bit immediate
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: m...@sven-woop.de
  Target Milestone: ---

I again reduced the issue we ran into, this time I have a reproducer that fails
when compiling with -O3.

Code:
-

#include 

#define __forceinline inline __attribute__((always_inline))

struct vint16
{
  __forceinline vint16(const int i) 
: v(_mm512_set1_epi32(i)) {}

  __forceinline vint16(const __m512i& t) 
: v(t) {}

  friend __forceinline const vint16 operator >>( const vint16& a, const int n )
{ 
return _mm512_srai_epi32(a.v, n); 
  }

  __m512i v; 
};

vint16 test16(int shift)
{
  const vint16 blocks_add = shift;
  return blocks_add >> shift;
}

Command line:
--

g++ -mavx512f -mavx512dq -mavx512cd -mavx512bw -mavx512vl -mf16c -mavx2 -mfma
-mlzcnt -mbmi -mbmi2 -O3 test.cpp -c -o test.o

Output:
---

/home/swoop/projects/gcc/latest/usr/local/lib/gcc/x86_64-pc-linux-gnu/7.0.1/include/avx512fintrin.h:
In function \u2018vint16 test16(int)\u2019:
/home/swoop/projects/gcc/latest/usr/local/lib/gcc/x86_64-pc-linux-gnu/7.0.1/include/avx512fintrin.h:1318:50:
error: the last argument must be an 8-bit immediate
   return (__m512i) __builtin_ia32_psradi512_mask ((__v16si) __A, __B,
~~^~~~
 (__v16si)
 ~ 
 _mm512_undefined_epi32 (),
 ~~
 (__mmask16) -1);

[Bug tree-optimization/80344] [7 Regression] -Wuninitialized triggering on a ctor on ARM

2017-04-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80344

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Richard Biener  ---
Fixed.

[Bug tree-optimization/80344] [7 Regression] -Wuninitialized triggering on a ctor on ARM

2017-04-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80344

--- Comment #6 from Richard Biener  ---
Author: rguenth
Date: Mon Apr 10 08:58:02 2017
New Revision: 246800

URL: https://gcc.gnu.org/viewcvs?rev=246800=gcc=rev
Log:
2017-04-10  Richard Biener  

PR middle-end/80344
* gimplify.c (is_gimple_mem_rhs_or_call): Allow CLOBBERs.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/gimplify.c

[Bug middle-end/80362] [5/6/7 Regression] gcc miscompiles arithmetic with signed char

2017-04-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80362

--- Comment #3 from Richard Biener  ---
10205 /* Convert -A / -B to A / B when the type is signed and overflow
is
10206undefined.  */
10207 if ((!INTEGRAL_TYPE_P (type) || TYPE_OVERFLOW_UNDEFINED (type))
10208 && TREE_CODE (arg0) == NEGATE_EXPR
10209 && negate_expr_p (op1))
10210   {

where op1 is 3.  We're folding (signed char) -(unsigned char) var_1 / 3 and
arg0 is - (unsigned char) var_1 but _unsigned_.

Trivial fix:

Index: gcc/fold-const.c
===
--- gcc/fold-const.c(revision 246797)
+++ gcc/fold-const.c(working copy)
@@ -10205,7 +10205,7 @@ fold_binary_loc (location_t loc,
   /* Convert -A / -B to A / B when the type is signed and overflow is
 undefined.  */
   if ((!INTEGRAL_TYPE_P (type) || TYPE_OVERFLOW_UNDEFINED (type))
- && TREE_CODE (arg0) == NEGATE_EXPR
+ && TREE_CODE (op0) == NEGATE_EXPR
  && negate_expr_p (op1))
{
  if (INTEGRAL_TYPE_P (type))

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Reduced testcase:
template  struct tuple_size;
template  struct tuple_element;
template  struct tuple {};
template  struct tuple_size { static constexpr int
value = 1; };
template  struct tuple_element<0, tuple> {
typedef T type; };
template  void get (tuple);
int
main ()
{
  [](auto) { [](tuple b) { auto [c] = b; }; }(0);
}

[Bug tree-optimization/80304] [7 Regression] Wrong result with do concurrent

2017-04-10 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80304

--- Comment #22 from Chinoune  ---
Created attachment 41163
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41163=edit
the test program in c

This is an equivalent program written in c.

--- Comment #23 from Richard Biener  ---
The issue is that safelen (and IVDEP, as that uses safelen) is quite aggressive
and does not only apply to what is "memory" in the language specific sense but
also to what ends up as memory to the middle-end.  In this case dependencies
of the not inlined add2 calls which get i and j by reference are not accounted
for which makes i and j suitable to store-motion.

Now all would be fine but the call arguments are not updated by store-motion.

So using IVDEP on loops with calls with reference passing is dangerous.

There's still one bug in LIM, namely it fails to recurse to handle
UNANALYZABLE_MEM_ID for safelen.  The following testcase fixes the
last testcase.

Index: gcc/tree-ssa-loop-im.c
===
--- gcc/tree-ssa-loop-im.c  (revision 246797)
+++ gcc/tree-ssa-loop-im.c  (working copy)
@@ -2145,9 +2145,21 @@ ref_indep_loop_p_1 (int safelen, struct
  fprintf (dump_file, "\n");
}

+  /* We need to recurse to properly handle UNANALYZABLE_MEM_ID.  */
+  struct loop *inner = loop->inner;
+  while (inner)
+   {
+ if (!ref_indep_loop_p_1 (safelen, inner, ref, stored_p, ref_loop))
+   {
+ indep_p = false;
+ break;
+   }
+ inner = inner->next;
+   }
+
   /* Avoid caching here as safelen depends on context and refs
  are shared between different contexts.  */
-  return true;
+  return indep_p;
 }
   else
 {

[Bug target/80327] _mm512_abs_ps intrinsic missing

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80327

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||jakub at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #2 from Jakub Jelinek  ---
Implemented on the trunk, not planning to backport.

Author: jakub
Date: Fri Apr  7 19:22:00 2017
New Revision: 246774

URL: https://gcc.gnu.org/viewcvs?rev=246774=gcc=rev
Log:
PR target/80322
PR target/80323
PR target/80325
PR target/80326
* config/i386/avxintrin.h (_mm256_cvtsd_f64, _mm256_cvtss_f32): New
intrinsics.
* config/i386/avx512fintrin.h (_mm512_int2mask, _mm512_mask2int,
_mm512_abs_ps, _mm512_mask_abs_ps, _mm512_abs_pd, _mm512_mask_abs_pd,
_mm512_cvtsd_f64, _mm512_cvtss_f32): Likewise.

* gcc.target/i386/avx512f-undefined-1.c: New test.
* gcc.target/i386/avx512f-cvtsd-1.c: New test.
* gcc.target/i386/avx-cvtsd-1.c: New test.
* gcc.target/i386/avx512f-cvtss-1.c: New test.
* gcc.target/i386/avx512f-abspd-1.c: New test.
* gcc.target/i386/avx-cvtss-1.c: New test.
* gcc.target/i386/avx512f-absps-1.c: New test.
* gcc.target/i386/avx512f-int2mask-1.c: New test.
* gcc.target/i386/avx512f-mask2int-1.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/avx-cvtsd-1.c
trunk/gcc/testsuite/gcc.target/i386/avx-cvtss-1.c
trunk/gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c
trunk/gcc/testsuite/gcc.target/i386/avx512f-absps-1.c
trunk/gcc/testsuite/gcc.target/i386/avx512f-cvtsd-1.c
trunk/gcc/testsuite/gcc.target/i386/avx512f-cvtss-1.c
trunk/gcc/testsuite/gcc.target/i386/avx512f-int2mask-1.c
trunk/gcc/testsuite/gcc.target/i386/avx512f-mask2int-1.c
trunk/gcc/testsuite/gcc.target/i386/avx512f-undefined-1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/avx512fintrin.h
trunk/gcc/config/i386/avxintrin.h
trunk/gcc/testsuite/ChangeLog

[Bug target/80322] convert intrinsics missing

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80322

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from Jakub Jelinek  ---
Implemented on the trunk, not planning to backport.

[Bug target/80323] _mm512_int2mask and _mm512_mask2int intrinsics are missing

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80323

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||jakub at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #3 from Jakub Jelinek  ---
Implemented on the trunk, not planning to backport.

[Bug target/80325] _mm512_undefined intrinsic missing

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80325

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Jakub Jelinek  ---
Implemented on the trunk, not planning to backport.

[Bug target/80324] _mm512_reduce_xxx type instrinsics are missing

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80324

Jakub Jelinek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Jakub Jelinek  ---
Implemented on the trunk, not planning to backport.

[Bug c++/80380] New: misleading behavior with designated initializers for std::vector

2017-04-10 Thread ethan at atdllc dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80380

Bug ID: 80380
   Summary: misleading behavior with designated initializers for
std::vector
   Product: gcc
   Version: 6.3.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ethan at atdllc dot com
  Target Milestone: ---

Created attachment 41164
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41164=edit
short example (not pre-processed)

Designated initializers are silently ignored when used in a initializer list
for a std::vector.

const std::vectorstrings = {
[ 0] = "zero",
[ 1] = "one",
[20] = "twenty",
};

This compiles silently, and results in a vector with three elements.

Using a std::array does result in an error (error: ‘[0] =’ used in a GNU-style
...), as does initializing an array of char * (sorry, unimplemented:
non-trivial designated initializers not supported).

If someone really wants a preprocessed .ii file, I can add one tuesday.

[Bug sanitizer/80350] UBSAN changes code semantics when -fno-sanitize-recover=undefined is used

2017-04-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80350

Martin Liška  changed:

   What|Removed |Added

  Known to work||7.0.1
  Known to fail|7.0.1   |

--- Comment #5 from Martin Liška  ---
Fixed on trunk, queued for active branches.

[Bug sanitizer/80350] UBSAN changes code semantics when -fno-sanitize-recover=undefined is used

2017-04-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80350

--- Comment #4 from Martin Liška  ---
Author: marxin
Date: Mon Apr 10 07:29:29 2017
New Revision: 246799

URL: https://gcc.gnu.org/viewcvs?rev=246799=gcc=rev
Log:
Evaluate a SAVE_EXPR before an UBSAN check (PR sanitizer/80350).

2017-04-10  Martin Liska  

PR sanitizer/80350
* c-ubsan.c (ubsan_instrument_shift): Evaluate RHS before
doing an UBSAN check.
2017-04-10  Martin Liska  

PR sanitizer/80350
* c-c++-common/ubsan/pr80350.c: New test.

Added:
trunk/gcc/testsuite/c-c++-common/ubsan/pr80350.c
Modified:
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-ubsan.c
trunk/gcc/testsuite/ChangeLog

[Bug libfortran/80365] undefined memcpy while writing zero length array on unformatted stream in unix.c

2017-04-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80365

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-10
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Confirmed.

[Bug c++/80370] [7 Regression] ICE when using structured bindings and nested generic lambdas (tsubst_decomp_names)

2017-04-10 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80370

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-10
 CC||jason at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
  Known to work||5.4.0, 6.3.0
Summary|ICE (internal compiler  |[7 Regression] ICE when
   |error) when using   |using structured bindings
   |structured bindings and |and nested generic lambdas
   |nested generic lambdas  |(tsubst_decomp_names)
   |(tsubst_decomp_names)   |
 Ever confirmed|0   |1
  Known to fail||7.0

--- Comment #1 from Martin Liška  ---
Confirmed, started with r242377.

[Bug c/80354] Poor support to silence -Wformat-truncation=1

2017-04-10 Thread sbergman at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80354

--- Comment #2 from Stephan Bergmann  ---
But that makes this warning extremely hard to use.  Is it really useful for
-Wall in that case?

I came across this with a real-world use-case in the LibreOffice code base,
where some code deliberately uses snprintf to produce a fixed-size prefix, see
 "WaE: ‘%lu’ directive output may be
truncated".  (And older builds of GCC towards GCC 7 did not emit that unhelpful
warning with -Wall => -Wformat-truncation=1, but would only have emitted it
with an explicit -Wformat-truncation=2.)

Addressing false positives for this warning thus becomes an unpleasant
whack-a-mole (given different builds of the code are done with different
optimization switches), unpleasant enough so that we'll likely have to use
-Wall -Wformat-truncation=0 for LibreOffice.  Which is unfortunate, given that
casting-to-void would be a well-understood and well-accepted way to silence
false positives (but one hard to implement in GCC, if I understand you
correctly).

[Bug middle-end/80375] [5/6/7 Regression] ICE in expand_expr_real_2, at expr.c:9382 with -ftrapv

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80375

--- Comment #1 from Jakub Jelinek  ---
Dup of PR79788 ?  I'll have a look in any case.

[Bug tree-optimization/80374] [7 Regression] ICE in fold_convert_loc, at fold-const.c:2384

2017-04-10 Thread sylvestre at debian dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80374

Sylvestre Ledru  changed:

   What|Removed |Added

 CC||sylvestre at debian dot org

--- Comment #1 from Sylvestre Ledru  ---
FWIW, this is breaking one of the unit test of Firefox.

[Bug target/80367] internal compiler error: in print_reg, at config/i386/i386.c:16549

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80367

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek  ---
Inline asm clobbering "esp" is of course invalid, what the compiler could do
with that?  The inline asm needs to have the same stack pointer on entry and
exit, for anything more magic than that you need to use separate asm functions,
you can't have it inline.
That said, if there is ICE, we should error out on that instead.  Can't
reproduce myself on x86_64-liux, because the source is too djgpp specific.

[Bug target/80377] gcc: error: unrecognized command line option ‘-mavx512’; did you mean ‘-mavx512 ’?

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80377

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
Can't reproduce:
$ ./xgcc -B ./ -S -g3 -O3 -std=c99 -march=native -mavx512 pr80377.c
xgcc: error: unrecognized command line option ‘-mavx512’; did you mean
‘-mavx512f’?
$ gcc -S -g3 -O3 -std=c99 -march=native -mavx512 pr80377.c
gcc: error: unrecognized command line option ‘-mavx512’; did you mean
‘-mavx512f’?
The first one is with current gcc trunk, the second one with Fedora
gcc-6.3.1-1.fc25.x86_64.

[Bug target/80324] _mm512_reduce_xxx type instrinsics are missing

2017-04-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80324

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Mon Apr 10 06:53:28 2017
New Revision: 246798

URL: https://gcc.gnu.org/viewcvs?rev=246798=gcc=rev
Log:
PR target/80324
* config/i386/avx512fintrin.h (_mm512_reduce_add_epi32,
_mm512_reduce_mul_epi32, _mm512_reduce_and_epi32,
_mm512_reduce_or_epi32, _mm512_mask_reduce_add_epi32,
_mm512_mask_reduce_mul_epi32, _mm512_mask_reduce_and_epi32,
_mm512_mask_reduce_or_epi32, _mm512_reduce_min_epi32,
_mm512_reduce_max_epi32, _mm512_reduce_min_epu32,
_mm512_reduce_max_epu32, _mm512_mask_reduce_min_epi32,
_mm512_mask_reduce_max_epi32, _mm512_mask_reduce_min_epu32,
_mm512_mask_reduce_max_epu32, _mm512_reduce_add_ps,
_mm512_reduce_mul_ps, _mm512_mask_reduce_add_ps,
_mm512_mask_reduce_mul_ps, _mm512_reduce_min_ps, _mm512_reduce_max_ps,
_mm512_mask_reduce_min_ps, _mm512_mask_reduce_max_ps,
_mm512_reduce_add_epi64, _mm512_reduce_mul_epi64,
_mm512_reduce_and_epi64, _mm512_reduce_or_epi64,
_mm512_mask_reduce_add_epi64, _mm512_mask_reduce_mul_epi64,
_mm512_mask_reduce_and_epi64, _mm512_mask_reduce_or_epi64,
_mm512_reduce_min_epi64, _mm512_reduce_max_epi64,
_mm512_mask_reduce_min_epi64, _mm512_mask_reduce_max_epi64,
_mm512_reduce_min_epu64, _mm512_reduce_max_epu64,
_mm512_mask_reduce_min_epu64, _mm512_mask_reduce_max_epu64,
_mm512_reduce_add_pd, _mm512_reduce_mul_pd, _mm512_mask_reduce_add_pd,
_mm512_mask_reduce_mul_pd, _mm512_reduce_min_pd, _mm512_reduce_max_pd,
_mm512_mask_reduce_min_pd, _mm512_mask_reduce_max_pd): New intrinsics.

* gcc.target/i386/avx512f-reduce-op-1.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/avx512f-reduce-op-1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/avx512fintrin.h
trunk/gcc/testsuite/ChangeLog

<    1   2