[Bug rtl-optimization/80385] [5/6/7 Regression] Segfault in commutative_operand_precedence() rtlanal.c:3373

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

Markus Trippelsdorf  changed:

   What|Removed |Added

  Known to work||4.8.5
Summary|Internal Segmentation Fault |[5/6/7 Regression] Segfault
   ||in
   ||commutative_operand_precede
   ||nce() rtlanal.c:3373

--- Comment #3 from Markus Trippelsdorf  ---
typedef float __m128 __attribute__((__vector_size__(16)));
__m128 _mm_sub_ps___B;
struct A {
  __m128 data;
  A();
  A(__m128 p1) : data(p1) {}
};
A operator+(A, A);
A operator-(A) {
  __m128 __trans_tmp_6 = -_mm_sub_ps___B;
  return __trans_tmp_6;
}
A copysign(A p1) {
  __m128 __A = p1.data, __B;
  return __builtin_ia32_andnps(__A, __B);
}
struct B {
  A n[1];
};
void FustrumVisible(B p1, int) {
  A __trans_tmp_9 = copysign(p1.n[0]),
__trans_tmp_4 = __trans_tmp_9 + __trans_tmp_4;
}
void CameraAABBIntersect() {
  B __trans_tmp_8;
  {
B culling;
A __trans_tmp_3;
culling.n[0] = -__trans_tmp_3;
__trans_tmp_8 = culling;
  }
  B culling = __trans_tmp_8;
  FustrumVisible(culling, {});
}

[Bug c++/80387] [6/7 Regression] G++ get stuck due to decltype over constexpr static function in using declaration

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

Thomas Koenig  changed:

   What|Removed |Added

   Target Milestone|--- |7.0

[Bug rtl-optimization/80385] Internal Segmentation Fault

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

Markus Trippelsdorf  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-11
 CC||trippels at gcc dot gnu.org
  Component|c++ |rtl-optimization
 Ever confirmed|0   |1
  Known to fail||5.4.0, 6.2.0, 7.0

--- Comment #2 from Markus Trippelsdorf  ---
0xdc30af crash_signal
../../gcc/gcc/toplev.c:337
0xd5b550 commutative_operand_precedence(rtx_def*)
../../gcc/gcc/rtlanal.c:3373
0xd5b697 swap_commutative_operands_p(rtx_def*, rtx_def*)
../../gcc/gcc/rtlanal.c:3444
0xd99032 simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
../../gcc/gcc/simplify-rtx.c:2093
0xd9bf09 simplify_gen_binary(rtx_code, machine_mode, rtx_def*, rtx_def*)
../../gcc/gcc/simplify-rtx.c:190
0xd9f270 simplify_gen_unary(rtx_code, machine_mode, rtx_def*, machine_mode)
../../gcc/gcc/simplify-rtx.c:384
0x149408d propagate_rtx_1
../../gcc/gcc/fwprop.c:497
0x1493fb3 propagate_rtx_1
../../gcc/gcc/fwprop.c:504
0x1494acf propagate_rtx
../../gcc/gcc/fwprop.c:693
0x1495d87 forward_propagate_and_simplify
../../gcc/gcc/fwprop.c:1356
0x1495d87 forward_propagate_into
../../gcc/gcc/fwprop.c:1414
0x14972d4 fwprop
../../gcc/gcc/fwprop.c:1503
0x14972d4 execute
../../gcc/gcc/fwprop.c:1534

Reducing...

[Bug c++/80387] [6/7 Regression] G++ get stuck due to decltype over constexpr static function in using declaration

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

Markus Trippelsdorf  changed:

   What|Removed |Added

   Keywords||compile-time-hog,
   ||memory-hog
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-11
 CC||trippels at gcc dot gnu.org
Summary|G++ get stuck due to|[6/7 Regression] G++ get
   |decltype over constexpr |stuck due to decltype over
   |static function in using|constexpr static function
   |declaration |in using declaration
 Ever confirmed|0   |1

[Bug c++/80387] G++ get stuck due to decltype over constexpr static function in using declaration

2017-04-10 Thread bastien.penavayre at epitech dot eu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80387

--- Comment #2 from bastien penavayre  ---
Created attachment 41172
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41172=edit
source precompiled after g++ --save-temps

[Bug c++/80387] G++ get stuck due to decltype over constexpr static function in using declaration

2017-04-10 Thread bastien.penavayre at epitech dot eu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80387

bastien penavayre  changed:

   What|Removed |Added

 CC||bastien.penavayre at epitech 
dot e
   ||u

--- Comment #1 from bastien penavayre  ---
Created attachment 41171
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41171=edit
g++ -v --save-temps test.cpp 2> OUTPUT

result of:
$ g++ -v --save-temps test.cpp 2> OUTPUT

[Bug c++/80387] New: G++ get stuck due to decltype over constexpr static function in using declaration

2017-04-10 Thread bastien.penavayre at epitech dot eu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80387

Bug ID: 80387
   Summary: G++ get stuck due to decltype over constexpr static
function in using declaration
   Product: gcc
   Version: 6.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bastien.penavayre at epitech dot eu
  Target Milestone: ---

Created attachment 41170
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41170=edit
source file

template using assigned with decltype of constexpr static method "func"
cause g++ to hang with one thread running at 100% non-stop.

Tested first with g++7.0.1 20170410 and confirmed to be the same with
g++-6.0.1.
On older version of g++ the method "func" is not recognized.

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

2017-04-10 Thread egall at gwmail dot gwu.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80354

Eric Gallager  changed:

   What|Removed |Added

 CC||egall at gwmail dot gwu.edu

--- Comment #4 from Eric Gallager  ---
(In reply to Martin Sebor from comment #3)
> The warning does just what it's designed to do: point out the potential
> unhandled truncation.  If the argument values are such that the truncation
> cannot occur then using snprintf is unnecessary and sprintf can be used
> instead.

There's other code checking tools (e.g. splint) that say to never use sprintf
and to always use snprintf instead; the manpage on my computer for sprintf also
says to always use snprintf instead. For this reason some projects do
#pragma GCC poison sprintf
in a header file, so sprintf can't actually be used instead in those cases.

[Bug sanitizer/80386] New: UBSAN: false positive - constant folding and reassosiation before instrumentation

2017-04-10 Thread babokin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80386

Bug ID: 80386
   Summary: UBSAN: false positive - constant folding and
reassosiation before instrumentation
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: babokin at gmail dot com
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

gcc ubsan incorrectly does code instrumentation triggering false positive
alarm.

This looks like expression reassosiation and constant folding were done before
UBSAN instrumentation, turning legal code to illegal. 

> cat f.cpp
static unsigned long long int member_1_3 = 13996271126042720493ULL;

int main() {
  // 2921 - 14573 + MAX_INT
  (((2921 + 0) - short(member_1_3)) + 0x7fff) >> 0;
  return 0;
}


> g++ -fsanitize=undefined -O0 -o out f.cpp
> ./out
f.cpp:5:37: runtime error: signed integer overflow: -2147480728 - 14573 cannot
be represented in type 'int'


I'm using top of the trunk gcc.

[Bug c++/80385] Internal Segmentation Fault

2017-04-10 Thread jrkoenig at stanford dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80385

--- Comment #1 from Jason Koenig  ---
Created attachment 41169
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41169=edit
main.ii (gzipped)

[Bug c++/80385] New: Internal Segmentation Fault

2017-04-10 Thread jrkoenig at stanford dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80385

Bug ID: 80385
   Summary: Internal Segmentation Fault
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jrkoenig at stanford dot edu
  Target Milestone: ---

The attached file (main.ii) generates an internal segmentation fault using:

$ g++ -ffast-math -O3 -c main.ii
... snip random warnings ...
/home/jason/dev/dual-contouring/src/main.cpp: In function ‘bool
CameraAABBIntersect(OctNode*, camera_params)’:
/home/jason/dev/dual-contouring/src/main.cpp:823:1: internal compiler
error: 
Segmentation fault
 auto nodes = expand_queue.Get(10);
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.


The system is a x64 Ubuntu 16.10 with gcc 6.2.0:

$ uname -a
Linux graviton 4.8.0-46-generic #49-Ubuntu SMP Fri Mar 31 13:57:14 UTC 2017
x86_64 x86_64 x86_64 GNU/Linux

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 6.2.0-5ubuntu12'
--with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared
--enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre
--enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12)

