[Bug c++/81247] New: ICE on invalid C++ code with malformed namespace declaration: in do_push_nested_namespace, at cp/name-lookup.c:6002

2017-06-28 Thread su at cs dot ucdavis.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81247

Bug ID: 81247
   Summary: ICE on invalid C++ code with malformed namespace
declaration: in do_push_nested_namespace, at
cp/name-lookup.c:6002
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 8.0.0 20170629 (experimental) [trunk revision 249769] (GCC) 
$ 
$ g++-trunk -c small.cpp
small.cpp:2:1: error: expected ‘{’ before ‘template’
 template < typename T > class A
 ^~~~
small.cpp: In instantiation of ‘class N::A’:
small.cpp:10:14:   required from here
small.cpp:3:1: internal compiler error: in do_push_nested_namespace, at
cp/name-lookup.c:6002
 {
 ^
0x7c73e0 do_push_nested_namespace
../../gcc-source-trunk/gcc/cp/name-lookup.c:5999
0x7c740c push_nested_namespace(tree_node*)
../../gcc-source-trunk/gcc/cp/name-lookup.c:6290
0x880845 tsubst_friend_class
../../gcc-source-trunk/gcc/cp/pt.c:9995
0x880845 instantiate_class_template_1
../../gcc-source-trunk/gcc/cp/pt.c:10725
0x880845 instantiate_class_template(tree_node*)
../../gcc-source-trunk/gcc/cp/pt.c:10923
0x8dac2a complete_type(tree_node*)
../../gcc-source-trunk/gcc/cp/typeck.c:134
0x7232e8 start_decl_1(tree_node*, bool)
../../gcc-source-trunk/gcc/cp/decl.c:5147
0x749c0d start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
../../gcc-source-trunk/gcc/cp/decl.c:5110
0x806698 cp_parser_init_declarator
../../gcc-source-trunk/gcc/cp/parser.c:19410
0x809308 cp_parser_simple_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12945
0x80a0a1 cp_parser_block_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12763
0x80ab08 cp_parser_declaration_statement
../../gcc-source-trunk/gcc/cp/parser.c:12357
0x7ed5b7 cp_parser_statement
../../gcc-source-trunk/gcc/cp/parser.c:10840
0x7ee4df cp_parser_statement_seq_opt
../../gcc-source-trunk/gcc/cp/parser.c:11176
0x7ee5cf cp_parser_compound_statement
../../gcc-source-trunk/gcc/cp/parser.c:11130
0x8056cf cp_parser_function_body
../../gcc-source-trunk/gcc/cp/parser.c:21592
0x8056cf cp_parser_ctor_initializer_opt_and_function_body
../../gcc-source-trunk/gcc/cp/parser.c:21628
0x806171 cp_parser_function_definition_after_declarator
../../gcc-source-trunk/gcc/cp/parser.c:26460
0x806ecd cp_parser_function_definition_from_specifiers_and_declarator
../../gcc-source-trunk/gcc/cp/parser.c:26372
0x806ecd cp_parser_init_declarator
../../gcc-source-trunk/gcc/cp/parser.c:19312
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
$ 


-


namespace N 
template < typename T > class A
{
  template < T > friend class N;
};

void f ()
{
  A < int > a1;
  A < char > a2;
}

[Bug c++/81246] New: ICC on invalid C++ code (with a non-type template parameter having type 'float'): Segmentation fault

2017-06-28 Thread su at cs dot ucdavis.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81246

Bug ID: 81246
   Summary: ICC on invalid C++ code (with a non-type template
parameter having type 'float'): Segmentation fault
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 8.0.0 20170629 (experimental) [trunk revision 249769] (GCC)
$
$ g++-trunk -c small.cpp
small.cpp: In instantiation of ‘class N::A’:
small.cpp:8:15:   required from here
small.cpp:5:33: error: ‘float’ is not a valid type for a template non-type
parameter
 template < T > friend class B;
 ^
small.cpp:3:33: internal compiler error: Segmentation fault
   template < typename T > class A
 ^
0xe44eff crash_signal
../../gcc-source-trunk/gcc/toplev.c:338
0x6be3e3 tree_class_check
../../gcc-source-trunk/gcc/tree.h:3205
0x6be3e3 pop_nested_class()
../../gcc-source-trunk/gcc/cp/class.c:7985
0x87ec99 instantiate_class_template_1
../../gcc-source-trunk/gcc/cp/pt.c:10899
0x87ec99 instantiate_class_template(tree_node*)
../../gcc-source-trunk/gcc/cp/pt.c:10923
0x8dac2a complete_type(tree_node*)
../../gcc-source-trunk/gcc/cp/typeck.c:134
0x7232e8 start_decl_1(tree_node*, bool)
../../gcc-source-trunk/gcc/cp/decl.c:5147
0x749c0d start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
../../gcc-source-trunk/gcc/cp/decl.c:5110
0x806698 cp_parser_init_declarator
../../gcc-source-trunk/gcc/cp/parser.c:19410
0x809308 cp_parser_simple_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12945
0x80a0a1 cp_parser_block_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12763
0x811bc0 cp_parser_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12660
0x810894 cp_parser_declaration_seq_opt
../../gcc-source-trunk/gcc/cp/parser.c:12536
0x810f6c cp_parser_namespace_body
../../gcc-source-trunk/gcc/cp/parser.c:18424
0x810f6c cp_parser_namespace_definition
../../gcc-source-trunk/gcc/cp/parser.c:18403
0x811ceb cp_parser_declaration
../../gcc-source-trunk/gcc/cp/parser.c:12644
0x810894 cp_parser_declaration_seq_opt
../../gcc-source-trunk/gcc/cp/parser.c:12536
0x810bd8 cp_parser_translation_unit
../../gcc-source-trunk/gcc/cp/parser.c:4386
0x810bd8 c_parse_file()
../../gcc-source-trunk/gcc/cp/parser.c:38642
0x9590e5 c_common_parse_file()
../../gcc-source-trunk/gcc/c-family/c-opts.c:1104
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
$


---


namespace N
{ 
  template < typename T > class A
  { 
template < T > friend class B;
  };

  A < float > a;
}

[Bug tree-optimization/81245] [8 Regression] ICE building calculix with -Ofast

2017-06-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81245

--- Comment #1 from Andrew Pinski  ---
The full ICE:
during GIMPLE pass: vect
dump file: t.c.159t.vect
t.c: In function 'f':
t.c:13:6: internal compiler error: Segmentation fault
 void f(void)
  ^
0xb2d137 crash_signal
../../gcc/gcc/toplev.c:338
0x6f53b4 flow_bb_inside_loop_p(loop const*, basic_block_def const*)
../../gcc/gcc/cfgloop.c:794
0xd82b5b vect_stmt_relevant_p
../../gcc/gcc/tree-vect-stmts.c:326
0xd8366f vect_mark_stmts_to_be_vectorized(_loop_vec_info*)
../../gcc/gcc/tree-vect-stmts.c:664
0xdae127 vect_analyze_loop_2
../../gcc/gcc/tree-vect-loop.c:1944
0xdae127 vect_analyze_loop(loop*, _loop_vec_info*)
../../gcc/gcc/tree-vect-loop.c:2403
0xdc4e4f vectorize_loops()
../../gcc/gcc/tree-vectorizer.c:614
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug tree-optimization/81245] [8 Regression] ICE building calculix with -Ofast

2017-06-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81245

Andrew Pinski  changed:

   What|Removed |Added

Version|7.0 |8.0
   Target Milestone|--- |8.0

[Bug tree-optimization/81245] New: [8 Regression] ICE building calculix with -Ofast

2017-06-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81245

Bug ID: 81245
   Summary: [8 Regression] ICE building calculix with -Ofast
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
Target: aarch64-linux-gnu

This started with my copysign patch.
Here is a reduced testcase:
double sg[18];
void f(void)
{
  for (int i = 0 ;i < 18;i++)
  {
if (sg[i] < 0.0)
  sg[i] = -1.0;
else
  sg[i] = 1.0;
  }
}
 CUT ---
Compile with -Ofast.
0x6f53b4 flow_bb_inside_loop_p(loop const*, basic_block_def const*)
../../gcc/gcc/cfgloop.c:794
0xd82b5b vect_stmt_relevant_p
../../gcc/gcc/tree-vect-stmts.c:326
0xd8366f vect_mark_stmts_to_be_vectorized(_loop_vec_info*)
../../gcc/gcc/tree-vect-stmts.c:664
0xdae127 vect_analyze_loop_2
../../gcc/gcc/tree-vect-loop.c:1944
0xdae127 vect_analyze_loop(loop*, _loop_vec_info*)
../../gcc/gcc/tree-vect-loop.c:2403
0xdc4e4f vectorize_loops()
../../gcc/gcc/tree-vectorizer.c:614
Please submit a full bug report,


>From what I can tell, is ifcvt clones the loop and ifconverts that loop only
and enables it only for vectorization and that cloned loop has the
a>0.0?1.0:-1.0 optimized to copysign.

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

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80384

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||jason at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|--- |7.2

--- Comment #4 from Jason Merrill  ---
Fixed.

[Bug c++/79056] [7/8 Regression] [C++17] ICE with broken deduction guide / broken template parameter

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79056

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||jason at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|--- |7.2

--- Comment #6 from Jason Merrill  ---
Fixed.

[Bug c++/78623] non-dependent name treated as if it were dependent, requiring use of template keyword

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78623

Jason Merrill  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||jason at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|--- |7.0

--- Comment #3 from Jason Merrill  ---
Fixed in GCC 7.

[Bug c++/72801] ICE on invalid C++ code with ill-formed class member specialization: tree check: expected class ‘expression’, have ‘type’ (integer_type) in tree_operand_check, at tree.h:3521

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72801

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.2

--- Comment #8 from Jason Merrill  ---
Fixed for 7.2.

[Bug c++/69300] g++ segfault on silly noexcept case

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69300

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |8.0

--- Comment #3 from Jason Merrill  ---
Fixed for GCC 8.

[Bug c++/55639] Partial nested template specialization leads to segmentation fault of g++

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55639

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |8.0

--- Comment #5 from Jason Merrill  ---
(In reply to Paolo Carlini from comment #1)
> The issue is the 'template' keyword in:
> 
> SomeClass::template Fun

Indeed, the keyword is not allowed in a class-head-name:

The keyword template is said to appear at the top level in a qualified-id if it
appears outside of a template-argument-list or decltype-specifier. In a
qualified-id of a declarator-id or in a qualified-id formed by a
class-head-name or enum-head-name, the keyword template shall not appear at the
top level.

For GCC 8, I've fixed G++ to accept it with a pedwarn.

[Bug c/81244] Odd things happening with always_inline on 32bit

2017-06-28 Thread tarceri at itsqueeze dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81244

--- Comment #3 from Timothy Arceri  ---
No change with -fno-strict-aliasing

-fwarpv is not geting past config with warnings such as:

   WARNING: sys/sysmacros.h: present but cannot be compiled

[Bug c/81244] Odd things happening with always_inline on 32bit

2017-06-28 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81244

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-06-29
 Ever confirmed|0   |1

--- Comment #2 from Andrew Pinski  ---
This sounds like maybe some undefined code that only shows up with
always_inline and maybe 32bit x86.
Can you attach the preprocessed source of where the always_inline makes a
difference?
Also can you try with -fwarpv (turns signed integer overflow to be defined as
overflow) -fno-strict-aliasing (turns aliasing issues from undefined to being
defined)?

[Bug c/81244] Odd things happening with always_inline on 32bit

2017-06-28 Thread tarceri at itsqueeze dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81244

Timothy Arceri  changed:

   What|Removed |Added

URL||https://bugs.freedesktop.or
   ||g/show_bug.cgi?id=101613

--- Comment #1 from Timothy Arceri  ---
Adding url to Mesa bug report.

[Bug c/81244] New: Odd things happening with always_inline on 32bit

2017-06-28 Thread tarceri at itsqueeze dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81244

Bug ID: 81244
   Summary: Odd things happening with always_inline on 32bit
   Product: gcc
   Version: 7.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tarceri at itsqueeze dot com
  Target Milestone: ---

Problem:

When running an OpenGL regression test against a recent change in Mesa git
which uses always_inline, we are getting odd results. 64bit builds seem to be
working fine, it's just 32bit with a problem.

gcc 6.3.1 and gcc 7.1 have both been confirmed to have the same issue.

If I remove always_inline the problem goes away.

Code:

always_inline was added in this commit [1], but it wasn't until a second user
of the inlined function was added that the problem began [2]. 

[1]
https://cgit.freedesktop.org/mesa/mesa/commit/?id=ca5f1e82de7e43eecb00843597688801809cc22e
[2]
https://cgit.freedesktop.org/mesa/mesa/commit/?id=bc0af44a5ae9a6671cc6c2f5a380d86fd7babacb

Reproducing:

I've only tested the issue on Intel gpu's so far, but likely exists on all
drivers. It should be reproducible on Sandy Bridge and later. 

1. Build the a 32 versions of piglit [1] and mesa [2] from git.
2. Set LD_LIBRARY_PATH to the new Mesa libs and run the following tests from
the piglit git directory.

  ./bin/shader_runner
tests/spec/arb_shader_bit_encoding/execution/and-clamp.shader_test -auto -fbo

If you have any questions about this please ask for help on the #dri-devel or
#intel-gfx freenode channels. My nick is tarceri but there should be someone
who can help if I'm not around.

[1] git://anongit.freedesktop.org/piglit
[2] git://anongit.freedesktop.org/mesa/mesa

[Bug fortran/81241] write end of file

2017-06-28 Thread jvdelisle at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81241

Jerry DeLisle  changed:

   What|Removed |Added

 CC||jvdelisle at gcc dot gnu.org

--- Comment #4 from Jerry DeLisle  ---
We had to do significant changes to support DTIO and internal units. A stack is
used to hold unit information as execution passes between parent and child I/O
statements. That bug was discovered and fixed by Jim. So I hope you can try 7.2
or latest trunk, 8.0 and confirm.

[Bug rtl-optimization/81194] [8 Regression] ICE during RTL pass: expand

2017-06-28 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81194

--- Comment #14 from Peter Bergner  ---
...or maybe simpler even would be:

Index: gcc/cfgexpand.c
===
--- gcc/cfgexpand.c (revision 249649)
+++ gcc/cfgexpand.c (working copy)
@@ -3566,7 +3566,13 @@ expand_gimple_stmt_1 (gimple *stmt)
 case GIMPLE_PREDICT:
   break;
 case GIMPLE_SWITCH:
-  expand_case (as_a  (stmt));
+  {
+   gswitch *swtch = as_a  (stmt);
+   if (gimple_switch_num_labels (swtch) == 1)
+ expand_goto (CASE_LABEL (gimple_switch_default_label (swtch)));
+   else
+ expand_case (swtch);
+  }
   break;
 case GIMPLE_ASM:
   expand_asm_stmt (as_a  (stmt));

[Bug c++/54769] [Core/1111] dependent class method template not found if structure template with the same name is visible

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54769

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||jason at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org
   Target Milestone|--- |8.0

--- Comment #6 from Jason Merrill  ---
Fixed for GCC 8; I may backport to 7 if there are no problems.

[Bug c++/61022] [C++11] Bogus "error: parameter packs not expanded with '...'"

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61022

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.2

--- Comment #6 from Jason Merrill  ---
Fixed for 7.2.

[Bug rtl-optimization/81194] [8 Regression] ICE during RTL pass: expand

2017-06-28 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81194

Peter Bergner  changed:

   What|Removed |Added

  Attachment #41647|0   |1
is obsolete||

--- Comment #13 from Peter Bergner  ---
Created attachment 41648
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41648=edit
Updated patch

Ok, trying to call cleanup_tree_cfg() was a never ending cascade of failures,
so I'm giving up on that.  This patch instead catches the special case in
expand_case() which we have 1 case statement and instead calls expand_goto()
with that case statement's label.  Much smaller patch which fixes the ICE and
seems to be making much better progress on bootstrapping.

[Bug c++/81204] [7/8 Regression] Rejects boost headers

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81204

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #7 from Jason Merrill  ---
Fixed for 7.2.

[Bug c++/72801] ICE on invalid C++ code with ill-formed class member specialization: tree check: expected class ‘expression’, have ‘type’ (integer_type) in tree_operand_check, at tree.h:3521

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72801

--- Comment #7 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 21:08:50 2017
New Revision: 249762

URL: https://gcc.gnu.org/viewcvs?rev=249762=gcc=rev
Log:
PR c++/72801 - ICE with variadic partial specialization

* pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp0x/variadic-partial1.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/pt.c

[Bug c++/61022] [C++11] Bogus "error: parameter packs not expanded with '...'"

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61022

--- Comment #5 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 21:08:58 2017
New Revision: 249763

URL: https://gcc.gnu.org/viewcvs?rev=249763=gcc=rev
Log:
PR c++/61022 - error with variadic template template parm

* pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp0x/variadic-ttp8.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/pt.c

[Bug c++/81204] [7/8 Regression] Rejects boost headers

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81204

--- Comment #6 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 21:08:43 2017
New Revision: 249761

URL: https://gcc.gnu.org/viewcvs?rev=249761=gcc=rev
Log:
PR c++/81204 - parse error with dependent template-name

* parser.c (cp_parser_lookup_name): Disqualify function templates
after lookup.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/template/lookup10.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/parser.c

[Bug c++/72764] [5/6/7/8 Regression] ICE on invalid C++11 code instantiating an alias template: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in typedef_variant_p, at tree.c:12660

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72764

--- Comment #8 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 21:06:35 2017
New Revision: 249760

URL: https://gcc.gnu.org/viewcvs?rev=249760=gcc=rev
Log:
PR c++/72764 - ICE with invalid template typename.

* decl.c (build_typename_type): No longer static.
* tree.c (strip_typedefs): Use it instead of make_typename_type.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/alias-decl-60.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/tree.c

[Bug ada/81243] New: gnat run time library: Ada.Locales ignores setting of LANG

2017-06-28 Thread nicolas.boulenguez at free dot fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81243

Bug ID: 81243
   Summary: gnat run time library: Ada.Locales ignores setting of
LANG
   Product: gcc
   Version: 7.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ada
  Assignee: unassigned at gcc dot gnu.org
  Reporter: nicolas.boulenguez at free dot fr
  Target Milestone: ---

Hello.
The visible symptoms are described at https://bugs.debian.org/864969.
gcc/ada/a-locales.adb is a wrapper to gcc/ada/locales.c,
which always returns the same value.

[Bug c++/69300] g++ segfault on silly noexcept case

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69300

--- Comment #2 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 20:02:12 2017
New Revision: 249757

URL: https://gcc.gnu.org/viewcvs?rev=249757=gcc=rev
Log:
PR c++/69300 - ICE with self-referential noexcept

* pt.c (maybe_instantiate_noexcept): Check for recursion.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/noexcept30.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c

[Bug c++/72801] ICE on invalid C++ code with ill-formed class member specialization: tree check: expected class ‘expression’, have ‘type’ (integer_type) in tree_operand_check, at tree.h:3521

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72801

--- Comment #6 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 19:59:37 2017
New Revision: 249755

URL: https://gcc.gnu.org/viewcvs?rev=249755=gcc=rev
Log:
PR c++/72801 - ICE with variadic partial specialization

* pt.c (unify_pack_expansion): Use PACK_EXPANSION_EXTRA_ARGS.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/variadic-partial1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c

[Bug c++/61022] [C++11] Bogus "error: parameter packs not expanded with '...'"

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61022

--- Comment #4 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 19:59:44 2017
New Revision: 249756

URL: https://gcc.gnu.org/viewcvs?rev=249756=gcc=rev
Log:
PR c++/61022 - error with variadic template template parm

* pt.c (convert_template_argument): Keep the TYPE_PACK_EXPANSION.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/variadic-ttp8.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c

[Bug c++/45976] optional template keyword is not accepted by g++

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45976

--- Comment #2 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 19:41:43 2017
New Revision: 249753

URL: https://gcc.gnu.org/viewcvs?rev=249753=gcc=rev
Log:
PR c++/45976 - error with ::template in declarator.

* pt.c (resolve_typename_type): Fix TEMPLATE_ID_EXPR handling.

Added:
trunk/gcc/testsuite/g++.dg/template/template-keyword1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c

[Bug c++/55639] Partial nested template specialization leads to segmentation fault of g++

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55639

--- Comment #4 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 19:41:49 2017
New Revision: 249754

URL: https://gcc.gnu.org/viewcvs?rev=249754=gcc=rev
Log:
PR c++/55639 - partial specialization with ::template

* parser.c (cp_parser_class_head): Handle ::template.

Added:
trunk/gcc/testsuite/g++.dg/template/partial-specialization8.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c

[Bug c++/54769] [Core/1111] dependent class method template not found if structure template with the same name is visible

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54769

--- Comment #5 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 19:41:36 2017
New Revision: 249752

URL: https://gcc.gnu.org/viewcvs?rev=249752=gcc=rev
Log:
PR c++/54769 - wrong lookup of dependent template-name.

* parser.c (cp_parser_template_name): Handle dependent object type.
(cp_parser_nested_name_specifier_opt): Make template_keyword_p a
parameter.
(cp_parser_id_expression): Pass it.
(cp_parser_diagnose_invalid_type_name): Handle TEMPLATE_ID_EXPR.

Added:
trunk/gcc/testsuite/g++.dg/template/lookup11.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c

[Bug c++/81204] [7/8 Regression] Rejects boost headers

2017-06-28 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81204

--- Comment #5 from Jason Merrill  ---
Author: jason
Date: Wed Jun 28 19:41:18 2017
New Revision: 249750

URL: https://gcc.gnu.org/viewcvs?rev=249750=gcc=rev
Log:
PR c++/81204 - parse error with dependent template-name

* parser.c (cp_parser_lookup_name): Disqualify function templates
after lookup.

Added:
trunk/gcc/testsuite/g++.dg/template/lookup10.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c

[Bug rtl-optimization/81194] [8 Regression] ICE during RTL pass: expand

2017-06-28 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81194

--- Comment #12 from Peter Bergner  ---
(In reply to Peter Bergner from comment #11)
> (In reply to Peter Bergner from comment #10)
> > I'm testing the attached patch which fixes the ICE.
> 
> Except this ICEs on the following simple test case.  I'll see if this is due
> to a simple oversite or ...
[snip]
> It seems cleanup_tree_cfg() has removed the entire function at this point.

So with no function body, build_gimple_cfg() calls make_edges() and it contains
an assumption that there will be a block in the function with this code:

  /* Create an edge from entry to the first block with executable
 statements in it.  */
  make_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun),
 BASIC_BLOCK_FOR_FN (cfun, NUM_FIXED_BLOCKS),
 EDGE_FALLTHRU);

but in this case, there is no block numbered NUM_FIXED_BLOCKS which causes
find_edge to ICE.

[Bug ipa/81238] Target clone support does not make default clone static.

2017-06-28 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81238

Michael Meissner  changed:

   What|Removed |Added

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

--- Comment #3 from Michael Meissner  ---
Fixed in subversion id 249737.

[Bug fortran/78387] OpenMP segfault/stack size exceeded writing to internal file

2017-06-28 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78387

Jim Wilson  changed:

   What|Removed |Added

 CC||wilson at gcc dot gnu.org

--- Comment #7 from Jim Wilson  ---
The testcase can trigger the bug fixed in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81195
if the number of threads is high enough.  It also triggers an unrelated problem
which gives the stack size exceeded error.

Looking at this issue, I see that in libgfortran/io/unit.c, the newunit_alloc
function starts with
  newunits = xcalloc (16, 1);
  newunit_size = 16;
and then if we need more of them, it does
  newunit_size *= 2;
  newunits = xrealloc (newunits, newunit_size);

However, for stash_internal_unit, we have as global definitions
  #define NEWUNIT_STACK_SIZE 16
  static gfc_saved_unit newunit_stack[NEWUNIT_STACK_SIZE];
and inside the function we have
  if (newunit_tos >= NEWUNIT_STACK_SIZE)

When the testcase fails, newunit_size is 32.  So we have allocated more units
than we can stash.

It looks like the fix is to change stash_internal_unit to dynamically resize
newunit_stack, same as the newunit_alloc function already does for newunits. 
This appears related to bug 48587, which added the code to increase the size of
newunits array.

[Bug rtl-optimization/81194] [8 Regression] ICE during RTL pass: expand

2017-06-28 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81194

--- Comment #11 from Peter Bergner  ---
(In reply to Peter Bergner from comment #10)
> I'm testing the attached patch which fixes the ICE.

Except this ICEs on the following simple test case.  I'll see if this is due to
a simple oversite or ...

bergner@pike:~/gcc/BUGS/PR81194$ cat swtch.i 
int a;
void
b (void)
{
  switch (a)
{
  case 6:
  default:
break;
}
}
bergner@pike:~/gcc/BUGS/PR81194$
/home/bergner/gcc/build/gcc-fsf-mainline-pr81194-x86_64-debug/gcc/xgcc
-B/home/bergner/gcc/build/gcc-fsf-mainline-pr81194-x86_64-debug/gcc -O2 -S
swtch.i
during GIMPLE pass: cfg
swtch.i: In function ‘b’:
swtch.i:3:1: internal compiler error: Segmentation fault
 b (void)
 ^
0x10e97613 crash_signal
/home/bergner/gcc/gcc-fsf-mainline-pr80775/gcc/toplev.c:338
0x1060bcb8 find_edge(basic_block_def*, basic_block_def*)
/home/bergner/gcc/gcc-fsf-mainline-pr80775/gcc/cfganal.c:498
0x11ce3783 make_edge(basic_block_def*, basic_block_def*, int)
/home/bergner/gcc/gcc-fsf-mainline-pr80775/gcc/cfg.c:315
0x10f0390f make_edges
/home/bergner/gcc/gcc-fsf-mainline-pr80775/gcc/tree-cfg.c:930
0x10f0168b build_gimple_cfg
/home/bergner/gcc/gcc-fsf-mainline-pr80775/gcc/tree-cfg.c:248
0x10f01f27 execute_build_cfg
/home/bergner/gcc/gcc-fsf-mainline-pr80775/gcc/tree-cfg.c:398
0x10f0209b execute
/home/bergner/gcc/gcc-fsf-mainline-pr80775/gcc/tree-cfg.c:434

It seems cleanup_tree_cfg() has removed the entire function at this point.

[Bug c++/81237] Cannot link when class methods compiled with different levels of vectorization

2017-06-28 Thread ravi.kappiy...@cd-adapco.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81237

--- Comment #4 from Ravi  ---
This does seem to be an issue with any ABI version older than the newest (11, I
think), which appears to have a different name mangling scheme than any of ABI
versions 6-10, all of which fail when attempting to link against an object file
compiled against the latest ABI. This was not the case with GNU 6.2 which used
ABI version 10, which appears to be compatible with ABI version 6.
Unfortunately, due to other constraints we are forced to use ABI version 6 for
certain aspects of the code - are there any known work-arounds to getting ABI
version 11 to link against code compiled with an older ABI version?

[Bug rtl-optimization/81194] [8 Regression] ICE during RTL pass: expand

2017-06-28 Thread bergner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81194

--- Comment #10 from Peter Bergner  ---
Created attachment 41647
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41647=edit
Proposed patch

(In reply to Richard Biener from comment #9)
> (In reply to Peter Bergner from comment #8)
>> Since there is only one default case statement in stmt, asking for the label
>> at offset "1" is illegal and that leads to the ICE.  Either we need to
>> protect this code or maybe we can remove the switch statement all together.
> 
> I think we should be defensive here but also take the opportunity to remove
> the switch stmt.

I'm testing the attached patch which fixes the ICE.  The cleanup_tree_cfg()
routine can already remove switch statements that only contain a default case
statement, so I have changed the group_case_labels_stmt() to return a boolean
to say whether it eliminated any cases.  If after all of the calls to
group_case_labels_stmt(), we detected one of the calls eliminated a case, we
call cleanup_tree_cfg() to possibly remove the switch statement.

richi, does this look ok to you or were you looking for a manual replacement of
the switch with a branch to the lone case label?

[Bug c++/61414] enum class bitfield size-checking failure

2017-06-28 Thread eric-bugs at omnifarious dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61414

eric-bugs at omnifarious dot org changed:

   What|Removed |Added

 CC||eric-bugs at omnifarious dot 
org

--- Comment #9 from eric-bugs at omnifarious dot org ---
This does not seem like correct behavior to me either. The warning should be
based on the maximum declared enum value, not the maximum possible value held
by the underlying type.

After all as of C++17, the standard makes it undefined what happens if you try
to stuff an integer into an enum value that doesn't correspond to one of the
values listed in the enum declaration.

[Bug fortran/81241] write end of file

2017-06-28 Thread wilson at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81241

Jim Wilson  changed:

   What|Removed |Added

 CC||wilson at gcc dot gnu.org

--- Comment #3 from Jim Wilson  ---
It might be related to
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81195
which is already fixed on mainline and for gcc-7.2.  This failure was triggered
by multithreaded write statements.

[Bug other/81242] New: Clear-to-EOL in diagnostics colorization corrupts output

2017-06-28 Thread fw at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81242

Bug ID: 81242
   Summary: Clear-to-EOL in diagnostics colorization corrupts
output
   Product: gcc
   Version: 6.3.1
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fw at gcc dot gnu.org
CC: dmalcolm at redhat dot com
  Target Milestone: ---

It appears that GCC suffers from the same issue as grep when it comes to
coloring and line wraps.

  http://invisible-island.net/xterm/xterm.faq.html#grep_colors

Reproducer to be run in an 80-columns wide xterm:

printf "f%014dx;\n" 0 | gcc -x c -fsyntax-only  -

Output is:

$ printf "f%014dx;\n" 0 | gcc -Wall -x c -fsyntax-only  -
:1:1: warning: data definition has no type or storage class
:1:1: warning: type defaults to ‘int’ in declaration of
‘f00’ [-Wimplicit-int]

Note the missing “x” at the end of the identifier.

Seen with gcc-6.3.1-1.fc25.x86_64 and gcc-4.8.5-16.el7.x86_64.

[Bug fortran/81241] write end of file

2017-06-28 Thread townsend at astro dot wisc.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81241

--- Comment #2 from Rich Townsend  ---
Aha, given that MESA is multithreaded, this may well be linked to this issue:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78387

Certainly, running with just 1 thread seems to make things behave.

[Bug fortran/81241] write end of file

2017-06-28 Thread townsend at astro dot wisc.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81241

--- Comment #1 from Rich Townsend  ---
(Apologies for the initial blank description, my web-browser submitted before I
was ready).

I've recently upgraded to gfortran 7.1 from 5.3, and am seeing a large number
of breakages in a significant piece of software that I help maintain (the
"Modules for Experiments in Stellar Astrophysics" project -- MESA).

The breakages are unfortunately intermittent -- sometimes they occur, and
sometimes not. But they all share the similarity of being triggered by internal
write statements. Sometimes the code crashes with a segfault on the internal
write; and sometimes it stops with the error message:

Fortran runtime error: End of fileERROR STOP 1

The breakage occurs on both Linux and OSX 10.12.

As an example backtrace from a segfault:

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x2b7af459555f in ???
#1  0x2b7af381f7d6 in write_decimal
at /root/mesasdk-src/gcc/libgfortran/io/write.c:852
#2  0x2b7af3816c9c in formatted_transfer_scalar_write
at /root/mesasdk-src/gcc/libgfortran/io/transfer.c:2043
#3  0x2b7af38170fc in formatted_transfer
at /root/mesasdk-src/gcc/libgfortran/io/transfer.c:2272
#4  0x859bca in setstr
at ../private/eosdt_load_tables.f90:220
#5  0x85b624 in __eosdt_load_tables_MOD_get_eosdt_table_filenames
at ../private/eosdt_load_tables.f90:192
#6  0x85e132 in read_one
at ../private/eosdt_load_tables.f90:172
#7  0x85e2bd in do_read
at ../private/eosdt_load_tables.f90:156
#8  0x85e2bd in __eosdt_load_tables_MOD_load_single_eosdt_table_by_id
at ../private/eosdt_load_tables.f90:149
#9  0x8242cf in __eosdt_eval_MOD_get_eosdt_xtable_results
at ../private/eosdt_eval.f90:1079
#10  0x825cc9 in do_interp2
at ../private/eosdt_eval.f90:797
#11  0x825cc9 in __eosdt_eval_MOD_get_opal_scvh_results
at ../private/eosdt_eval.f90:758
#12  0x826c51 in __eosdt_eval_MOD_get_eosdt_results
at ../private/eosdt_eval.f90:387
#13  0x828800 in f
at ../private/eosdt_eval.f90:2340
#14  0x9362d2 in __mod_root_MOD_do_safe_root_with_guess
at ../private/mod_root.f:102
#15  0x81ff7b in __eosdt_eval_MOD_do_safe_get_rho_t
at ../private/eosdt_eval.f90:2297
#16  0x820508 in __eosdt_eval_MOD_get_rho
at ../private/eosdt_eval.f90:2178
#17  0x829199 in __eospt_eval_MOD_get_pt_results_using_dt
at ../private/eospt_eval.f90:1127
#18  0x82c783 in __eospt_eval_MOD_get_eospt_results
at ../private/eospt_eval.f90:213
#19  0x8171c1 in __eos_lib_MOD_eospt_get
at ../public/eos_lib.f90:805
#20  0x4ae874 in eval_eospt
at ../private/micro.f90:678
#21  0x4ae874 in __micro_MOD_do_eos_for_cell
at ../private/micro.f90:381
#22  0x4293d4 in __star_utils_MOD_foreach_cell._omp_fn.1
at ../private/star_utils.f90:68
#23  0x2b7af3cd48cd in gomp_thread_start
at /root/mesasdk-src/gcc/libgomp/team.c:120
#24  0x2b7af434c65c in ???
#25  0x2b7af4633ecc in ???
./rn: line 8:  5111 Segmentation fault  (core dumped) ./star

The offending line of code which triggered the segfault was this:

write(str, '(a,i1)') '0', floor(100d0 * v + 0.5)

I realize that this is an unconventional bug report -- I'm unable to provide a
test case which demonstrates the problem, since it comes and goes. However, I'm
hoping the backtrace above may be helpful, and I'd appreciate any suggestions
on how to proceed in tracking this down.

cheers,

Rich

[Bug fortran/81241] New: write end of file

2017-06-28 Thread townsend at astro dot wisc.edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81241

Bug ID: 81241
   Summary: write end of file
   Product: gcc
   Version: 7.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: townsend at astro dot wisc.edu
  Target Milestone: ---

[Bug testsuite/77734] FAIL: gcc.dg/plugin/must-tail-call-1.c -fplugin=./must_tail_call_plugin.so (test for excess errors)

2017-06-28 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77734

Eric Botcazou  changed:

   What|Removed |Added

 Target|hppa-unknown-linux-gnu, |hppa-unknown-linux-gnu,
   |sparc-sun-solaris2.*|sparc*-*-*
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-06-28
 CC||ebotcazou at gcc dot gnu.org
   Host|hppa-unknown-linux-gnu, |hppa-unknown-linux-gnu,
   |sparc-sun-solaris2.*|sparc*-*-*
 Ever confirmed|0   |1
  Build|hppa-unknown-linux-gnu, |hppa-unknown-linux-gnu,
   |sparc-sun-solaris2.*|sparc*-*-*

--- Comment #3 from Eric Botcazou  ---
SPARC is indeed affected.

[Bug ipa/81213] GCC target_clone support does not work for static functions

2017-06-28 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81213

--- Comment #3 from Martin Liška  ---
Created attachment 41646
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41646=edit
Untested patch

I'm going to test this.

[Bug tree-optimization/81240] [7/8 Regression] ICE in dfs_enumerate_from

2017-06-28 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81240

Jeffrey A. Law  changed:

   What|Removed |Added

 CC||law at redhat dot com
   Assignee|unassigned at gcc dot gnu.org  |law at redhat dot com

--- Comment #2 from Jeffrey A. Law  ---
Got to be mine somewhere.  Probably won't get to it for a bit though.

[Bug tree-optimization/81083] [7 Regression] ICE: Unable to coalesce ssa_names 4 and 13 which are marked as MUST COALESCE

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81083

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||7.1.1
 Resolution|--- |FIXED
  Known to fail|7.1.1   |7.1.0

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

[Bug c++/81007] [7 Regression] ICE with virtual function in broken class

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81007

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||7.1.1
 Resolution|--- |FIXED

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

[Bug tree-optimization/81227] [8 Regression] ICE in get_single_symbol, at tree-vrp.c:799

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81227

Richard Biener  changed:

   What|Removed |Added

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

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

[Bug ipa/81214] GCC target_clone support does not work for global functions with no references

2017-06-28 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81214

--- Comment #2 from Martin Liška  ---
Created attachment 41645
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41645=edit
Patch candidate

Patch candidate that I'll test.

[Bug tree-optimization/81227] [8 Regression] ICE in get_single_symbol, at tree-vrp.c:799

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81227

--- Comment #3 from Richard Biener  ---
Author: rguenth
Date: Wed Jun 28 14:24:00 2017
New Revision: 249742

URL: https://gcc.gnu.org/viewcvs?rev=249742=gcc=rev
Log:
2017-06-28  Richard Biener  

PR middle-end/81227
* fold-const.c (negate_expr_p): Use TYPE_UNSIGNED, not
TYPE_OVERFLOW_WRAPS.
* match.pd (negate_expr_p): Likewise.
* tree-ssa-reassoc.c (optimize_range_tests_diff): Use
fold_build2, not fold_binary.

* gcc.dg/pr81227.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/pr81227.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/match.pd
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-reassoc.c

[Bug c++/64194] [C++14] for function template with auto return

2017-06-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64194

--- Comment #5 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #4)
> Slightly reduced (it doesn't matter if g has a deduced return type):

Oops, it already wasn't deduced ... I confused myself with a new testcase I was
trying!

[Bug c++/64194] [C++14] for function template with auto return

2017-06-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64194

Jonathan Wakely  changed:

   What|Removed |Added

   Last reconfirmed|2016-12-21 00:00:00 |2017-6-28

--- Comment #4 from Jonathan Wakely  ---
(In reply to Jonathan Wakely from comment #0)
> It works if the reference to id is uncommented, or if auto id() is
> changed to void id()

Or by adding something else to trigger the instantiation of the right
specialization, e.g.

using F = decltype(id);

Slightly reduced (it doesn't matter if g has a deduced return type):


template  auto id() { }

template  void g(T) { }

int main()
{
// id;
// using F = decltype(id);
g(id);
}

[Bug middle-end/79665] gcc's signed (x*x)/200 is slower than clang's

2017-06-28 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79665

--- Comment #19 from Wilco  ---
Author: wilco
Date: Wed Jun 28 14:13:02 2017
New Revision: 249740

URL: https://gcc.gnu.org/viewcvs?rev=249740=gcc=rev
Log:
Improve Cortex-A53 shift bypass

The aarch_forward_to_shift_is_not_shifted_reg bypass always returns true
on AArch64 shifted instructions.  This causes the bypass to activate in
too many cases, resulting in slower execution on Cortex-A53 like reported
in PR79665.

This patch uses the arm_no_early_alu_shift_dep condition instead which
improves the example in PR79665 by ~7%.  Given it is no longer used,
remove aarch_forward_to_shift_is_not_shifted_reg.  Also remove an
unnecessary REG_P check.

gcc/
PR target/79665
* config/arm/aarch-common.c (arm_no_early_alu_shift_dep):
Remove redundant if.
(aarch_forward_to_shift_is_not_shifted_reg): Remove.
* config/arm/aarch-common-protos.h
(aarch_forward_to_shift_is_not_shifted_re): Remove.
* config/arm/cortex-a53.md: Use arm_no_early_alu_shift_dep in bypass.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arm/aarch-common-protos.h
trunk/gcc/config/arm/aarch-common.c
trunk/gcc/config/arm/cortex-a53.md

[Bug testsuite/81058] FAIL: gcc.target/i386/avx512bw-vpmovu?swb-1.c scan-assembler-times vpmovu?swb.*

2017-06-28 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81058

--- Comment #3 from Dominique d'Humieres  ---
The problem affects also gcc.target/i386/avx512bw-vpmovwb-1.c. Better patch

--- ../_clean/gcc/testsuite/gcc.target/i386/avx512bw-vpmovswb-1.c  
2017-06-08 15:14:40.0 +0200
+++ gcc/testsuite/gcc.target/i386/avx512bw-vpmovswb-1.c 2017-06-28
15:31:44.0 +0200
@@ -3,15 +3,15 @@
 /* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
1 } } */
 /* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[
\\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*res1\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 } } */
+/* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*res1\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 { target nonpic } } } */
 /* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
1 } } */
 /* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[
\\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*res2\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 } } */
+/* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*res2\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 { target nonpic } } } */
 /* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
1 } } */
 /* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[
\\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*res3\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 } } */
+/* { dg-final { scan-assembler-times "vpmovswb\[
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*res3\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 { target nonpic } } } */

 #include 

vpmovuswb-1.c gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-1.c
--- ../_clean/gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-1.c 
2017-06-08 15:14:40.0 +0200
+++ gcc/testsuite/gcc.target/i386/avx512bw-vpmovuswb-1.c2017-06-28
15:33:09.0 +0200
@@ -3,15 +3,15 @@
 /* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
1 } } */
 /* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[
\\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*res1\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 } } */
+/* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*res1\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 { target nonpic } } } */
 /* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
1 } } */
 /* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*%xmm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[
\\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*res2\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 } } */
+/* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*res2\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 { target nonpic } } } */
 /* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
1 } } */
 /* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*%ymm\[0-9\]+\{%k\[1-7\]\}{z}(?:\n|\[
\\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*res3\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 } } */
+/* { dg-final { scan-assembler-times "vpmovuswb\[
\\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*res3\[^\n\]*\{%k\[1-7\]\}(?:\n|\[ \\t\]+#)"
 1 { target nonpic } } } */

 #include 

vpmovwb-1.c 

[Bug target/81175] [7 Regression] EXC_BAD_ACCESS in ::slpeel_duplicate_current_defs_from_edges(edge, edge, edge, edge) at is-a.h:192

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81175

Richard Biener  changed:

   What|Removed |Added

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

[Bug c++/81007] [7 Regression] ICE with virtual function in broken class

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81007

--- Comment #5 from Richard Biener  ---
Author: rguenth
Date: Wed Jun 28 13:25:33 2017
New Revision: 249738

URL: https://gcc.gnu.org/viewcvs?rev=249738=gcc=rev
Log:
2017-06-28  Richard Biener  

Backport from mainline
2017-06-09  Richard Biener  

PR middle-end/81007
* ipa-polymorphic-call.c
(ipa_polymorphic_call_context::restrict_to_inner_class):
Skip FIELD_DECLs with error_mark_node type.
* passes.def (all_lowering_passes): Run pass_build_cgraph_edges
last again.

* g++.dg/pr81007.C: New testcase.

2017-06-14  Richard Biener  

PR tree-optimization/81083
* tree-ssa-sccvn.c (vn_reference_lookup_3): Do not use abnormals
as values.

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

2017-06-21  Richard Biener  

PR gcov-profile/81080
* configure.ac: Add AC_SYS_LARGEFILE.
* libgcov.h: Include auto-target.h before tsystem.h to pick
up _FILE_OFFSET_BITS which might differ for multilibs.
* config.in: Regenerate.
* configure: Likewise.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/pr81007.C
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr81083.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/ipa-polymorphic-call.c
branches/gcc-7-branch/gcc/passes.def
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-ssa-sccvn.c
branches/gcc-7-branch/libgcc/ChangeLog
branches/gcc-7-branch/libgcc/config.in
branches/gcc-7-branch/libgcc/configure
branches/gcc-7-branch/libgcc/configure.ac
branches/gcc-7-branch/libgcc/libgcov.h

[Bug gcov-profile/81080] target libgcov not built with large file support

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81080

--- Comment #3 from Richard Biener  ---
Author: rguenth
Date: Wed Jun 28 13:25:33 2017
New Revision: 249738

URL: https://gcc.gnu.org/viewcvs?rev=249738=gcc=rev
Log:
2017-06-28  Richard Biener  

Backport from mainline
2017-06-09  Richard Biener  

PR middle-end/81007
* ipa-polymorphic-call.c
(ipa_polymorphic_call_context::restrict_to_inner_class):
Skip FIELD_DECLs with error_mark_node type.
* passes.def (all_lowering_passes): Run pass_build_cgraph_edges
last again.

* g++.dg/pr81007.C: New testcase.

2017-06-14  Richard Biener  

PR tree-optimization/81083
* tree-ssa-sccvn.c (vn_reference_lookup_3): Do not use abnormals
as values.

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

2017-06-21  Richard Biener  

PR gcov-profile/81080
* configure.ac: Add AC_SYS_LARGEFILE.
* libgcov.h: Include auto-target.h before tsystem.h to pick
up _FILE_OFFSET_BITS which might differ for multilibs.
* config.in: Regenerate.
* configure: Likewise.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/pr81007.C
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr81083.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/ipa-polymorphic-call.c
branches/gcc-7-branch/gcc/passes.def
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-ssa-sccvn.c
branches/gcc-7-branch/libgcc/ChangeLog
branches/gcc-7-branch/libgcc/config.in
branches/gcc-7-branch/libgcc/configure
branches/gcc-7-branch/libgcc/configure.ac
branches/gcc-7-branch/libgcc/libgcov.h

[Bug tree-optimization/81083] [7 Regression] ICE: Unable to coalesce ssa_names 4 and 13 which are marked as MUST COALESCE

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81083

--- Comment #6 from Richard Biener  ---
Author: rguenth
Date: Wed Jun 28 13:25:33 2017
New Revision: 249738

URL: https://gcc.gnu.org/viewcvs?rev=249738=gcc=rev
Log:
2017-06-28  Richard Biener  

Backport from mainline
2017-06-09  Richard Biener  

PR middle-end/81007
* ipa-polymorphic-call.c
(ipa_polymorphic_call_context::restrict_to_inner_class):
Skip FIELD_DECLs with error_mark_node type.
* passes.def (all_lowering_passes): Run pass_build_cgraph_edges
last again.

* g++.dg/pr81007.C: New testcase.

2017-06-14  Richard Biener  

PR tree-optimization/81083
* tree-ssa-sccvn.c (vn_reference_lookup_3): Do not use abnormals
as values.

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

2017-06-21  Richard Biener  

PR gcov-profile/81080
* configure.ac: Add AC_SYS_LARGEFILE.
* libgcov.h: Include auto-target.h before tsystem.h to pick
up _FILE_OFFSET_BITS which might differ for multilibs.
* config.in: Regenerate.
* configure: Likewise.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/pr81007.C
branches/gcc-7-branch/gcc/testsuite/gcc.dg/torture/pr81083.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/ipa-polymorphic-call.c
branches/gcc-7-branch/gcc/passes.def
branches/gcc-7-branch/gcc/testsuite/ChangeLog
branches/gcc-7-branch/gcc/tree-ssa-sccvn.c
branches/gcc-7-branch/libgcc/ChangeLog
branches/gcc-7-branch/libgcc/config.in
branches/gcc-7-branch/libgcc/configure
branches/gcc-7-branch/libgcc/configure.ac
branches/gcc-7-branch/libgcc/libgcov.h

[Bug ipa/81238] Target clone support does not make default clone static.

2017-06-28 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81238

--- Comment #2 from Michael Meissner  ---
Author: meissner
Date: Wed Jun 28 13:07:12 2017
New Revision: 249737

URL: https://gcc.gnu.org/viewcvs?rev=249737=gcc=rev
Log:
[gcc]
2017-06-28  Michael Meissner  

PR ipa/81238
* multiple_target.c (create_dispatcher_calls): Set the default
clone to be static, not public.

[gcc/testsuite]
2017-06-28  Michael Meissner  

PR target/81193
* lib/target-supports.exp
(check_ppc_cpu_supports_hw_available): New test to make sure
__builtin_cpu_supports works on power7 and newer.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/multiple_target.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/lib/target-supports.exp

[Bug target/81193] PowerPC GCC __builtin_cpu_is and __builtin_cpu_supports should warn about old libraries

2017-06-28 Thread meissner at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81193

--- Comment #11 from Michael Meissner  ---
Author: meissner
Date: Wed Jun 28 13:07:12 2017
New Revision: 249737

URL: https://gcc.gnu.org/viewcvs?rev=249737=gcc=rev
Log:
[gcc]
2017-06-28  Michael Meissner  

PR ipa/81238
* multiple_target.c (create_dispatcher_calls): Set the default
clone to be static, not public.

[gcc/testsuite]
2017-06-28  Michael Meissner  

PR target/81193
* lib/target-supports.exp
(check_ppc_cpu_supports_hw_available): New test to make sure
__builtin_cpu_supports works on power7 and newer.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/multiple_target.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/lib/target-supports.exp

[Bug tree-optimization/81240] [7/8 Regression] ICE in dfs_enumerate_from

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81240

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-06-28
 CC||law at gcc dot gnu.org
   Target Milestone|--- |7.2
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Confirmed.

#1  0x00948646 in dfs_enumerate_from (
bb=, reverse=1, predicate=
0x11a81ba , 
rslt=0x283fbf0, rslt_max=16, data=0x7689d680)
at /space/rguenther/src/svn/gcc-7-branch/gcc/cfganal.c:1244
#2  0x011a82e6 in determine_bb_domination_status (loop=0x769de420, 
bb=)
at /space/rguenther/src/svn/gcc-7-branch/gcc/tree-ssa-threadupdate.c:1705
#3  0x011a856e in thread_through_loop_header (loop=0x769de420, 
may_peel_loop_headers=false)
at /space/rguenther/src/svn/gcc-7-branch/gcc/tree-ssa-threadupdate.c:1851
#4  0x011aa150 in thread_through_all_blocks (
may_peel_loop_headers=false)
at /space/rguenther/src/svn/gcc-7-branch/gcc/tree-ssa-threadupdate.c:2562
#5  0x0126411a in execute_vrp (warn_array_bounds_p=false)
at /space/rguenther/src/svn/gcc-7-branch/gcc/tree-vrp.c:11759

I suppose loop->num_nodes is no longer accurate (sth before broke loops, not
unheard of in threading...)

1704  nblocks = dfs_enumerate_from (loop->latch, 1,
dbds_continue_enumeration_p,
1705bblocks, loop->num_nodes, bb);

called from

1849  /* The target block must dominate the loop latch, otherwise we would
be
1850 creating a subloop.  */
1851  domst = determine_bb_domination_status (loop, tgt_bb);
1852  if (domst == DOMST_NONDOMINATING)
1853goto fail;
1854  if (domst == DOMST_LOOP_BROKEN)

domst == DOMST_LOOP_BROKEN is telling sth ;)

Jeff?

[Bug ipa/81128] Function multi-versioning does not work with -O

2017-06-28 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81128

Martin Liška  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
  Known to work||8.0
  Known to fail|8.0 |

--- Comment #9 from Martin Liška  ---
Fixed on trunk so far.

[Bug ipa/81128] Function multi-versioning does not work with -O

2017-06-28 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81128

--- Comment #8 from Martin Liška  ---
Author: marxin
Date: Wed Jun 28 12:47:24 2017
New Revision: 249735

URL: https://gcc.gnu.org/viewcvs?rev=249735=gcc=rev
Log:
Do not allow to inline ifunc resolvers (PR ipa/81128).

2017-06-28  Martin Liska  

PR ipa/81128
* ipa-visibility.c (non_local_p): Handle visibility.
2017-06-28  Martin Liska  

PR ipa/81128
* c-attribs.c (handle_alias_ifunc_attribute): Append ifunc alias
to a function declaration.
2017-06-28  Martin Liska  

PR ipa/81128
* gcc.target/i386/pr81128.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/pr81128.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-attribs.c
trunk/gcc/ipa-visibility.c
trunk/gcc/testsuite/ChangeLog

[Bug driver/79659] Provide valid values for integer options (e.g. -Wformat) with --help= option

2017-06-28 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79659

--- Comment #4 from Martin Liška  ---
Author: marxin
Date: Wed Jun 28 12:45:59 2017
New Revision: 249734

URL: https://gcc.gnu.org/viewcvs?rev=249734=gcc=rev
Log:
Introduce IntegerRange for options (PR driver/79659).

2017-06-28  Martin Liska  

PR driver/79659
* common.opt: Add IntegerRange to various options.
* opt-functions.awk (integer_range_info): New function.
* optc-gen.awk: Add integer_range_info to cl_options struct.
* opts-common.c (decode_cmdline_option): Handle
CL_ERR_INT_RANGE_ARG.
(cmdline_handle_error): Likewise.
* opts.c (print_filtered_help): Show valid interval in
when --help is provided.
* opts.h (struct cl_option): Add range_min and range_max fields.
* config/i386/i386.opt: Add IntegerRange for -mbranch-cost.
2017-06-28  Martin Liska  

PR driver/79659
* c.opt: Add IntegerRange to various options.
2017-06-28  Martin Liska  

PR driver/79659
* g++.dg/opt/pr79659.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/opt/pr79659.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c.opt
trunk/gcc/common.opt
trunk/gcc/config/i386/i386.opt
trunk/gcc/opt-functions.awk
trunk/gcc/optc-gen.awk
trunk/gcc/opts-common.c
trunk/gcc/opts.c
trunk/gcc/opts.h
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/81240] New: [7/8 Regression] ICE in dfs_enumerate_from

2017-06-28 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81240

Bug ID: 81240
   Summary: [7/8 Regression] ICE in dfs_enumerate_from
   Product: gcc
   Version: 7.1.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc 7.1 and gcc-8.0.0-alpha20170625 snapshot ICE when compiling the following
snippet w/ -O2 (-O3, -Ofast):

void
py (int y7, int vh)
{
  const int kq = 2;
  int rn;

  y7 = rn = -1;
  for (;;)
  {
int w6;

for (w6 = 0; w6 < kq; ++w6)
{
  int xk = !!y7 - ((vh != 0) ? 1 : y7);

  if (xk != 0)
  {
vh = 0;
while (vh < kq)
{
  w6 = 1;
  vh += !!(rn - w6) + 1;
  rn *= 2;
  if (rn != 0)
w6 = kq;
}
  }
}

if (rn != 0)
  for (;;)
  {
  }

y7 = 0;
  }
}

% gcc-8.0.0-alpha20170625 -O2 -ftracer -c -w pniq8oa3.c
during GIMPLE pass: vrp
pniq8oa3.c: In function 'py':
pniq8oa3.c:2:1: internal compiler error: in dfs_enumerate_from, at
cfganal.c:1194
 py (int y7, int vh)
 ^~

[Bug c/81230] False -Wimplicit-fallthrough when case has braces

2017-06-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81230

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #2 from Jakub Jelinek  ---
Yes, it is documented.
The comment needs to be followed after optional whitespace and other comments
by @code{case} or @code{default} keywords or by a user label that precedes some
@code{case} or @code{default} label.
So the reporter has just not read the documentation.
They can either move the comment, or use attribute which can be used even
inside of the {}s.

[Bug target/81225] [6/7/8 Regression] ICE with -mavx512ifma -O3 -ffloat-store

2017-06-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81225

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-06-28
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #3 from Jakub Jelinek  ---
Created attachment 41644
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41644=edit
gcc8-pr81225.patch

Untested fix.

[Bug target/81225] [6/7/8 Regression] ICE with -mavx512ifma -O3 -ffloat-store

2017-06-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81225

Jakub Jelinek  changed:

   What|Removed |Added

 CC||kyukhin at gcc dot gnu.org,
   ||uros at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
This seems to be a total mess in vec_extract_lo_* patterns.
vec_extract_lo_*_maskm patterns correctly use register_operand as input
operand.
Then for V8D[FI] we have:
(define_insn "vec_extract_lo_"
  [(set (match_operand: 0 ""
"=,v")
(vec_select:
  (match_operand:V8FI 1 "nonimmediate_operand" "v,m")
  (parallel [(const_int 0) (const_int 1)
(const_int 2) (const_int 3)])))]
  "TARGET_AVX512F
   && ( || !(MEM_P (operands[0]) && MEM_P (operands[1])))"
{
  if ( || !TARGET_AVX512VL)
return "vextract64x4\t{$0x0, %1,
%0|%0, %1, 0x0}";
  else
return "#";
}
but vextract[if]64x4 instruction does not support memory operand as %1, so I
have no idea how it can work unless we split the insn.
The corresponding splitter is:
(define_split
  [(set (match_operand: 0 "nonimmediate_operand")
(vec_select:
  (match_operand:V8FI 1 "nonimmediate_operand")
  (parallel [(const_int 0) (const_int 1)
(const_int 2) (const_int 3)])))]
  "TARGET_AVX512F && !(MEM_P (operands[0]) && MEM_P (operands[1]))
   && reload_completed
   && (TARGET_AVX512VL
   || (REG_P (operands[0]) && !EXT_REX_SSE_REG_P (operands[1])))"
  [(set (match_dup 0) (match_dup 1))]
  "operands[1] = gen_lowpart (mode, operands[1]);")
but it won't trigger if  or if operands[1] is xmm32+ and not
AVX512VL.  For xmm32+ it is handled by the vextract insn though.
So, I wonder if the "v,m" in the pattern shouldn't actually be
"v," and replace nonimmediate_operand on the input with
 in order to avoid masked extractions from memory
(or would it work to split the masked extractions of the low half from memory
just by doing a masked load from the memory in ssehalfvecmode for both
operands)?  In any case, we should always return "#" if (MEM_P (operands[1]))
in these vec_extract_lo_* insns to make it clear that the insns don't support
memory as input.
Similarly for V16SF/V16SI and V4DI/V4DF.  But V8SI/V8SF is different:
(define_split
  [(set (match_operand: 0 "nonimmediate_operand")
(vec_select:
  (match_operand:VI4F_256 1 "nonimmediate_operand")
  (parallel [(const_int 0) (const_int 1)
 (const_int 2) (const_int 3)])))]
  "TARGET_AVX && !(MEM_P (operands[0]) && MEM_P (operands[1]))
   && reload_completed"
  [(set (match_dup 0) (match_dup 1))]
  "operands[1] = gen_lowpart (mode, operands[1]);")

(define_insn "vec_extract_lo_"
  [(set (match_operand: 0 ""
"=")
(vec_select:
  (match_operand:VI4F_256 1 "register_operand" "v")
  (parallel [(const_int 0) (const_int 1)
 (const_int 2) (const_int 3)])))]
  "TARGET_AVX &&  && "
{
  if ()
return "vextract32x4\t{$0x0, %1,
%0|%0, %1, 0x0}";
  else
return "#";
}
While the splitter works with nonimmediate memory (and no masking), the insn
requires only register operand.  And then we have:
case IX86_BUILTIN_GATHER3ALTSIV4DF:
case IX86_BUILTIN_GATHER3ALTSIV4DI:
case IX86_BUILTIN_GATHERALTSIV4DF:
case IX86_BUILTIN_GATHERALTSIV4DI:
  half = gen_reg_rtx (V4SImode);
  if (!nonimmediate_operand (op2, V8SImode))
op2 = copy_to_mode_reg (V8SImode, op2);
  emit_insn (gen_vec_extract_lo_v8si (half, op2));
  op2 = half;
...
case IX86_BUILTIN_GATHER3ALTDIV8SF:
case IX86_BUILTIN_GATHER3ALTDIV8SI:
case IX86_BUILTIN_GATHERALTDIV8SF:
case IX86_BUILTIN_GATHERALTDIV8SI:
  half = gen_reg_rtx (mode0);
  if (mode0 == V4SFmode)
gen = gen_vec_extract_lo_v8sf;
  else
gen = gen_vec_extract_lo_v8si;
  if (!nonimmediate_operand (op0, GET_MODE (op0)))
op0 = copy_to_mode_reg (GET_MODE (op0), op0);
  emit_insn (gen (half, op0));
which doesn't match those vec_extract_lo_v8s[fi] patterns, because those
require register_operand.
So, quick fix for this ICE is certainly to:
--- gcc/config/i386/i386.c.jj   2017-06-28 09:50:34.0 +0200
+++ gcc/config/i386/i386.c  2017-06-28 12:20:25.091261482 +0200
@@ -38918,7 +38918,7 @@ rdseed_step:
case IX86_BUILTIN_GATHERALTSIV4DF:
case IX86_BUILTIN_GATHERALTSIV4DI:
  half = gen_reg_rtx (V4SImode);
- if (!nonimmediate_operand (op2, V8SImode))
+ if (!register_operand (op2, V8SImode))
op2 = copy_to_mode_reg (V8SImode, op2);
  emit_insn (gen_vec_extract_lo_v8si (half, op2));
  op2 = half;
@@ -38951,13 +38951,13 @@ rdseed_step:
gen = gen_vec_extract_lo_v8sf;
  else
gen = gen_vec_extract_lo_v8si;
-  

[Bug c/81233] --Wdiscarded-qualifiers and Wincompatible-pointer-types missing important detail

2017-06-28 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81233

Marek Polacek  changed:

   What|Removed |Added

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

[Bug tree-optimization/81192] [8 Regression] gcc ICE at -Os on x86_64-linux-gnu: Segmentation fault

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81192

--- Comment #6 from Richard Biener  ---
(In reply to Tom de Vries from comment #5)
> There actually is some code in find_same_succ_bb to keep loop structure:
> ...
>   if (bb == NULL
>   /* Be conservative with loop structure.  It's not evident that this
> test
>  is sufficient.  Before tail-merge, we've just called   
> 
>  loop_optimizer_finalize, and LOOPS_MAY_HAVE_MULTIPLE_LATCHES is now
> 
>  set, so there's no guarantee that the loop->latch value is still
> valid.  
>  But we assume that, since we've forced LOOPS_HAVE_SIMPLE_LATCHES at
> the  
>  start of pre, we've kept that property intact throughout pre, and
> are
>  keeping it throughout tail-merge using this test.  */
>   || bb->loop_father->latch == bb)
> return;
> ...
> 
> For this example, the cleanup_tree_cfg in tail_merge_optimize creates
> multiple loop latches in the inner loop, so the loop->latch value is no
> longer valid. This test needs fixing.

So here we just look at a single BB, does the above mean that we never
wanted to look for BBs the same as a loop latch?  That is, BB will always
prevail?

That said, we never want to merge blocks in a way that a former loop header
gets deleted (bb->loop_father->header == bb).  It's fine if we merge two
latches of the same loop (assuming the attached patch restricting merging
to be within the same loop is applied).

The question whether 'same' can be NULL in same_succ_flush_bb still holds
of course.

Mind taking over this PR?

[Bug sanitizer/81224] ICE in -fsanitize=address w/ a register variable of a vector type

2017-06-28 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81224

Martin Liška  changed:

   What|Removed |Added

  Known to work||8.0
  Known to fail||5.4.0, 6.3.0, 7.1.0

--- Comment #4 from Martin Liška  ---
Fixed on trunk so far.

[Bug sanitizer/81224] ICE in -fsanitize=address w/ a register variable of a vector type

2017-06-28 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81224

--- Comment #3 from Martin Liška  ---
Author: marxin
Date: Wed Jun 28 07:59:23 2017
New Revision: 249728

URL: https://gcc.gnu.org/viewcvs?rev=249728=gcc=rev
Log:
Bail out HARD_REGISTER vars in asan (PR sanitizer/81224).

2017-06-28  Martin Liska  

PR sanitizer/81224
* asan.c (instrument_derefs): Bail out inner references
that are hard register variables.
2017-06-28  Martin Liska  

PR sanitizer/81224
* gcc.dg/asan/pr81224.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/asan/pr81224.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/asan.c
trunk/gcc/testsuite/ChangeLog

[Bug bootstrap/81217] Makefile:22754: warning: overriding recipe for target 'profiledbootstrap'

2017-06-28 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81217

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #5 from Martin Liška  ---
Fixed.

[Bug target/81175] [7 Regression] EXC_BAD_ACCESS in ::slpeel_duplicate_current_defs_from_edges(edge, edge, edge, edge) at is-a.h:192

2017-06-28 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81175

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Wed Jun 28 07:55:20 2017
New Revision: 249727

URL: https://gcc.gnu.org/viewcvs?rev=249727=gcc=rev
Log:
PR target/81175
* config/i386/i386.c (ix86_init_mmx_sse_builtins): Use def_builtin
rather than def_builtin_pure for __builtin_ia32_gatherpf*.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c

[Bug bootstrap/81217] Makefile:22754: warning: overriding recipe for target 'profiledbootstrap'

2017-06-28 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81217

--- Comment #4 from Martin Liška  ---
Author: marxin
Date: Wed Jun 28 07:54:14 2017
New Revision: 249726

URL: https://gcc.gnu.org/viewcvs?rev=249726=gcc=rev
Log:
Fix PR bootstrap/81217

2017-06-28  Martin Liska  

PR bootstrap/81217
* Makefile.def: Remove superfluous bootstrap_target from
bootstrap_stage.
* Makefile.in: Re-generate the file.

Modified:
trunk/ChangeLog
trunk/Makefile.def
trunk/Makefile.in

[Bug fortran/80164] ICE in gfc_format_decoder at gcc/fortran/error.c:933

2017-06-28 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80164

--- Comment #13 from Martin Liška  ---
(In reply to Jerry DeLisle from comment #12)
> Fixed on trunk, will backport to 7 in a few days.

Thanks for the fix!

[Bug c++/81234] [6 Regression] stray notes for a flexible array member not at end of struct

2017-06-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81234

--- Comment #4 from Jonathan Wakely  ---
(In reply to Martin Sebor from comment #3)
> In C, mode GCC accepts the test case from comment #0 but with -Wpedantic
> issues a warning:
> 
> t.c:8:14: warning: invalid use of structure with flexible array member
> [-Wpedantic]

Ah, I missed that when checking with the C front end, thanks.

[Bug c++/81234] [6 Regression] stray notes for a flexible array member not at end of struct

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81234

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |6.4

[Bug c++/81239] std::__cxx11::string& visible in gcc warning output

2017-06-28 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81239

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-06-28
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely  ---
(In reply to Jon Grant from comment #0)
> I noticed that with, or without -std=c++11 on gcc params, the output of
> std::string for references still shows __cxx11. for const ref, it isn't
> shown in the warning.  

Confirmed, they should be consistent.

> The later warning is ok main.cpp:10:6

That's because it just displays the original source code.

[Bug c++/81237] Cannot link when class methods compiled with different levels of vectorization

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81237

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-06-28
 Ever confirmed|0   |1

[Bug target/68535] arm.c: 5 * set but not used

2017-06-28 Thread collison at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68535

--- Comment #3 from collison at gcc dot gnu.org ---
Author: collison
Date: Wed Jun 28 07:07:49 2017
New Revision: 249721

URL: https://gcc.gnu.org/viewcvs?rev=249721=gcc=rev
Log:
2017-06-28  Michael Collison  

PR target/68535
* config/arm/arm.c (gen_ldm_seq): Remove last unnecessary
set of base_reg
(arm_gen_movmemqi): Removed unused variable 'i'.
Convert 'for' loop into 'while' loop.
(arm_expand_prologue): Remove last unnecessary set of insn.
(thumb_pop): Remove unused variable 'pushed_words'.
(thumb_exit): Remove last unnecessary set of regs_to_pop.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/arm/arm.c

[Bug rtl-optimization/81194] [8 Regression] ICE during RTL pass: expand

2017-06-28 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81194

--- Comment #9 from Richard Biener  ---
(In reply to Peter Bergner from comment #8)
> So we have a switch statement with onc case and a default case statement. 
> The normal case statement contains an __builtin_unreachable() call, so we
> delete the case statement, leaving us with only the default case.  We then
> call into expand_case() and we have this code which has been there for a
> while:
> 
>   /* Get upper and lower bounds of case values.  */
>   elt = gimple_switch_label (stmt, 1);
> 
> Since there is only one default case statement in stmt, asking for the label
> at offset "1" is illegal and that leads to the ICE.  Either we need to
> protect this code or maybe we can remove the switch statement all together.

I think we should be defensive here but also take the opportunity to remove
the switch stmt.