[Bug target/80098] ICE in curr_insn_transform, at lra-constraints.c:3816 on ppc64le

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

Michael Meissner  changed:

   What|Removed |Added

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

[Bug middle-end/77721] -Wformat-truncation not uses arg range for converted vars

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

Martin Sebor  changed:

   What|Removed |Added

Summary|-Wformat-length not uses|-Wformat-truncation not
   |arg range for converted |uses arg range for
   |vars|converted vars

--- Comment #5 from Martin Sebor  ---
The warning has been renamed to -Wformat-overflow (and -Wformat-truncation). 
Adjusting Summary.

[Bug middle-end/77696] Confusing wording for -Wformat-overflow

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

Martin Sebor  changed:

   What|Removed |Added

Summary|Confusing wording for   |Confusing wording for
   |-Wformat-length=|-Wformat-overflow

--- Comment #2 from Martin Sebor  ---
The warning has been renamed to -Wformat-overflow (and -Wformat-truncation). 
Adjusting Summary.

[Bug middle-end/77831] add fixit hints to -Wformat-overflow and -Wformat-truncation

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

Martin Sebor  changed:

   What|Removed |Added

Summary|add fixit hints to  |add fixit hints to
   |-Wformat-length |-Wformat-overflow and
   ||-Wformat-truncation

--- Comment #3 from Martin Sebor  ---
The warning has been renamed to -Wformat-overflow (and -Wformat-truncation). 
Adjusting Summary.

[Bug middle-end/77799] missing -Wformat-overflow warning on a trivial sprintf overflow with no directives

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

Martin Sebor  changed:

   What|Removed |Added

Summary|missing -Wformat-length |missing -Wformat-overflow
   |warning on a trivial|warning on a trivial
   |sprintf overflow with no|sprintf overflow with no
   |directives  |directives

--- Comment #1 from Martin Sebor  ---
The warning has been renamed to -Wformat-overflow (and -Wformat-truncation). 
Adjusting Summary.

[Bug middle-end/77671] missing -Wformat-overflow warning on sprintf overflow with "%s"

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

Martin Sebor  changed:

   What|Removed |Added

Summary|missing -Wformat-length |missing -Wformat-overflow
   |warning on sprintf overflow |warning on sprintf overflow
   |with "%s"   |with "%s"

--- Comment #3 from Martin Sebor  ---
The warning has been renamed to -Wformat-overflow (and -Wformat-truncation). 
Adjusting Summary.

[Bug lto/79062] -Walloca-larger-than and -Wformat-overflow warnings disabled by -flto

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

Martin Sebor  changed:

   What|Removed |Added

Summary|-Wformat-length warnings|-Walloca-larger-than and
   |disabled by -flto   |-Wformat-overflow warnings
   ||disabled by -flto

--- Comment #2 from Martin Sebor  ---
The latter warning has been renamed to -Wformat-overflow (and
-Wformat-truncation).  Adjusting Summary.

[Bug tree-optimization/78913] Probably misleading error reported by -Wformat-truncation

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

Martin Sebor  changed:

   What|Removed |Added

Summary|Probably misleading error   |Probably misleading error
   |reported by -Wformat-length |reported by
   ||-Wformat-truncation

--- Comment #11 from Martin Sebor  ---
The truncation warning has been split out into -Wformat-truncation.  Adjusting
Summary.

[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement

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

Nicolas Koenig  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Nicolas Koenig  ---
Fixed on trunk (this time for real), closing (again).

[Bug c++/80384] ICE when deducing noexcept in class template partial specialization

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

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
Confirmed.

[Bug fortran/80305] [7 Regression] print statement inside do-concurrent

2017-04-10 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80305

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Dominique d'Humieres  ---
Also fixed by revision r246803.

[Bug fortran/69498] ICE on disjunct cases with displaced or incomplete embedded statement

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

--- Comment #10 from Nicolas Koenig  ---
Author: koenigni
Date: Mon Apr 10 20:58:21 2017
New Revision: 246826

URL: https://gcc.gnu.org/viewcvs?rev=246826=gcc=rev
Log:

2017-04-10  Nicolas Koenig  
Paul Thomas  

PR fortran/69498 
* module.c (gfc_match_submodule): Add error
if function is called in the wrong state.

2017-04-10  Nicolas Koenig  

PR fortran/69498 
* gfortran.dg/submodule_unexp.f90: Modified test
to account for new error.
* gfortran.dg/submodule_twice.f90: New Test


Added:
trunk/gcc/testsuite/gfortran.dg/submodule_twice.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/module.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/submodule_unexp.f90

[Bug c++/80176] [5/6 Regression] cannot bind reference to static member function using object access expression

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

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||jakub at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
Summary|[5/6/7 Regression] cannot   |[5/6 Regression] cannot
   |bind reference to static|bind reference to static
   |member function using   |member function using
   |object access expression|object access expression

--- Comment #4 from Jakub Jelinek  ---
Fixed on the trunk so far.

[Bug c++/80176] [5/6/7 Regression] cannot bind reference to static member function using object access expression

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

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Mon Apr 10 20:49:11 2017
New Revision: 246825

URL: https://gcc.gnu.org/viewcvs?rev=246825=gcc=rev
Log:
PR c++/80176
* tree.c (lvalue_kind): For COMPONENT_REF with BASELINK second
operand, if it is a static member function, recurse on the
BASELINK.

* g++.dg/init/ref23.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/init/ref23.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/tree.c
trunk/gcc/testsuite/ChangeLog

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

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

Peter Bergner  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-10
 Ever confirmed|0   |1

--- Comment #8 from Peter Bergner  ---
Confirmed.  The (const_int 8) offset needs to be a multiple of 16, so I'll
track down why rs6000_legitimize_reload_address() doesn't catch this.

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

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

--- Comment #27 from Thomas Koenig  ---
The bug is indeed fixed.  Thanks a lot for the quick fix!

I have also committed a Fortran test case (just to be sure).

Regards

Thomas

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

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

--- Comment #26 from Thomas Koenig  ---
Author: tkoenig
Date: Mon Apr 10 20:40:48 2017
New Revision: 246824

URL: https://gcc.gnu.org/viewcvs?rev=246824=gcc=rev
Log:
2017-04-10  Thomas Koenig  

PR tree-optimization/80304
* gfortran.dg/do_concurrent_4.f90:  New test case.


Added:
trunk/gcc/testsuite/gfortran.dg/do_concurrent_4.f90
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug fortran/80046] [F03] Explicit interface required: pointer argument

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

janus at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #7 from janus at gcc dot gnu.org ---
Fixed with r246823. Closing.

[Bug c++/80384] New: ICE when deducing noexcept in class template partial specialization

2017-04-10 Thread rs2740 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80384

Bug ID: 80384
   Summary: ICE when deducing noexcept in class template partial
specialization
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rs2740 at gmail dot com
  Target Milestone: ---

https://gcc.gnu.org/ml/gcc-patches/2016-11/msg00665.html "allow[ed]
noexcept(E) to be a deduced context in order to avoid another factor
of two expansion in the partial specializations of is_function."

The following causes an ICE with Wandbox's GCC 7
(https://wandbox.org/permlink/LacBOL6M17og9ZF9):

template struct foo;
template
struct foo {
static const bool value = true; 
};

static_assert(!foo::value);

prog.cc: In instantiation of 'struct foo':
prog.cc:7:26:   required from here
prog.cc:4:23: internal compiler error: in finish_member_declaration, at
cp/semantics.c:2963
 static const bool value = true;
   ^
0x681eb2 finish_member_declaration(tree_node*)
../../source/gcc/cp/semantics.c:2963
0x5f1f3a instantiate_class_template_1
../../source/gcc/cp/pt.c:10581
0x5f1f3a instantiate_class_template(tree_node*)
../../source/gcc/cp/pt.c:10798
0x654435 complete_type(tree_node*)
../../source/gcc/cp/typeck.c:133
0x63c032 cp_parser_nested_name_specifier_opt
../../source/gcc/cp/parser.c:6153
0x63ee02 cp_parser_simple_type_specifier
../../source/gcc/cp/parser.c:16826
0x635d78 cp_parser_postfix_expression
../../source/gcc/cp/parser.c:6699
0x63694d cp_parser_unary_expression
../../source/gcc/cp/parser.c:8103
0x637703 cp_parser_cast_expression
../../source/gcc/cp/parser.c:8781
0x6369b5 cp_parser_unary_expression
../../source/gcc/cp/parser.c:8021
0x637703 cp_parser_cast_expression
../../source/gcc/cp/parser.c:8781
0x637e77 cp_parser_binary_expression
../../source/gcc/cp/parser.c:8882
0x638524 cp_parser_assignment_expression
../../source/gcc/cp/parser.c:9169
0x638907 cp_parser_constant_expression
../../source/gcc/cp/parser.c:9439
0x638a38 cp_parser_static_assert
../../source/gcc/cp/parser.c:13589
0x64afae cp_parser_block_declaration
../../source/gcc/cp/parser.c:12599
0x629504 cp_parser_declaration
../../source/gcc/cp/parser.c:12500
0x64f25b cp_parser_declaration_seq_opt
../../source/gcc/cp/parser.c:12376
0x64f542 cp_parser_translation_unit
../../source/gcc/cp/parser.c:4366
0x64f542 c_parse_file()
../../source/gcc/cp/parser.c:38427
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug fortran/80046] [F03] Explicit interface required: pointer argument

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

--- Comment #6 from janus at gcc dot gnu.org ---
Author: janus
Date: Mon Apr 10 20:28:23 2017
New Revision: 246823

URL: https://gcc.gnu.org/viewcvs?rev=246823=gcc=rev
Log:
2017-04-10  Janus Weil  

PR fortran/80046
* expr.c (gfc_check_pointer_assign): Check if procedure pointer
components in a pointer assignment need an explicit interface.

2017-04-10  Janus Weil  

PR fortran/80046
* gfortran.dg/proc_ptr_comp_48.f90: New test case.

Added:
trunk/gcc/testsuite/gfortran.dg/proc_ptr_comp_48.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/testsuite/ChangeLog

[Bug target/70878] [5/6/7 Regression] ICE in expand_expr_addr_expr_1, at expr.c:7680

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

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-10
 CC||marxin at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org
Summary|ICE in  |[5/6/7 Regression] ICE in
   |expand_expr_addr_expr_1, at |expand_expr_addr_expr_1, at
   |expr.c:7680 |expr.c:7680
 Ever confirmed|0   |1

[Bug c++/80265] __builtin_{memcmp,memchr,strlen} are not usable in constexpr functions

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

--- Comment #14 from Pedro Alves  ---
AFAIK, the "if constexpr()" proposal was sent back for more work [1], seems
premature to support it, while I'd hope that the __builtin_constant_p approach
would allow supporting constexpr char_traits in GCC7 (either 7.1 or some later
point release).

(I don't exactly see where's the contradiction, but I'm not a real GCC hacker.)

[1] -
https://botondballo.wordpress.com/2017/03/27/trip-report-c-standards-meeting-in-kona-february-2017/

[Bug target/80098] ICE in curr_insn_transform, at lra-constraints.c:3816 on ppc64le

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

Michael Meissner  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-10
 Ever confirmed|0   |1

--- Comment #1 from Michael Meissner  ---
This is an interaction between -mpower9-minmax and -mno-vsx.

[Bug middle-end/80100] simplify-rtx.c sanitizer detects undefined behaviour with optimization

2017-04-10 Thread zeccav at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80100

--- Comment #2 from Vittorio Zecca  ---
simplify-rtx.c:2743 is "HOST_WIDE_INT mask = INTVAL (trueop1) << count;"

[Bug tree-optimization/80359] [7 Regression] DSE causes error: invalid reference prefix

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

--- Comment #4 from Jeffrey A. Law  ---
Given how late in stage4 we are, I think rejecting TMR without trying to
rewrite them into a regular MEM_REF is probably the best thing to do.

[Bug c++/80265] __builtin_{memcmp,memchr,strlen} are not usable in constexpr functions

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

--- Comment #13 from Marc Glisse  ---
If we need the "if constexpr()" that is proposed for C++20, we might as well
implement that (and enable it in system headers for C++17 if that's useful), it
seems better than abusing __builtin_constant_p, which is getting contradictory
requirements from its various uses:
- constexpr (forces very early lowering)
- warning/error (forbid splitting or anything that might create calls with
constants that did not exist in the user's code, or lower to false before such
transformation)
- optimization (wants to delay lowering to false quite late (though not so late
that the code without __bcp isn't properly optimized) and likes isolating a
path that makes the argument constant)
etc

(though at first glance your latest version seems likely to work well enough)

[Bug c++/80265] __builtin_{memcmp,memchr,strlen} are not usable in constexpr functions

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

--- Comment #12 from Pedro Alves  ---
This seems to work equally well (or better):

// true if the whole string is known at compile time.
static inline constexpr bool constant_string(const char *s)
{
  while (__builtin_constant_p (*s) && *s)
s++;
  if (!__builtin_constant_p (*s))
return false;
  return true;
}

constexpr size_t constexpr_strlen(const char* s)
{
  const char *p = s;
  while (*p)
p++;
  return p - s;
}

and then use it in ce_char_traits like:

  static constexpr std::size_t length(const char_type* s) noexcept
  {
if (constant_string(s))
  return constexpr_strlen (s);

return __builtin_strlen (s);
  }

I.e., decouple the "is the whole string constant" from the strlen algorithm.
This should make it easier to reuse the "is compile-time string" in other
compile-time algorithms, though the previous version in comment #11 potentially
optimized the computing the length of the constant prefix part of the string. 
(which is probably not a common use case to aim for anyway.)

Sorry for the constant spam...

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

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

Jeffrey A. Law  changed:

   What|Removed |Added

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

--- Comment #4 from Jeffrey A. Law  ---
Resolved on the trunk.

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

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

--- Comment #3 from Jeffrey A. Law  ---
Author: law
Date: Mon Apr 10 19:19:42 2017
New Revision: 246819

URL: https://gcc.gnu.org/viewcvs?rev=246819=gcc=rev
Log:
PR tree-optimization/80374
* tree-ssa-dom.c (derive_equivalences_from_bit_ior): Do not try to
record anything if we can not convert integer_zero_node to the
desired type.

PR tree-optimization/80374
* g++.dg/pr80374.c: New test.

Added:
trunk/gcc/testsuite/g++.dg/pr80374.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-dom.c

[Bug c/80383] New: wrong caret location and missing detail in warning: initializer element is not a constant expression on a signed overflow

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

Bug ID: 80383
   Summary: wrong caret location and missing detail in warning:
initializer element is not a constant expression on a
signed overflow
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

The caret in the pedantic warnings issued for the following test case points to
the wrong subexpression, making the warning confusing.  The caret should point
to the shift expression and the operands should be underlined.  It would help
if the warning also explained why the result of the shift expression isn't a
constant expression.  Perhaps -Wshift-overflow=2 should be enabled by
-Wpedantic?

$ cat b.c && gcc -O2 -S -Wall -Wextra -Wpedantic b.c
const int i = 1 << (sizeof (int) * __CHAR_BIT__ - 1);
const int j = 1 << (sizeof (int) * __CHAR_BIT__);
b.c:1:15: warning: initializer element is not a constant expression
[-Wpedantic]
 const int i = 1 << (sizeof (int) * __CHAR_BIT__ - 1);
   ^
b.c:2:17: warning: left shift count >= width of type [-Wshift-count-overflow]
 const int j = 1 << (sizeof (int) * __CHAR_BIT__);
 ^~
b.c:2:15: warning: initializer element is not a constant expression
[-Wpedantic]
 const int j = 1 << (sizeof (int) * __CHAR_BIT__);
   ^

In contrast, with -Wshift-overlow=2, GCC prints the following.  With
-Wshift-overflow and -Wshift-count-overflow the caret is in the right place
(but the operands aren't underlined).

b.c:1:17: warning: result of ‘1 << 31’ requires 33 bits to represent, but ‘int’
only has 32 bits [-Wshift-overflow=]
 const int i = 1 << (sizeof (int) * __CHAR_BIT__ - 1);
 ^~
b.c:1:15: warning: initializer element is not a constant expression
[-Wpedantic]
 const int i = 1 << (sizeof (int) * __CHAR_BIT__ - 1);
   ^
b.c:2:17: warning: left shift count >= width of type [-Wshift-count-overflow]
 const int j = 1 << (sizeof (int) * __CHAR_BIT__);
 ^~
b.c:2:15: warning: initializer element is not a constant expression
[-Wpedantic]
 const int j = 1 << (sizeof (int) * __CHAR_BIT__);
   ^

With -Weverything Clang prints the following warnings for the problems
discussed above:

t.c:1:17: warning: signed shift result (0x8000) sets the sign bit of the
  shift expression's type ('int') and becomes negative
  [-Wshift-sign-overflow]
const int i = 1 << (sizeof (int) * __CHAR_BIT__ - 1);
  ~ ^  ~
t.c:2:17: warning: shift count >= width of type [-Wshift-count-overflow]
const int j = 1 << (sizeof (int) * __CHAR_BIT__);
^  ~

[Bug target/80108] ICE in aggregate_value_p at function.c:2028

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

kelvin at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #13 from kelvin at gcc dot gnu.org ---
committed patch has resolved this issue.

[Bug target/80108] ICE in aggregate_value_p at function.c:2028

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

--- Comment #12 from kelvin at gcc dot gnu.org ---
Author: kelvin
Date: Mon Apr 10 19:01:37 2017
New Revision: 246818

URL: https://gcc.gnu.org/viewcvs?rev=246818=gcc=rev
Log:
gcc/ChangeLog:

2017-04-10  Kelvin Nilsen  

PR target/80108
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Enhance special handling given to the TARGET_P9_MINMAX option in
relation to certain other options.

gcc/testsuite/ChangeLog:

2017-04-10  Kelvin Nilsen  

PR target/80108
* gcc.target/powerpc/ppc-fortran/ppc-fortran.exp: New file.
* gcc.target/powerpc/ppc-fortran/pr80108-1.f90: New test.


Added:
trunk/gcc/testsuite/gcc.target/powerpc/ppc-fortran/
trunk/gcc/testsuite/gcc.target/powerpc/ppc-fortran/ppc-fortran.exp
trunk/gcc/testsuite/gcc.target/powerpc/ppc-fortran/pr80108-1.f90
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/rs6000/rs6000.c
trunk/gcc/testsuite/ChangeLog

[Bug sanitizer/80349] [6/7 Regression] UBSAN: compile time crash with "type mismatch in binary expression" message

2017-04-10 Thread babokin at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80349

--- Comment #3 from Dmitry Babokin  ---
PR80348 is fixed, but this still fails.

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

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

--- Comment #9 from Uroš Bizjak  ---
In PR 79804, I have a patch that makes ICE more informative, but the frame reg
problem elimination remains to be solved in LRA.

[Bug testsuite/79356] XPASS in attr-alloc_size-11.c

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

--- Comment #15 from uros at gcc dot gnu.org ---
Author: uros
Date: Mon Apr 10 18:51:42 2017
New Revision: 246816

URL: https://gcc.gnu.org/viewcvs?rev=246816=gcc=rev
Log:
PR testsuite/79356
* gcc.dg/attr-alloc_size-11.c: Don't xfail on alpha.


Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/attr-alloc_size-11.c

[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||uros at gcc dot gnu.org,
   ||vmakarov at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek  ---
Doesn't ICE on x86_64-linux (-m64 nor -m32), but I can reproduce the ICE in a
cross to x86_64-mingw32, only -m32 is needed.  The ICE is because LRA does not
eliminate frame regs because "esp" is clobbered by the asm (normally they would
be eliminated to sp+offset).

[Bug c++/80265] __builtin_{memcmp,memchr,strlen} are not usable in constexpr functions

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

--- Comment #11 from Pedro Alves  ---
Ok, so s[2] is not constant, while s[0] is, in that case.

AFAICS, changing constexpr_strlen to this:

constexpr size_t constexpr_strlen(const char* s)
{
  const char *p = s;

  while (__builtin_constant_p (*p) && *p)
p++;
  if (!__builtin_constant_p (p[0]))
return p - s + __builtin_strlen (p);
  return p - s;
}

makes it work as expected.  All the previous static_assert tests compile
without
error, and, we now get a call to strlen at run-time, AFAICS (I replaced that
__builtin_strlen call with a call to an "extern_strlen" function declared in
another compile unit instead to verify).

Could you confirm?

[Bug target/80099] ICE in rs6000_expand_vector_extract, at config/rs6000/rs6000.c:7450

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

Segher Boessenkool  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-04-10
 Ever confirmed|0   |1

--- Comment #1 from Segher Boessenkool  ---
Needs -mcpu=power8.  Confirmed.

Don't use -mno-upper-regs-sf...

[Bug target/79712] Clang smarter about unrolling in fhourstones benchmark

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

Bill Schmidt  changed:

   What|Removed |Added

 CC||wschmidt at gcc dot gnu.org

--- Comment #10 from Bill Schmidt  ---
(In reply to Richard Biener from comment #9)
> Micha was looking at removing RTL unrolling and instead do sth on the GIMPLE
> level.

That would be an interesting topic for Cauldron if it's far enough along for
discussion.

[Bug target/80210] ICE in in extract_insn, at recog.c:2311 on ppc64 for with __builtin_pow

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

--- Comment #2 from Segher Boessenkool  ---
Confirmed.  The define_expand condition is *not* checked?!  Possibly by
the pow->sqrt code (yeah I'm guessing here).

[Bug target/80210] ICE in in extract_insn, at recog.c:2311 on ppc64 for with __builtin_pow

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

Peter Bergner  changed:

   What|Removed |Added

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

--- Comment #1 from Peter Bergner  ---
Confirmed.  It's strange that it doesn't ICE on LE, even though we produce the
exact same pattern there.  Maybe we're somehow disabling the pattern on BE when
we shouldn't be.

[Bug middle-end/80283] [5/6/7 Regression] bad SIMD register allocation

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

wilco at gcc dot gnu.org changed:

   What|Removed |Added

 CC||wilco at gcc dot gnu.org

--- Comment #12 from wilco at gcc dot gnu.org ---
There are 2 separate issues in the ARMv7 case. One is scheduling, the -S output
goes down from 437 lines to 305 lines with -fno-schedule-insns (stack size 276
rather than 448 bytes). So basically the "register pressure aware" scheduler
introduces lots of unnecessary spills.

The 2nd issue is related to use of single-element operations within vectors. If
I change the define to do an explicit dup, eg. vmulq_f32((b), vdupq_n_f32(a)),
I get 211 lines and no spills at all. Switching scheduling on again gives 326
lines so it's spilling like crazy.

Both issues seem to have been present since at least 4.8.2.

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

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

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek  ---
Note it might be nicer to replace typedef int size_t; with something not that
wrong, say typedef __SIZE_TYPE__ size_t; if it still reproduces with that (or
replace size_t with int everywhere).

[Bug testsuite/79867] [cygwin] LD_LIBRARY_PATH ignored, contaminating (nearly?) all test results

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

mrs at gcc dot gnu.org  changed:

   What|Removed |Added

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

--- Comment #3 from mrs at gcc dot gnu.org  ---
Patch to fix most is now checked in.

[Bug testsuite/79867] [cygwin] LD_LIBRARY_PATH ignored, contaminating (nearly?) all test results

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

--- Comment #2 from mrs at gcc dot gnu.org  ---
Author: mrs
Date: Mon Apr 10 17:45:35 2017
New Revision: 246813

URL: https://gcc.gnu.org/viewcvs?rev=246813=gcc=rev
Log:
2017-04-10  Daniel Santos 

PR testsuite/79867
* lib/target-libpath.exp: Merge in cygwin fix from libffi.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/lib/target-libpath.exp

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

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

--- Comment #6 from Peter Bergner  ---
(In reply to Marek Polacek from comment #5)
> Just creduce.  I think it'd be possible to reduce it a bit more, first
> manually and then run creduce again, but it needs a bit of knowledge of C++.

Ok, in that case, I'll leave it as is.  Was just making sure you hadn't used
delta.

[Bug target/80382] 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

--- Comment #5 from Marek Polacek  ---
(In reply to Peter Bergner from comment #4)
> (In reply to Marek Polacek from comment #0)
> > This testcase (which took ~5 days of reducing) ICEs with -O3 -std=c++11
> > -mtune=power8 -mcpu=power8 -mno-lra:
> 
> Did you use creduce or delta or ??? to reduce the test case?

Just creduce.  I think it'd be possible to reduce it a bit more, first manually
and then run creduce again, but it needs a bit of knowledge of C++.

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

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

--- Comment #3 from Martin Sebor  ---
The warning does just what it's designed to do: point out the potential
unhandled truncation.  If the argument values are such that the truncation
cannot occur then using snprintf is unnecessary and sprintf can be used
instead.  Otherwise, if there is a combination of argument values that can
result in truncation a warning is issued.  Note that the length of output
produced by each directive can be constrained by specifying a precision for %s
(e.g., "%.24s" if arena->m_name in the LibreOffice code cannot be longer than
24 characters), or by asserting that an integer argument is in some limited
range of its type (or by using a narrower type to store it).

Like all warnings that depend on data flow analysis it is subject to false
positives but there is no evidence to suggest that on balance it's unhelpful or
difficult to use.  Quite the contrary.

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

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

--- Comment #4 from Peter Bergner  ---
(In reply to Marek Polacek from comment #0)
> This testcase (which took ~5 days of reducing) ICEs with -O3 -std=c++11
> -mtune=power8 -mcpu=power8 -mno-lra:

Did you use creduce or delta or ??? to reduce the test case?

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

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

--- Comment #3 from Peter Bergner  ---
I'll have a look.

[Bug target/80382] 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

--- Comment #2 from Marek Polacek  ---
(In reply to Bill Schmidt from comment #1)
> You didn't fill in the target.  32/64-bit, little-/big-endian?

64-bit, and I think it ICEs on both BE and LE.

[Bug sanitizer/80348] [6 Regression] UBSAN: compile time crash in ubsan_instrument_division

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

Marek Polacek  changed:

   What|Removed |Added

Summary|[6/7 Regression] UBSAN: |[6 Regression] UBSAN:
   |compile time crash in   |compile time crash in
   |ubsan_instrument_division   |ubsan_instrument_division

--- Comment #10 from Marek Polacek  ---
Fixed on trunk so far.

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

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

--- Comment #1 from Bill Schmidt  ---
You didn't fill in the target.  32/64-bit, little-/big-endian?

[Bug sanitizer/80348] [6/7 Regression] UBSAN: compile time crash in ubsan_instrument_division

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

--- Comment #9 from Marek Polacek  ---
Author: mpolacek
Date: Mon Apr 10 17:18:15 2017
New Revision: 246812

URL: https://gcc.gnu.org/viewcvs?rev=246812=gcc=rev
Log:
PR sanitizer/80348
* typeck.c (cp_build_binary_op): Use NULL_TREE instead of NULL.  Set
ORIG_TYPE earlier and not only when shortening.

* g++.dg/ubsan/div-by-zero-3.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/ubsan/div-by-zero-3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/80265] __builtin_{memcmp,memchr,strlen} are not usable in constexpr functions

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

--- Comment #10 from Jakub Jelinek  ---
I don't think it works that well.
Consider:
int
str6 (int a)
{
  char s[] = "strabcdefgh";
  s[2] = a;
  return ce_char_traits::length(s);
}

int
str7 (int a)
{
  char s[] = "strabcdefgh";
  s[2] = a;
  return __builtin_strlen(s);
}

The latter is compiled into standard strlen sequence, depending on tuning etc.,
the former is always the constexpr_strlen loop at runtime.

[Bug tree-optimization/80153] ivopt generate wrong code

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

--- Comment #9 from amker at gcc dot gnu.org ---
Author: amker
Date: Mon Apr 10 16:54:14 2017
New Revision: 246811

URL: https://gcc.gnu.org/viewcvs?rev=246811=gcc=rev
Log:
PR tree-optimization/80153
* tree-ssa-loop-ivopts.c (add_iv_candidate_for_use): Check and 
remove POINTER_PLUS_EXPR's base part directly, rather than through
aff_tree.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-ssa-loop-ivopts.c

[Bug tree-optimization/80153] ivopt generate wrong code

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

--- Comment #8 from amker at gcc dot gnu.org ---
Author: amker
Date: Mon Apr 10 16:51:44 2017
New Revision: 246810

URL: https://gcc.gnu.org/viewcvs?rev=246810=gcc=rev
Log:
PR tree-optimization/80153
* tree-affine.c (aff_combination_to_tree): Get base pointer from
the first element of pointer type aff_tree.  Build result expr in
aff_tree's type.
(add_elt_to_tree): Convert to type unconditionally.  Remove other
fold_convert calls.
* tree-ssa-loop-ivopts.c (alloc_iv): Pass in consistent types.
(rewrite_use_nonlinear_expr): Check invariant using iv information.
gcc/testsuite
PR tree-optimization/80153
* gcc.c-torture/execute/pr80153.c: New.

Added:
trunk/gcc/testsuite/gcc.c-torture/execute/pr80153.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-affine.c
trunk/gcc/tree-ssa-loop-ivopts.c

[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 wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80357

--- Comment #9 from Bill Schmidt  ---
(In reply to Jakub Jelinek from comment #8)
> (In reply to Bill Schmidt from comment #6)
> > That revision enabled -fsched-pressure by default, so it may have been
> > latent with -fsched-pressure before then.
> 
> No, r243865 does not ICE with -O3 -fsched-pressure.

OK, --param-sched-pressure-algorithm=2 must also be needed.

[Bug c++/80265] __builtin_{memcmp,memchr,strlen} are not usable in constexpr functions

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

--- Comment #9 from Pedro Alves  ---
FWIW, I've tried to poke a bit more at this, to try to make it _not_ work, but
couldn't.  It seems to always do what we need.  These all work/compile too:


constexpr int constexpr_strcmp(const char *s1, const char *s2)
{
  while (*s1 != '\0' && *s1 == *s2)
{
  s1++;
  s2++;
}

  if (*s1 < *s2)
return -1;
  else if (*s1 > *s2)
return 1;
  return 0;
}

constexpr int my_strcmp(const char *s1, const char *s2)
{
  if (__builtin_constant_p (s1[0])
  && __builtin_constant_p (s2[0]))
return constexpr_strcmp (s1, s2);

  return strcmp (s1, s2);
}

constexpr bool str4()
{
  char s[4]= {};
  int i = 0;
  for (; i < 3; i++)
s[i] = i + 1;
  return ce_char_traits::length(s) == 3;
}

static_assert( str4() );

constexpr int foo (char x, char y)
{
  char a[10] = "abcde";
  a[2] = x;
  a[4] = y;
  return ce_char_traits::length(a);
}

static_assert (foo ('1', '2') == 5);
static_assert (foo ('1', '\0') == 4);

bool runtime()
{
  char s[] = "str";
  s[0] = 'l';
  s[1] = '\0';
  return ce_char_traits::length(s) == 1;
}

bool runtime2()
{
  char s[4]= {};
  int i = 0;
  for (; i < 3; i++)
s[i] = i + 1;
  return ce_char_traits::length(s) == 3;
}

bool runtime3()
{
  constexpr char s[] = "str";
  return ce_char_traits::length(s) == 1;
}

int main ()
{
  assert (runtime ());
  assert (runtime2 ());
  assert (runtime3 ());
}

static_assert (my_strcmp("hello", "hello") == 0);
static_assert (my_strcmp("hello", "hell2") > 0);
static_assert (my_strcmp("hell2", "hello") < 0);


And I confirmed that "constexpr_strlen" / "constexpr_strcmp" are NOT emitted /
called as runtime functions, both at -O0 and -O2.

[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

--- Comment #8 from Jakub Jelinek  ---
(In reply to Bill Schmidt from comment #6)
> That revision enabled -fsched-pressure by default, so it may have been
> latent with -fsched-pressure before then.

No, r243865 does not ICE with -O3 -fsched-pressure.

[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 pthaugen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80357

--- Comment #7 from Pat Haugen  ---
(In reply to Bill Schmidt from comment #6)
> That revision enabled -fsched-pressure by default, so it may have been
> latent with -fsched-pressure before then.

Yes, this is a latent bug in the "model" sched-pressure algorithm code. I can
reproduce it with r243865 (revision before I turned on -fsched-pressure for
powerpc) by adding -fsched-pressure --param sched-pressure-algorithm=2.

I'll do some digging.

[Bug c++/60685] exception not caught by enclosing catch

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

--- Comment #7 from Jonathan Wakely  ---
(In reply to Dave McMordie from comment #6)
> Any sense of a minimal patch to fix this issue?

At a wild guess, I'd say it might be one of r209907 or r216750, which both look
quite involved and probably not possible to backport to a gcc-4.9 tree.

[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 wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80357

--- Comment #6 from Bill Schmidt  ---
That revision enabled -fsched-pressure by default, so it may have been latent
with -fsched-pressure before then.

[Bug tree-optimization/80293] [6/7 Regression] unnecessary code at -O2 (-O1 is fine)

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

--- Comment #5 from Martin Jambor  ---
(In reply to Richard Biener from comment #4)
> That said, the array cases we've seen are somewhat disturbing...  

Cases?  Can you point me to the other ones, please?  What type do they
have?

> maybe we can disable total scalarization for those?

The support for total scalarization of arrays was added by Alan
Lawrence as a part of constant pool SRA and I suppose that for a good
reason (the added testcases have them at least).

However, thinking about this particular testcase a bit more, I think
the most reasonable thing to do is to disable total scalarization of
char (or generally byte-sized-element) arrays.  Those are likely just
some anonymous storage anyway:

diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 02453d3ed9a..cbe9e862a2f 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -981,7 +981,7 @@ scalarizable_type_p (tree type)
   if (TYPE_DOMAIN (type) == NULL_TREE
  || !tree_fits_shwi_p (TYPE_SIZE (type))
  || !tree_fits_shwi_p (TYPE_SIZE (TREE_TYPE (type)))
- || (tree_to_shwi (TYPE_SIZE (TREE_TYPE (type))) <= 0)
+ || (tree_to_shwi (TYPE_SIZE (TREE_TYPE (type))) <= BITS_PER_UNIT)
  || !tree_fits_shwi_p (TYPE_MIN_VALUE (TYPE_DOMAIN (type
return false;
   if (tree_to_shwi (TYPE_SIZE (type)) == 0

[Bug c++/80265] __builtin_{memcmp,memchr,strlen} are not usable in constexpr functions

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

--- Comment #8 from Jonathan Wakely  ---
I think there was a bug report in the last month or so asking for some builtin
to detect when we're in a constexpr context.

[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

--- Comment #5 from Jakub Jelinek  ---
Started with r243866.

[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|RESOLVED|ASSIGNED
   Last reconfirmed||2017-04-10
 Resolution|INVALID |---
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1

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

The documentation says that it should be an immediate and only mention the insn
with the immediate.
That said, the reason why GCC accepts it is that it has magic handling for the
count argument of the 2 argument shift builtins, where it basically transforms
the count as needed depending on what it is.  This patch adds the same magic
handling to the count argument of the 4 argument shift builtins (the ones that
have the mask argument and the source for values when mask is not set).

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

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

--- Comment #26 from Jerry DeLisle  ---
(In reply to r...@cebitec.uni-bielefeld.de from comment #25)
--- snip ---
> 
> 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

I noticed those too. I will try to clean them up soon. Probably a separate
patch that does only this cleanup. Not sure where it propagated from and it
does not matter at this point, so will just fix it.

Regarding the other failure. Its hard to debug without a machine. Maye set up a
virtual machine? Is this Solaris OS available for to do this with?

[Bug libstdc++/79522] std::regex_match always returns false

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

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #4 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #2)
> But even in your second example the behaviour is correct, std::regex_match
> matches the entire string, not any part of it. "def" doesn't match "abcdefg"
> it only matches part of it. Use std::regex_search for that.

You didn't read this.

std::regex_match is only true if the entire sequence matches the regex, not
some subsequence. "def" is a subsequence of "abcdefg". std::regex_match is not
supposed to return true here. You need to use std::regex_search instead.

http://en.cppreference.com/w/cpp/regex/regex_match
http://en.cppreference.com/w/cpp/regex/regex_search

> (And "I don't know how C++ works" is still not a bug)

Still not a bug.

[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 wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80357

Bill Schmidt  changed:

   What|Removed |Added

 CC||dje at gcc dot gnu.org,
   ||pthaugen at gcc dot gnu.org,
   ||segher at gcc dot gnu.org

--- Comment #4 from Bill Schmidt  ---
Fails this assert:

  gcc_assert (MODEL_REF_PRESSURE (group, point, pci) == max_pressure);

Pat, might this be related to some of the sched-pressure class changes?

[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 wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80357

Bill Schmidt  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #3 from Bill Schmidt  ---
Confirmed.  -msecure-plt is not required.  Happens with -O3 but not with -O2.

[Bug tree-optimization/80293] [6/7 Regression] unnecessary code at -O2 (-O1 is fine)

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

--- Comment #4 from Richard Biener  ---
(In reply to Martin Jambor from comment #3)
> (In reply to Richard Biener from comment #2)
> > We have another bugreport that complains about SRA and Martin said he had
> > patches but intended to wait for GCC 8.
> 
> My patch for PR 78687 unfortunately won't help here, that one is aimed
> at making the original aggregates disappear when in fact we want to
> leave the intermediate aggregate in a chain of assignments intact,
> quite the opposite of a normal mode of operation.
> 
> > Note that I believe that store-merging, SRA (and bswap) are all passes that
> > should be merged given they perform similar analyses and transforms.
> 
> Yeah, and I am (slowly) starting to look in that direction.
> 
> However, with the totally flow-insensitive SRA we have meanwhile, the
> only remedy for this that I can think of is to throttle down total
> scalarization here to never produce more than, say,
> DECL_SIZE (candidate) / BITS_PER_WORD scalar replacements.
> 
> What do you think?

Yeah, but that's not sth for GCC 7 either.  Note that we did get better
both in FRE and DSE so we may no longer need SRA to perform some of the
optimizations [in the early pipeline].

That said, the array cases we've seen are somewhat disturbing...  maybe
we can disable total scalarization for those?

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

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

--- Comment #7 from jwjagersma at gmail dot com ---
Created attachment 41167
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41167=edit
test case

Here is a reduced test case that causes a similar (likely the same?) ICE on
i686-w64-mingw32. The line number in print_reg is different, but then this is a
different gcc version (6.3.0).
Interestingly, compiling with -O3 here prints a more sensible error message.

$ g++ -masm=intel -march=pentium3 -mstackrealign -O3 ice_print_reg.cpp
ice_print_reg.cpp: In function 'int main()':
ice_print_reg.cpp:19:30: error: 'asm' operand has impossible constraints
 : "esi", "esp", "cc");
  ^

$ g++ -masm=intel -march=pentium3 -mstackrealign ice_print_reg.cpp
ice_print_reg.cpp: In function 'int main()':
ice_print_reg.cpp:20:1: internal compiler error: in print_reg, at
config/i386/i386.c:16601
 }
 ^

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

ice_print_reg.cpp:20:1: internal compiler error: Aborted

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
g++.exe: internal compiler error: Aborted (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

$ g++ -v
Using built-in specs.
COLLECT_GCC=D:\msys64\mingw32\bin\g++.exe
COLLECT_LTO_WRAPPER=D:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/6.3.0/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: ../gcc-6.3.0/configure --prefix=/mingw32
--with-local-prefix=/mingw32/local --build=i686-w64-mingw32
--host=i686-w64-mingw32 --target=i686-w64-mingw32
--with-native-system-header-dir=/mingw32/i686-w64-mingw32/include
--libexecdir=/mingw32/lib --enable-bootstrap --with-arch=i686
--with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada
--enable-shared --enable-static --enable-libatomic --enable-threads=posix
--enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes
--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check
--enable-lto --enable-libgomp --disable-multilib --enable-checking=release
--disable-rpath --disable-win32-registry --disable-nls --disable-werror
--disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw32
--with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32
--with-pkgversion='Rev2, Built by MSYS2 project'
--with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as
--with-gnu-ld --disable-sjlj-exceptions --with-dwarf2
Thread model: posix
gcc version 6.3.0 (Rev2, Built by MSYS2 project)

[Bug rtl-optimization/70478] [LRA] S/390: Performance regression - superfluous stack frame

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

--- Comment #10 from Vladimir Makarov  ---
Author: vmakarov
Date: Mon Apr 10 14:58:33 2017
New Revision: 246808

URL: https://gcc.gnu.org/viewcvs?rev=246808=gcc=rev
Log:
2017-04-10  Vladimir Makarov  

PR rtl-optimization/70478
* lra-constraints.c (curr_small_class_check): New.
(update_and_check_small_class_inputs): New.
(process_alt_operands): Update curr_small_class_check.  Disfavor
alternative insn memory operands.  Check available regs for small
class operands.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/lra-constraints.c

[Bug target/80376] Some vec_xxpermdi usage lead to ICE

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

--- Comment #4 from Bill Schmidt  ---
Patch under test would produce the follow errors instead:

wschmidt@pike:~/src$ $GCC_INSTALL/bin/gcc pr80376.c 
pr80376.c: In function 'main':
pr80376.c:12:5: error: argument 3 must be a 2-bit unsigned literal
 vec_vsx_st(vec_xxpermdi(a, b, j), 0, c);
 ^~
pr80376.c:12:5: internal compiler error: non-vector constant found where vector
expected
0x116cde0b gen_movv4si(rtx_def*, rtx_def*)
/home/wschmidt/gcc/gcc-mainline-test/gcc/config/rs6000/vector.md:114
0x105fd113 insn_gen_fn::operator()(rtx_def*, rtx_def*) const
/home/wschmidt/gcc/gcc-mainline-test/gcc/recog.h:301
0x1077a497 emit_move_insn_1(rtx_def*, rtx_def*)
/home/wschmidt/gcc/gcc-mainline-test/gcc/expr.c:3643
0x1077ab37 emit_move_insn(rtx_def*, rtx_def*)
/home/wschmidt/gcc/gcc-mainline-test/gcc/expr.c:3738
0x107826d3 store_expr_with_bounds(tree_node*, rtx_def*, int, bool, bool,
tree_node*)
/home/wschmidt/gcc/gcc-mainline-test/gcc/expr.c:5729
0x107802a3 expand_assignment(tree_node*, tree_node*, bool)
/home/wschmidt/gcc/gcc-mainline-test/gcc/expr.c:5321
0x1056ec0b expand_call_stmt
/home/wschmidt/gcc/gcc-mainline-test/gcc/cfgexpand.c:2656
0x10572b87 expand_gimple_stmt_1
/home/wschmidt/gcc/gcc-mainline-test/gcc/cfgexpand.c:3571
0x105734c3 expand_gimple_stmt
/home/wschmidt/gcc/gcc-mainline-test/gcc/cfgexpand.c:3737
0x1057cd03 expand_gimple_basic_block
/home/wschmidt/gcc/gcc-mainline-test/gcc/cfgexpand.c:5744
0x1057ef3b execute
/home/wschmidt/gcc/gcc-mainline-test/gcc/cfgexpand.c:6357
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/80376] Some vec_xxpermdi usage lead to ICE

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

--- Comment #3 from Bill Schmidt  ---
It's difficult to completely avoid an ICE, as once we have a nested call with
an invalid value it is not simple to recover with our current design.  However,
I will put together a patch that provides better error messages when this
situation arises, and we can consider some re-design work in a later release.

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

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

--- Comment #6 from jwjagersma at gmail dot com ---
So "esp" is not a valid register to clobber? I thought it would only make the
compiler use ebp instead to reference stack memory operands. After all
esp-relative operands wouldn't be valid after a push/pop in inline asm.

Also, I identified the minimum compiler flags required to reproduce this issue:

$ /usr/local/djgpp/bin/i586-pc-msdosdjgpp-g++ -march=pentium3 -masm=intel
-mstackrealign -O3 vbe.ii
src/vbe.cpp: In member function 'virtual void
jw::video::vbe2::set_palette(const px32*, const px32*, std::size_t, bool)':
src/vbe.cpp:647:9: internal compiler error: in print_reg, at
config/i386/i386.c:16549

[Bug target/80381] 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

--- Comment #4 from Sven Woop  ---
BTW, the AVX-512 version of this "bug" also compiles with ICC and Clang 4.

[Bug target/80381] 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

--- Comment #3 from Sven Woop  ---
Right, this could be considered a user bug. However, we ran into this as we are
successfully using this code sequence in our code:

#include 

#define __forceinline inline __attribute__((always_inline))

struct vint8
{
  __forceinline vint8(const int i) 
: v(_mm256_set1_epi32(i)) {}

  __forceinline vint8(const __m256i& t) 
: v(t) {}

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

  __m256i v; 
};

vint8 test8(int shift)
{
  const vint8 blocks_add(shift);
  return blocks_add >> shift;
}


Which is essentially the same bug for AVX2. However, this code compiles with
every compiler that supports AVX2, be it GCC, Clang, or MSVC. Also the
corresponding sequence for SSE compiles with every compiler we tried so far.

I would have expected GCC to behave consistent for AVX-256 and AVX-512 for this
code.

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

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

--- Comment #2 from Jeffrey A. Law  ---
Testing a fix.

[Bug c++/80294] [5/6/7 Regression] ICE with constexpr and inheritance

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

Jason Merrill  changed:

   What|Removed |Added

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

[Bug target/80376] Some vec_xxpermdi usage lead to ICE

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

Bill Schmidt  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code

--- Comment #2 from Bill Schmidt  ---
The vec_xxpermdi interface is incorrectly documented in the GCC docs, and that
needs to be corrected.  Where you have:

vec_xxpermdi(a, b, j)

the use of j is not permitted.  The third argument to vec_xxpermdi must be a
constant in the range [0,3].  We still should not ICE, of course, but the code
as written is not expected to work.

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

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

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-04-10
 Ever confirmed|0   |1

[Bug target/80057] typo in mips.opt: Virtualization Application Specific

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

mpf at gcc dot gnu.org changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from mpf at gcc dot gnu.org ---
Fixed on trunk.

[Bug target/80057] typo in mips.opt: Virtualization Application Specific

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

--- Comment #4 from mpf at gcc dot gnu.org ---
Author: mpf
Date: Mon Apr 10 13:44:39 2017
New Revision: 246807

URL: https://gcc.gnu.org/viewcvs?rev=246807=gcc=rev
Log:
Update MIPS -mvirt option description

gcc/
PR target/80057
* config/mips/mips.opt (-mvirt): Update description.
* doc/invoke.texi (-mvirt): Likewise.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/mips/mips.opt
trunk/gcc/doc/invoke.texi

[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 doko at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80357

Matthias Klose  changed:

   What|Removed |Added

 Status|WAITING |UNCONFIRMED
 Ever confirmed|1   |0

--- Comment #2 from Matthias Klose  ---
$ cat ./dpdk-16.11.1/igb_ethdev.i
typedef char a;
a b, c;
int d, e;
void f(void *g) { *(volatile int *)g; }
void j() {
  a h, i;
  for (; b; b += 2) {
d = b;
i = i >> b;
if (i)
  continue;
f( + (b >> 2));
h = 0;
for (; h < 8 / 2; h++)
  if (i << h)
e = 0;
  }
}

[Bug tree-optimization/79390] [7 Regression] 10% performance drop in SciMark2 LU after r242550

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

--- Comment #22 from Richard Biener  ---
(In reply to rguent...@suse.de from comment #21)
> On April 7, 2017 6:57:13 PM GMT+02:00, "jakub at gcc dot gnu.org"
>  wrote:
> >https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79390
> >
> >--- Comment #20 from Jakub Jelinek  ---
> >So, Richard, any thoughts on what can be done split paths to avoid
> >this?
> 
> Invent some new heuristic that avoids splitting this case...

Index: gcc/gimple-ssa-split-paths.c
===
--- gcc/gimple-ssa-split-paths.c(revision 246803)
+++ gcc/gimple-ssa-split-paths.c(working copy)
@@ -249,13 +249,17 @@ is_feasible_trace (basic_block bb)
  imm_use_iterator iter2;
  FOR_EACH_IMM_USE_FAST (use2_p, iter2, gimple_phi_result
(stmt))
{
- if (is_gimple_debug (USE_STMT (use2_p)))
+ gimple *use_stmt = USE_STMT (use2_p);
+ if (is_gimple_debug (use_stmt))
continue;
- basic_block use_bb = gimple_bb (USE_STMT (use2_p));
+ basic_block use_bb = gimple_bb (use_stmt);
  if (use_bb != bb
  && dominated_by_p (CDI_DOMINATORS, bb, use_bb))
{
- found_useful_phi = true;
+ if (gcond *cond = dyn_cast  (use_stmt))
+   if (gimple_cond_code (cond) == EQ_EXPR
+   || gimple_cond_code (cond) == NE_EXPR)
+ found_useful_phi = true;
  break;
}
}

avoids the splitting at at least passes tree-ssa.exp testing.  Throwing it
on full testing (there are some path splitting testcases randomly placed
IIRC).

[Bug tree-optimization/80293] [6/7 Regression] unnecessary code at -O2 (-O1 is fine)

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

--- Comment #3 from Martin Jambor  ---
(In reply to Richard Biener from comment #2)
> We have another bugreport that complains about SRA and Martin said he had
> patches but intended to wait for GCC 8.

My patch for PR 78687 unfortunately won't help here, that one is aimed
at making the original aggregates disappear when in fact we want to
leave the intermediate aggregate in a chain of assignments intact,
quite the opposite of a normal mode of operation.

> Note that I believe that store-merging, SRA (and bswap) are all passes that
> should be merged given they perform similar analyses and transforms.

Yeah, and I am (slowly) starting to look in that direction.

However, with the totally flow-insensitive SRA we have meanwhile, the
only remedy for this that I can think of is to throttle down total
scalarization here to never produce more than, say,
DECL_SIZE (candidate) / BITS_PER_WORD scalar replacements.

What do you think?

[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

--- Comment #5 from Richard Biener  ---
Author: rguenth
Date: Mon Apr 10 13:02:12 2017
New Revision: 246805

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

PR middle-end/80362
* fold-const.c (fold_binary_loc): Look at unstripped ops when
looking for NEGATE_EXPR in -A / -B to A / B folding.

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

Added:
trunk/gcc/testsuite/gcc.dg/torture/pr80362.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog

  1   2   >