[Bug c++/84854] New: [7/8 Regression] ICE: unexpected expression in cxx_eval_constant_expression, at cp/constexpr.c:4774

2018-03-13 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84854

Bug ID: 84854
   Summary: [7/8 Regression] ICE: unexpected expression in
cxx_eval_constant_expression, at cp/constexpr.c:4774
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20160807 and 20160814 :


$ cat z1.cc
template  void a() {
  if constexpr(a) { };
}


$ gcc-8-20180311 -c z1.cc
z1.cc: In function 'void a()':
z1.cc:2:6: warning: 'if constexpr' only available with -std=c++17 or
-std=gnu++17
   if constexpr(a) { };
  ^
z1.cc:2:17: internal compiler error: unexpected expression 'a' of kind overload
   if constexpr(a) { };
 ^
0x6a506d cxx_eval_constant_expression
../../gcc/cp/constexpr.c:4774
0x6a67fc cxx_eval_outermost_constant_expr
../../gcc/cp/constexpr.c:4833
0x793945 finish_if_stmt_cond(tree_node*, tree_node*)
../../gcc/cp/semantics.c:739
0x737e93 cp_parser_selection_statement
../../gcc/cp/parser.c:11393
0x737e93 cp_parser_statement
../../gcc/cp/parser.c:10816
0x7387a7 cp_parser_statement_seq_opt
../../gcc/cp/parser.c:11274
0x73887f cp_parser_compound_statement
../../gcc/cp/parser.c:11228
0x74a37e cp_parser_function_body
../../gcc/cp/parser.c:21778
0x74a37e cp_parser_ctor_initializer_opt_and_function_body
../../gcc/cp/parser.c:21813
0x74ab40 cp_parser_function_definition_after_declarator
../../gcc/cp/parser.c:26828
0x74dce6 cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/cp/parser.c:26745
0x74dce6 cp_parser_init_declarator
../../gcc/cp/parser.c:19502
0x74e0cf cp_parser_single_declaration
../../gcc/cp/parser.c:27284
0x74e1bc cp_parser_template_declaration_after_parameters
../../gcc/cp/parser.c:26886
0x74e82c cp_parser_explicit_template_declaration
../../gcc/cp/parser.c:27124
0x74e82c cp_parser_template_declaration_after_export
../../gcc/cp/parser.c:27142
0x757929 cp_parser_declaration
../../gcc/cp/parser.c:12729
0x756356 cp_parser_declaration_seq_opt
../../gcc/cp/parser.c:12656
0x75665f cp_parser_translation_unit
../../gcc/cp/parser.c:4561
0x75665f c_parse_file()
../../gcc/cp/parser.c:39005

[Bug fortran/61775] Allocatable array initialized by implied-do loop array constructor gives invalid memory reference

2018-03-13 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61775

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |WAITING
 CC||kargl at gcc dot gnu.org

--- Comment #7 from kargl at gcc dot gnu.org ---
I think that this is now fixed on trunk.  Don't know which patch.

% gfcx -o z a.f90 && ./z
   1.
% gfcx -o z a.f90 -O2 -fcheck=all && ./z
   1.
% valgrind ./z
==85120== Memcheck, a memory error detector
==85120== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==85120== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==85120== Command: ./z
==85120== 
   1.
==85120== 
==85120== HEAP SUMMARY:
==85120== in use at exit: 0 bytes in 0 blocks
==85120==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==85120== 
==85120== All heap blocks were freed -- no leaks are possible
==85120== 
==85120== For counts of detected and suppressed errors, rerun with: -v
==85120== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

I've read the tree dump for -fdump-tree-optimized and it appears to
do the right think with expanding the constructor, allocating, and
freeing memory.

Both 6-branch and 7-branch still fail
% gfc6 -o z a.f90 -O2 -fcheck=all && ./z
 Segmentation fault (core dumped)
% gfc7 -o z a.f90 -O2 -fcheck=all && ./z
Segmentation fault (core dumped)

I would like to close this as fixed after committing the following
testcase

program pi
real   , allocatable :: x(:)
integer  :: n
n  = 1
x = [ (i,i=1,n) ]
if (x(n) /= 1) stop 1
end

[Bug c/84852] [8 Regression] ICE in calculate_line_spans, at diagnostic-show-locus.c:1105

2018-03-13 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84852

David Malcolm  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #2 from David Malcolm  ---
Started with r250203 ("c/c++: Add fix-it hints for suggested missing
#includes")

[Bug c++/84854] [7/8 Regression] ICE: unexpected expression in cxx_eval_constant_expression, at cp/constexpr.c:4774

2018-03-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84854

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-13
 CC||mpolacek at gcc dot gnu.org
   Target Milestone|--- |7.4
 Ever confirmed|0   |1

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

[Bug c++/84854] [7/8 Regression] ICE: unexpected expression in cxx_eval_constant_expression, at cp/constexpr.c:4774

2018-03-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84854

--- Comment #2 from Marek Polacek  ---
Started with r239338.

[Bug c++/84854] [7/8 Regression] ICE: unexpected expression in cxx_eval_constant_expression, at cp/constexpr.c:4774

2018-03-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84854

Marek Polacek  changed:

   What|Removed |Added

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

[Bug c/84853] [7/8 Regression] ICE: verify_gimple failed (expand_shift_1)

2018-03-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84853

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-13
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Confirmed.  Started with r238936.

[Bug c/84853] [7/8 Regression] ICE: verify_gimple failed (expand_shift_1)

2018-03-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84853

Marek Polacek  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
   Target Milestone|--- |7.4

[Bug c++/84839] [6/7/8 Regression] ICE (Segmentation fault) when `decltype` is used with parameter pack

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84839

--- Comment #2 from Jason Merrill  ---
Author: jason
Date: Tue Mar 13 18:57:10 2018
New Revision: 258500

URL: https://gcc.gnu.org/viewcvs?rev=258500=gcc=rev
Log:
PR c++/84839 - ICE with decltype of parameter pack.

* pt.c (tsubst_pack_expansion): Set cp_unevaluated_operand while
instantiating dummy parms.

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

[Bug c/84852] New: [8 Regression] ICE in calculate_line_spans, at diagnostic-show-locus.c:1105

2018-03-13 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84852

Bug ID: 84852
   Summary: [8 Regression] ICE in calculate_line_spans, at
diagnostic-show-locus.c:1105
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20170618 and 20170716 :


$ cat z1.c
#line 77
int foo (void) { return strlen(""); }


$ gcc-8-20180311 -c z1.c
z1.c: In function 'foo':
z1.c:-812156815:25: warning: implicit declaration of function 'strlen'
[-Wimplicit-function-declaration]
z1.c:-812156815:25: warning: incompatible implicit declaration of built-in
function 'strlen'
z1.c:-812156815:25: note: include '' or provide a declaration of
'strlen'

z1.c:-812156815:1: internal compiler error: in calculate_line_spans, at
diagnostic-show-locus.c:1105
0x123853b calculate_line_spans
../../gcc/diagnostic-show-locus.c:1105
0x123853b layout
../../gcc/diagnostic-show-locus.c:819
0x1238724 diagnostic_show_locus(diagnostic_context*, rich_location*,
diagnostic_t)
../../gcc/diagnostic-show-locus.c:1970
0x6f8df7 c_diagnostic_finalizer
../../gcc/c-family/c-opts.c:169
0x12352f5 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.c:989
0x1235743 diagnostic_impl
../../gcc/diagnostic.c:1108
0x1236489 inform(rich_location*, char const*, ...)
../../gcc/diagnostic.c:1181
0x666377 implicitly_declare(unsigned int, tree_node*)
../../gcc/c/c-decl.c:3418
0x67a4db build_external_ref(unsigned int, tree_node*, bool, tree_node**)
../../gcc/c/c-typeck.c:2755
0x6980d7 c_parser_postfix_expression
../../gcc/c/c-parser.c:7881
0x6a0fa2 c_parser_unary_expression
../../gcc/c/c-parser.c:7263
0x6a1d57 c_parser_cast_expression
../../gcc/c/c-parser.c:7104
0x6a2023 c_parser_binary_expression
../../gcc/c/c-parser.c:6907
0x6a3065 c_parser_conditional_expression
../../gcc/c/c-parser.c:6645
0x6a35f0 c_parser_expr_no_commas
../../gcc/c/c-parser.c:6562
0x6a3872 c_parser_expression
../../gcc/c/c-parser.c:9292
0x6a4d79 c_parser_expression_conv
../../gcc/c/c-parser.c:9325
0x6b4c77 c_parser_statement_after_labels
../../gcc/c/c-parser.c:5451
0x6b0a4a c_parser_compound_statement_nostart
../../gcc/c/c-parser.c:5078
0x6b1156 c_parser_compound_statement
../../gcc/c/c-parser.c:4912

[Bug c++/84720] [7/8 Regression] internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'error_mark' in decl_anon_ns_mem_p, at cp/tree.c:3472

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84720

Jason Merrill  changed:

   What|Removed |Added

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

[Bug c/84853] New: [7/8 Regression] ICE: verify_gimple failed (expand_shift_1)

2018-03-13 Thread gs...@t-online.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84853

Bug ID: 84853
   Summary: [7/8 Regression] ICE: verify_gimple failed
(expand_shift_1)
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed before 20160807, invalid code affects version 7/8 :


$ cat z1.c
typedef float V __attribute__((vector_size(16)));
V
foo (int a, V b)
{
  return b << a;
}


$ gcc-8-20180311 -c z1.c
during RTL pass: expand
z1.c: In function 'foo':
z1.c:5:12: internal compiler error: in expand_shift_1, at expmed.c:2631
   return b << a;
  ~~^~~~
0x83168f expand_shift_1
../../gcc/expmed.c:2631
0x8329c3 expand_variable_shift(tree_code, machine_mode, rtx_def*, tree_node*,
rtx_def*, int)
../../gcc/expmed.c:2673
0x8500b0 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
../../gcc/expr.c:9381
0x75053d expand_gimple_stmt_1
../../gcc/cfgexpand.c:3729
0x75053d expand_gimple_stmt
../../gcc/cfgexpand.c:3790
0x75191d expand_gimple_basic_block
../../gcc/cfgexpand.c:5819
0x756da6 execute
../../gcc/cfgexpand.c:6425



Configured with --enable-checking=yes :

$ gcc-8-20180311 -c z1.c
z1.c: In function 'foo':
z1.c:3:1: error: type mismatch in shift expression
 foo (int a, V b)
 ^~~
V
V
int
D.1963 = b << a;
z1.c:3:1: internal compiler error: verify_gimple failed
0xcbbbcd verify_gimple_in_seq(gimple*)
../../gcc/tree-cfg.c:5247
0x9e35a7 gimplify_body(tree_node*, bool)
../../gcc/gimplify.c:12710
0x9e3944 gimplify_function_tree(tree_node*)
../../gcc/gimplify.c:12800
0x82e987 cgraph_node::analyze()
../../gcc/cgraphunit.c:670
0x832083 analyze_functions
../../gcc/cgraphunit.c:1131
0x832b92 symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.c:2691

[Bug c/84852] [8 Regression] ICE in calculate_line_spans, at diagnostic-show-locus.c:1105

2018-03-13 Thread dmalcolm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84852

David Malcolm  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-13
 CC||dmalcolm at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |dmalcolm at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from David Malcolm  ---
Confirmed; am investigating.

[Bug fortran/61775] Allocatable array initialized by implied-do loop array constructor gives invalid memory reference

2018-03-13 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61775

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4

[Bug c++/84849] Ambiguous resolution of braze initializer list to a class with explicit copy/move constructors

2018-03-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84849

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-13
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely  ---
(In reply to Jose Dapena Paz from comment #0)
> For a template class with explicit copy and move constructors,

Those aren't copy and move constructors.

Reduced:

struct X
{
  X(const char*) { }
};

template 
class Foo {
 public:
  template 
  explicit Foo(Args&&... args);

  explicit Foo(const T&);
  explicit Foo(T&&) { }

  Foo(const Foo&) = delete;
  Foo& operator=(const Foo&) = delete;

  ~Foo() = default;
};

int main() {
  Foo v({"a"});
}



vs.cc: In function 'int main()':
vs.cc:22:17: error: call of overloaded 'Foo()'
is ambiguous
   Foo v({"a"});
 ^
vs.cc:15:3: note: candidate: 'Foo::Foo(const Foo&) [with T = X]'

   Foo(const Foo&) = delete;
   ^~~
vs.cc:13:12: note: candidate: 'Foo::Foo(T&&) [with T = X]'
   explicit Foo(T&&) { }
^~~
vs.cc:12:12: note: candidate: 'Foo::Foo(const T&) [with T = X]'
   explicit Foo(const T&);
^~~

[Bug c++/84849] Ambiguous resolution of braze initializer list to a class with explicit constructors

2018-03-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84849

Jonathan Wakely  changed:

   What|Removed |Added

Summary|Ambiguous resolution of |Ambiguous resolution of
   |braze initializer list to a |braze initializer list to a
   |class with explicit |class with explicit
   |copy/move constructors  |constructors

--- Comment #2 from Jonathan Wakely  ---
Further reduced:


struct X {
  X(int) { }
};

struct Foo {
  explicit Foo(const X&);
  explicit Foo(X&&) { }
};

int main() {
  Foo v({1});
}


vs.cc: In function 'int main()':
vs.cc:11:12: error: call of overloaded 'Foo()'
is ambiguous
   Foo v({1});
^
vs.cc:7:12: note: candidate: 'Foo::Foo(X&&)'
   explicit Foo(X&&) { }
^~~
vs.cc:6:12: note: candidate: 'Foo::Foo(const X&)'
   explicit Foo(const X&);
^~~
vs.cc:5:8: note: candidate: 'constexpr Foo::Foo(const Foo&)'
 struct Foo {
^~~
vs.cc:5:8: note: candidate: 'constexpr Foo::Foo(Foo&&)'

[Bug c++/84720] [7/8 Regression] internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'error_mark' in decl_anon_ns_mem_p, at cp/tree.c:3472

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84720

--- Comment #3 from Jason Merrill  ---
Author: jason
Date: Tue Mar 13 18:58:15 2018
New Revision: 258501

URL: https://gcc.gnu.org/viewcvs?rev=258501=gcc=rev
Log:
PR c++/84720 - ICE with rvalue ref non-type argument.

* pt.c (convert_nontype_argument): Handle rvalue references.

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

[Bug fortran/61775] Allocatable array initialized by implied-do loop array constructor gives invalid memory reference

2018-03-13 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61775

Thomas Koenig  changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu.org

--- Comment #8 from Thomas Koenig  ---
(In reply to kargl from comment #7)

> I would like to close this as fixed after committing the following
> testcase
> 
> program pi
> real   , allocatable :: x(:)
> integer  :: n
> n  = 1
> x = [ (i,i=1,n) ]
> if (x(n) /= 1) stop 1
> end

Sure, go ahead.

[Bug c++/84349] [6/7/8 Regression] ICE with auto in function cast

2018-03-13 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84349

Volker Reichelt  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org
 Depends on||84798

--- Comment #3 from Volker Reichelt  ---
This was fixed on trunk by Jason's patch for PR84798.
Do we want to add this as a testcase or close it as a duplicate?


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84798
[Bug 84798] [6/7 Regression] ICE (Segmentation fault) if `auto` appears in a
template argument

[Bug c++/84798] [6/7 Regression] ICE (Segmentation fault) if `auto` appears in a template argument

2018-03-13 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84798

Volker Reichelt  changed:

   What|Removed |Added

 CC||reichelt at gcc dot gnu.org

--- Comment #7 from Volker Reichelt  ---
*** Bug 84541 has been marked as a duplicate of this bug. ***

[Bug c++/84541] ICE with auto in function parameter

2018-03-13 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84541

Volker Reichelt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #3 from Volker Reichelt  ---
Duplicate of PR84798.

*** This bug has been marked as a duplicate of bug 84798 ***

[Bug tree-optimization/84737] [8 Regression] 20% degradation in CPU2000 172.mgrid starting with r256888

2018-03-13 Thread pthaugen at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84737

--- Comment #9 from Pat Haugen  ---
(In reply to Martin Jambor from comment #7)
> Do I understand it correctly that you suspect that the new IPA-CP
> clone that is created from r256888 on is harmful?  In that case, you
> want to test that by trying higher values of ipa-cp-eval-threshold,
> something like --param ipa-cp-eval-threshold 610 (i.e. bigger than
> 606).  Of course, if there are other clones with evaluations between
> 500 and 610, it would affect them too.
> 

Building with --param ipa-cp-eval-threshold=610 prevented the creation of the
.resid_.constprop.1 clone and eliminated the performance degradation.

Looking at the profile more in depth, I saw that most of the time in
resid_.constprop was spent in the main vectorized loop. I tried both revisions
with -fno-tree-vectorize to see if vectorization in the clone is the real
problem on powerpc, but ran into issues with output miscompare (pr83497, which
I'm still digging on). Ignoring output miscompare and just timing the two
versions built with -fno-tree-vectorize, I see that the  performance is
similar. So possibly a powerpc vector cost issue.


> You may also want to try both fast and slow revisions with
> -fno-ipa-cp-clone as the first step, actually.

Doing this showed r256888 about 4% slower, so not near as bad.

[Bug c++/84798] [6/7 Regression] ICE (Segmentation fault) if `auto` appears in a template argument

2018-03-13 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84798

--- Comment #8 from Volker Reichelt  ---
*** Bug 79525 has been marked as a duplicate of this bug. ***

[Bug c++/79525] [c++1y] ICE with auto as function parameter

2018-03-13 Thread reichelt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79525

Volker Reichelt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
  Known to work||8.0.1
 Resolution|--- |DUPLICATE
  Known to fail||7.3.0

--- Comment #2 from Volker Reichelt  ---
This was fixed by Jason's patch for PR84798.

*** This bug has been marked as a duplicate of bug 84798 ***

[Bug c++/82565] [7/8 Regression] Concept and lambda return type deduction cause compilation to crash with "mmap: Cannot allocate memory"

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82565

--- Comment #4 from Jason Merrill  ---
Author: jason
Date: Tue Mar 13 20:22:31 2018
New Revision: 258502

URL: https://gcc.gnu.org/viewcvs?rev=258502=gcc=rev
Log:
PR c++/82565 - ICE with concepts and generic lambda.

* pt.c (instantiate_decl): Clear fn_context for lambdas.

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

[Bug c++/82565] [7 Regression] Concept and lambda return type deduction cause compilation to crash with "mmap: Cannot allocate memory"

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82565

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org
Summary|[7/8 Regression] Concept|[7 Regression] Concept and
   |and lambda return type  |lambda return type
   |deduction cause compilation |deduction cause compilation
   |to crash with "mmap: Cannot |to crash with "mmap: Cannot
   |allocate memory"|allocate memory"

[Bug c++/67491] [meta-bug] concepts issues

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
Bug 67491 depends on bug 81918, which changed state.

Bug 81918 Summary: [7/8 Regression] muddled Concept confuses compiler (segfault)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81918

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

[Bug c++/82565] [7 Regression] Concept and lambda return type deduction cause compilation to crash with "mmap: Cannot allocate memory"

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82565

Jason Merrill  changed:

   What|Removed |Added

 CC||jesse at mind dot net

--- Comment #5 from Jason Merrill  ---
*** Bug 81918 has been marked as a duplicate of this bug. ***

[Bug c++/82565] [7 Regression] Concept and lambda return type deduction cause compilation to crash with "mmap: Cannot allocate memory"

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82565

Jason Merrill  changed:

   What|Removed |Added

 CC||gccbugzilla at szaszm dot tk

--- Comment #6 from Jason Merrill  ---
*** Bug 81997 has been marked as a duplicate of this bug. ***

[Bug c++/67491] [meta-bug] concepts issues

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
Bug 67491 depends on bug 81997, which changed state.

Bug 81997 Summary: [7/8 Regression] segfault while instantiating constrained 
function template
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81997

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

[Bug c++/81918] [7/8 Regression] muddled Concept confuses compiler (segfault)

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81918

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #4 from Jason Merrill  ---
Same issue.

*** This bug has been marked as a duplicate of bug 82565 ***

[Bug c++/81997] [7/8 Regression] segfault while instantiating constrained function template

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81997

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #6 from Jason Merrill  ---
Same issue.

*** This bug has been marked as a duplicate of bug 82565 ***

[Bug c++/84843] [8 Regression] C++ ICE on builtin redefinition since r258391

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84843

--- Comment #8 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar 13 20:32:54 2018
New Revision: 258503

URL: https://gcc.gnu.org/viewcvs?rev=258503=gcc=rev
Log:
PR c++/84843
* decl.c (duplicate_decls): For redefinition of built-in, use error
and return error_mark_node.  For redeclaration, return error_mark_node
rather than olddecl if !flag_permissive.

* g++.dg/ext/pr84843-1.C: New test.
* g++.dg/ext/pr84843-2.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/ext/pr84843-1.C
trunk/gcc/testsuite/g++.dg/ext/pr84843-2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/testsuite/ChangeLog

[Bug c++/84843] [8 Regression] C++ ICE on builtin redefinition since r258391

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84843

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #9 from Jakub Jelinek  ---
Fixed.

[Bug c++/82410] [7/8 Regression] ICE in replace_placeholders_r

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82410

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #8 from Jason Merrill  ---
It really is the same issue.

*** This bug has been marked as a duplicate of bug 79937 ***

[Bug c++/79937] [6/7/8 Regression] ICE in replace_placeholders_r

2018-03-13 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79937

--- Comment #19 from Jason Merrill  ---
*** Bug 82410 has been marked as a duplicate of this bug. ***

[Bug target/83712] [6/7 Regression] "Unable to find a register to spill" when compiling for thumb1

2018-03-13 Thread vmakarov at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83712

--- Comment #11 from Vladimir Makarov  ---
Author: vmakarov
Date: Tue Mar 13 20:42:49 2018
New Revision: 258504

URL: https://gcc.gnu.org/viewcvs?rev=258504=gcc=rev
Log:
2018-03-13  Vladimir Makarov  

PR target/83712
* lra-assigns.c (find_all_spills_for): Ignore uninteresting
pseudos.
(assign_by_spills): Return a flag of reload assignment failure.
Do not process the reload assignment failures.  Do not spill other
reload pseudos if they has the same reg class.  Update n if
necessary.
(lra_assign): Add a return arg.  Set up from the result of
assign_by_spills call.
(find_reload_regno_insns, lra_split_hard_reg_for): New functions.
* lra-constraints.c (split_reg): Add a new arg.  Use it instead of
usage_insns if it is not NULL.
(spill_hard_reg_in_range): New function.
(split_if_necessary, inherit_in_ebb): Pass a new arg to split_reg.
* lra-int.h (spill_hard_reg_in_range, lra_split_hard_reg_for): New
function prototypes.
(lra_assign): Change prototype.
* lra.c (lra): Add code to deal with fails by splitting hard reg
live ranges.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/lra-assigns.c
trunk/gcc/lra-constraints.c
trunk/gcc/lra-int.h
trunk/gcc/lra.c

[Bug c++/84840] [6/7/8 Regression] ICE (in poplevel_class) for `auto` in alias declaration

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84840

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P2
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-13
 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org
   Target Milestone|--- |6.5
Summary|ICE (in poplevel_class) for |[6/7/8 Regression] ICE (in
   |`auto` in alias declaration |poplevel_class) for `auto`
   ||in alias declaration
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Started with r202612.  This one wouldn't be fixed even with an error in there
instead of pedwarn - the ICE happens even with -pedantic-errors.

[Bug ipa/84833] [8 Regression] target_clones regression since r251047

2018-03-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84833

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #1 from Martin Liška  ---
Let me take care of it.

[Bug middle-end/84831] Invalid memory read in parse_output_constraint

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84831

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar 13 08:12:07 2018
New Revision: 258478

URL: https://gcc.gnu.org/viewcvs?rev=258478=gcc=rev
Log:
PR middle-end/84831
* stmt.c (parse_output_constraint): If the CONSTRAINT_LEN (*p, p)
characters starting at p contain '\0' character, don't look beyond
that.

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

[Bug tree-optimization/84830] [8 Regression] ICE in compute_antic, at tree-ssa-pre.c:2388

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84830

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P1
 CC||jakub at gcc dot gnu.org
   Target Milestone|--- |8.0

[Bug ipa/84833] [8 Regression] target_clones regression since r251047

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84833

--- Comment #2 from Jakub Jelinek  ---
Just a note, as can be seen e.g. on
static volatile int a;
static int my_foo1 (void) { return 1; }
static int my_foo2 (void) { return 2; }
typedef int (*F) (void);
static F resolve_foo (void) { if (a) return my_foo1; else return my_foo2; }
static int foo (void) __attribute__ ((ifunc ("resolve_foo")));

int
main ()
{
  if (foo () != 2)
__builtin_abort ();
}
there is no reason why any of the target clones, resolver or the ifunc function
should be .globl, they can all be local to the TU, IFUNC work just fine that
way too.  So, if the function with target_clones attribute is not TREE_PUBLIC,
neither should be any of the multiple_targets.c created symbols.

[Bug target/84828] ICE in verify_flow_info at gcc/cfghooks.c:265

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84828

--- Comment #3 from Jakub Jelinek  ---
Fixed for 8.1+ so far.

[Bug target/84827] [7 Regression] ICE in extract_insn, at recog.c:2311

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84827

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[7/8 Regression] ICE in |[7 Regression] ICE in
   |extract_insn, at|extract_insn, at
   |recog.c:2311|recog.c:2311

--- Comment #4 from Jakub Jelinek  ---
Fixed for 8.1+ so far.

[Bug target/84786] [miscompilation] vunpcklpd accessing xmm16-22 targeting KNL

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84786

--- Comment #7 from Jakub Jelinek  ---
Fixed for 8.1+ so far.

[Bug target/84786] [miscompilation] vunpcklpd accessing xmm16-22 targeting KNL

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84786

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar 13 08:03:28 2018
New Revision: 258475

URL: https://gcc.gnu.org/viewcvs?rev=258475=gcc=rev
Log:
PR target/84786
* config/i386/sse.md (sse2_loadhpd): Use Yv constraint rather than v
on the last operand.

* gcc.target/i386/avx512f-pr84786-1.c: New test.
* gcc.target/i386/avx512f-pr84786-2.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/avx512f-pr84786-1.c
trunk/gcc/testsuite/gcc.target/i386/avx512f-pr84786-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/sse.md
trunk/gcc/testsuite/ChangeLog

[Bug ipa/84658] [7/8 Regression] -O3 -fmerge-all-constants causes incorrect for-each loop generation.

2018-03-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84658

Martin Liška  changed:

   What|Removed |Added

  Known to work||8.0
  Known to fail|8.0 |

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

[Bug rtl-optimization/84780] [8 Regression] wrong code aarch64 with -O3 --param=tree-reassoc-width=32

2018-03-13 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84780

--- Comment #10 from Zdenek Sojka  ---
(In reply to Segher Boessenkool from comment #8)
> Created attachment 43631 [details]
> proposed patch
> 
> I cannot reproduce that exact generated code; maybe it needs tuning for some
> particular CPU?
> 
> Could you try the attached patch?  Thanks!

This is causing segfault:

$ cat testcase.c 
int a, d;
long b;
__int128 c;
void foo(void)
{
  a &= 0 < b;
  do {
c = b >>= 63;
c -= __builtin_add_overflow_p(0, b, d);
  } while (a >= 255);
}

$ aarch64-unknown-linux-gnu-gcc -Og testcase.c
during RTL pass: combine
testcase.c: In function 'foo':
testcase.c:11:1: internal compiler error: Segmentation fault
 }
 ^
0xc927bf crash_signal
/repo/gcc-trunk/gcc/toplev.c:325
0xc11391 reg_used_between_p(rtx_def const*, rtx_insn const*, rtx_insn const*)
/repo/gcc-trunk/gcc/rtlanal.c:1128
0x13c1486 can_combine_p
/repo/gcc-trunk/gcc/combine.c:1993
...

[Bug target/84827] [7/8 Regression] ICE in extract_insn, at recog.c:2311

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84827

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar 13 08:05:58 2018
New Revision: 258477

URL: https://gcc.gnu.org/viewcvs?rev=258477=gcc=rev
Log:
PR target/84827
* config/i386/i386.md (round2): For 387 fancy math, disable
pattern if -ftrapping-math -fno-fp-int-builtin-inexact.

* gcc.target/i386/pr84827.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/pr84827.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.md
trunk/gcc/testsuite/ChangeLog

[Bug target/84828] ICE in verify_flow_info at gcc/cfghooks.c:265

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84828

--- Comment #2 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar 13 08:04:54 2018
New Revision: 258476

URL: https://gcc.gnu.org/viewcvs?rev=258476=gcc=rev
Log:
PR target/84828
* reg-stack.c (change_stack): Change update_end var from int to
rtx_insn *, if non-NULL don't update just BB_END (current_block), but
also call set_block_for_insn on the newly added insns and rescan.

* g++.dg/ext/pr84828.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/ext/pr84828.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/reg-stack.c
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/84834] [7/8 Regression] ICE: tree check: expected integer_cst, have complex_cst in to_wide, at tree.h:5527

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84834

--- Comment #6 from Jakub Jelinek  ---
Author: jakub
Date: Tue Mar 13 08:12:59 2018
New Revision: 258479

URL: https://gcc.gnu.org/viewcvs?rev=258479=gcc=rev
Log:
PR middle-end/84834
* match.pd ((A & C) != 0 ? D : 0): Use INTEGER_CST@2 instead of
integer_pow2p@2 and test integer_pow2p in condition.
(A < 0 ? C : 0): Similarly for @1.

* gcc.dg/pr84834.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/pr84834.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/match.pd
trunk/gcc/testsuite/ChangeLog

[Bug middle-end/84831] Invalid memory read in parse_output_constraint

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84831

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #7 from Jakub Jelinek  ---
Fixed.

[Bug middle-end/84834] [7 Regression] ICE: tree check: expected integer_cst, have complex_cst in to_wide, at tree.h:5527

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84834

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[7/8 Regression] ICE: tree  |[7 Regression] ICE: tree
   |check: expected |check: expected
   |integer_cst, have   |integer_cst, have
   |complex_cst in to_wide, at  |complex_cst in to_wide, at
   |tree.h:5527 |tree.h:5527

--- Comment #7 from Jakub Jelinek  ---
Fixed for 8.1+ so far.

[Bug ipa/84658] [7/8 Regression] -O3 -fmerge-all-constants causes incorrect for-each loop generation.

2018-03-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84658

--- Comment #24 from Martin Liška  ---
Author: marxin
Date: Tue Mar 13 08:20:27 2018
New Revision: 258480

URL: https://gcc.gnu.org/viewcvs?rev=258480=gcc=rev
Log:
Fix PTA info in IPA ICF (PR ipa/84658).

2018-03-13  Martin Liska  

PR ipa/84658.
* (sem_item_optimizer::sem_item_optimizer): Initialize new
vector.
(sem_item_optimizer::~sem_item_optimizer): Release it.
(sem_item_optimizer::merge_classes): Register variable aliases.
(sem_item_optimizer::fixup_pt_set): New function.
(sem_item_optimizer::fixup_points_to_sets): Likewise.
* ipa-icf.h: Declare new variables and functions.
2018-03-13  Martin Liska  

PR ipa/84658.
* g++.dg/ipa/pr84658.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/ipa/pr84658.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-icf.c
trunk/gcc/ipa-icf.h
trunk/gcc/testsuite/ChangeLog

[Bug tree-optimization/84811] ICE on valid code at -O3 in 64-bit mode on x86_64-linux-gnu: in smallest_mode_for_size, at stor-layout.c:355

2018-03-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84811

--- Comment #5 from Martin Liška  ---
> gcc version 8.0.1 20180310 (experimental) [trunk revision 258413] (GCC)

Just a nit, this revision mentioned above is actually from GCC 7 branch. Isn't
that the issue?

[Bug c++/84839] [6/7/8 Regression] ICE (Segmentation fault) when `decltype` is used with parameter pack

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84839

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P2
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-13
 CC||jakub at gcc dot gnu.org,
   ||jason at gcc dot gnu.org
   Target Milestone|--- |6.5
Summary|ICE (Segmentation fault)|[6/7/8 Regression] ICE
   |when `decltype` is used |(Segmentation fault) when
   |with parameter pack |`decltype` is used with
   ||parameter pack
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
This got rejected still in r182662
pr84839.C: In instantiation of ‘struct S’:
pr84839.C:6:17:   required from here
pr84839.C:3:51: error: expansion pattern ‘int’ contains no argument packs
and segfaults already in r182686, don't have the revisions in between, but most
likely either r182668 or r182667.
The segfault is infinite recursion of tsubst_pack_expansion -> tsubst_decl ->
tsubst -> tsubst_decl, wonder why the instantiation depth limits don't catch
it.

[Bug libstdc++/83906] [8 Regression] Random FAIL: libstdc++-prettyprinters/80276.cc whatis p4

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83906

--- Comment #16 from Jakub Jelinek  ---
So just add a gdb >= 8.1 version test in
libstdc++-v3/testsuite/lib/gdb-test.exp
and guard this test on effective target gdb_8_1?

[Bug tree-optimization/84841] [8 Regression] ICE: tree check: expected ssa_name, have real_cst in rewrite_expr_tree_parallel, at tree-ssa-reassoc.c:4624

2018-03-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84841

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-13
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

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

[Bug c++/84843] [8 Regression] C++ ICE on builtin redefinition since r258391

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84843

--- Comment #6 from Jakub Jelinek  ---
return newdecl is something we never do, we either return error_mark_node (an
error), or NULL_TREE (the olddecl and newdecl are different thing) or olddecl
(after merging the two decls).
One way out of this would be to change the permerror into just error and return
error_mark_node, or at least do that if DECL_INITIAL (newdecl) is non-NULL,
i.e. under -fpermissive allow and ignore redeclarations for builtins, but
always reject redefinitions.

[Bug target/84844] [8 Regression] ICE in extract_constrain_insn_cached, at recog.c:2217 (error: insn does not satisfy its constraints)

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84844

--- Comment #2 from Jakub Jelinek  ---
The problem is that if a constraint returns NO_REGS before RA (i.e. in
non-strict mode) then that alternative is ignored, and e.g. get_attr_type used
by sched1 needs to compute alternative.  As the instruction uses
nonimmediate_operand and the only alternative with "r" input has "Yc" output
which is NO_REGS for this -march=, if the operand is a register, there is no
alternative left.

The following patch fixes this for me:
--- gcc/config/i386/i386.md.jj  2018-03-13 09:05:22.480987994 +0100
+++ gcc/config/i386/i386.md 2018-03-13 12:44:21.372058947 +0100
@@ -5325,16 +5325,17 @@
 })

 (define_insn "*float2_mixed"
-  [(set (match_operand:MODEF 0 "register_operand" "=f,Yc,v")
+  [(set (match_operand:MODEF 0 "register_operand" "=f,Yc,v,!???v")
(float:MODEF
- (match_operand:SWI48 1 "nonimmediate_operand" "m,r,m")))]
+ (match_operand:SWI48 1 "nonimmediate_operand" "m,r,m,r")))]
   "SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH"
   "@
fild%Z1\t%1
%vcvtsi2\t{%1, %d0|%d0, %1}
+   %vcvtsi2\t{%1, %d0|%d0, %1}
%vcvtsi2\t{%1, %d0|%d0, %1}"
-  [(set_attr "type" "fmov,sseicvt,sseicvt")
-   (set_attr "prefix" "orig,maybe_vex,maybe_vex")
+  [(set_attr "type" "fmov,sseicvt,sseicvt,sseicvt")
+   (set_attr "prefix" "orig,maybe_vex,maybe_vex,maybe_vex")
(set_attr "mode" "")
(set (attr "prefix_rex")
  (if_then_else
@@ -5342,11 +5343,11 @@
(match_test "mode == DImode"))
(const_string "1")
(const_string "*")))
-   (set_attr "unit" "i387,*,*")
-   (set_attr "athlon_decode" "*,double,direct")
-   (set_attr "amdfam10_decode" "*,vector,double")
-   (set_attr "bdver1_decode" "*,double,direct")
-   (set_attr "znver1_decode" "double,*,*")
+   (set_attr "unit" "i387,*,*,*")
+   (set_attr "athlon_decode" "*,double,direct,double")
+   (set_attr "amdfam10_decode" "*,vector,double,vector")
+   (set_attr "bdver1_decode" "*,double,direct,double")
+   (set_attr "znver1_decode" "double,*,*,*")
(set_attr "fp_int_src" "true")
(set (attr "enabled")
  (cond [(eq_attr "alternative" "0")

The CPU does support this insn, just it is very undesirable for tuning.
So, the !??? should tell reload to try very hard not to use that alternative.

[Bug rtl-optimization/84842] New: ICE in verify_target_availability, at sel-sched.c:1569

2018-03-13 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84842

Bug ID: 84842
   Summary: ICE in verify_target_availability, at sel-sched.c:1569
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---
Target: powerpc-*-linux-gnu*

gcc-8.0.0-alpha20180311 snapshot (r258438) ICEs when compiling the following
snippet w/ -mcpu=power8 -O1 -frename-registers -fschedule-insns2
-fselective-scheduling2 -ftrapv:

int ad;
double cm;

void
tn (int on, int zt, int rc)
{
  if (cm != 0.0)
{
  while ((on + cm * ad * 2 / zt) < 1)
zt = -rc;

  ad = cm / 2 + rc;
  ad = -on - ad;
}
}

% powerpc-e300c3-linux-gnu-gcc-8.0.0-alpha20180311 -mcpu=power8 -O1
-frename-registers -fschedule-insns2 -fselective-scheduling2 -ftrapv -c
vvk0ahws.c
during RTL pass: sched2
vvk0ahws.c: In function 'tn':
vvk0ahws.c:15:1: internal compiler error: in verify_target_availability, at
sel-sched.c:1569
 }
 ^
0xc13856 verify_target_availability
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:1566
0xc13856 find_best_reg_for_expr
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:1679
0xc13856 fill_vec_av_set
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:3797
0xc13fd0 fill_ready_list
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:4027
0xc13fd0 find_best_expr
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:4387
0xc13fd0 fill_insns
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:5544
0xc163ee schedule_on_fences
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:7361
0xc163ee sel_sched_region_2
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:7499
0xc18bf1 sel_sched_region_1
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:7541
0xc18bf1 sel_sched_region(int)
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:7642
0xc192c1 run_selective_scheduling()
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:7718
0xbf012d rest_of_handle_sched2
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sched-rgn.c:3729
0xbf012d execute
   
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sched-rgn.c:3873

[Bug c++/84843] [8 Regression] C++ ICE on builtin redefinition since r258391

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84843

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P4  |P1

--- Comment #3 from Jakub Jelinek  ---
Actually P1, with -fpermissive this isn't error-recovery.

[Bug c++/84843] [8 Regression] C++ ICE on builtin redefinition since r258391

2018-03-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84843

--- Comment #5 from Richard Biener  ---
So, do we want to return newdecl unconditionally and scrap the olddecl
(builtin)
binding somehow?  For -fpermissive, of course?

[Bug c++/84843] [8 Regression] C++ ICE on builtin redefinition since r258391

2018-03-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84843

--- Comment #4 from Richard Biener  ---
I think if we have a definition we need to use newdecl ...

Now consider

extern "C" int __atomic_compare_exchange (int x, int y);

void bar() { __atomic_compare_exchange (1, 2); }

extern "C" int __atomic_compare_exchange (int x, int y)
{
  return x + y;
}

with -fpermissive and things get even more complicated.

> ./cc1plus -quiet t.ii  -fpermissive
t.ii:1:16: warning: new declaration ‘int __atomic_compare_exchange(int, int)’
ambiguates built-in declaration ‘bool __atomic_compare_exchange(long unsigned
int, volatile void*, void*, void*, int, int)’ [-fpermissive]
 extern "C" int __atomic_compare_exchange (int x, int y);
^
t.ii:1:16: note: ignoring the ‘int __atomic_compare_exchange(int, int)’
declaration
t.ii: In function ‘void bar()’:
t.ii:3:45: error: incorrect number of arguments to function
‘__atomic_compare_exchange’
 void bar() { __atomic_compare_exchange (1, 2); }
 ^
t.ii: At global scope:
t.ii:5:16: warning: new declaration ‘int __atomic_compare_exchange(int, int)’
ambiguates built-in declaration ‘bool __atomic_compare_exchange(long unsigned
int, volatile void*, void*, void*, int, int)’ [-fpermissive]
 extern "C" int __atomic_compare_exchange (int x, int y)
^
t.ii:5:16: note: ignoring the ‘int __atomic_compare_exchange(int, int)’
declaration
t.ii: In function ‘bool __atomic_compare_exchange(long unsigned int, volatile
void*, void*, void*, int, int)’:
t.ii:5:55: internal compiler error: in start_preparsed_function, at
cp/decl.c:15060
 extern "C" int __atomic_compare_exchange (int x, int y)
   ^
0x93685e start_preparsed_function(tree_node*, tree_node*, int)
...

[Bug libstdc++/83906] Random FAIL: libstdc++-prettyprinters/80276.cc whatis p4

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83906

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[8 Regression] Random FAIL: |Random FAIL:
   |libstdc++-prettyprinters/80 |libstdc++-prettyprinters/80
   |276.cc whatis p4|276.cc whatis p4

--- Comment #19 from Jakub Jelinek  ---
Ok, let's do it.

[Bug ipa/84833] [8 Regression] target_clones regression since r251047

2018-03-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84833

--- Comment #5 from Martin Liška  ---
(In reply to Jakub Jelinek from comment #2)
> Just a note, as can be seen e.g. on
> static volatile int a;
> static int my_foo1 (void) { return 1; }
> static int my_foo2 (void) { return 2; }
> typedef int (*F) (void);
> static F resolve_foo (void) { if (a) return my_foo1; else return my_foo2; }
> static int foo (void) __attribute__ ((ifunc ("resolve_foo")));
> 
> int
> main ()
> {
>   if (foo () != 2)
> __builtin_abort ();
> }
> there is no reason why any of the target clones, resolver or the ifunc
> function should be .globl, they can all be local to the TU, IFUNC work just
> fine that way too.  So, if the function with target_clones attribute is not
> TREE_PUBLIC, neither should be any of the multiple_targets.c created symbols.

If I see correctly, we do not make these global:

nm pr84833-2.o 
 b a
 U abort
000c i foo
0022 T main
 t my_foo1
0006 t my_foo2
000c t resolve_foo

Note that it was subject of PR81213.

[Bug c++/84676] [6/7/8 Regression] internal compiler error: Segmentation fault (build_new_op_1)

2018-03-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84676

Marek Polacek  changed:

   What|Removed |Added

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

[Bug libstdc++/71660] [6/7/8 regression] alignment of std::atomic<8 byte primitive type> (long long, double) is wrong on x86

2018-03-13 Thread peter at cordes dot ca
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71660

--- Comment #17 from Peter Cordes  ---
(In reply to Jonathan Wakely from comment #16)
> But what we do care about is comment 2, i.e. _Atomic(T) and std::atomic
> should have the same alignment (both in an out of structs). Maybe that needs
> the C front-end to change how _Atomic works, or maybe it needs the C++
> library to change how std::atomic works, but I want to keep this bug open
> while comment 2 gives different answers for C and C++.

Right, gcc's C _Atomic ABI is still broken for long long on 32-bit x86.  It
only aligned _Atomic long long to 32 bits (inside structs), but then assumes
that 8-byte loads / stores (with x87 or SSE1/2) are atomic.

It also leads to abysmal performance for  LOCK CMPXCHG  or other RMW operations
if the atomic object is split across a cache line.

That's bug 65146, so we can close this one.  (I never got around to posting in
the google group for the ABI.  By far the best good solution is giving _Atomic
long long (and other 8-byte objects) a boost to their _Alignof, up to 8 byte
alignment even inside structs.)

[Bug tree-optimization/84841] [8 Regression] ICE: tree check: expected ssa_name, have real_cst in rewrite_expr_tree_parallel, at tree-ssa-reassoc.c:4624

2018-03-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84841

--- Comment #2 from Marek Polacek  ---
Started with r236564.

[Bug c++/84843] New: [8 Regression] C++ ICE on builtin redefinition since r258391

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84843

Bug ID: 84843
   Summary: [8 Regression] C++ ICE on builtin redefinition since
r258391
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

extern "C" int __atomic_compare_exchange (int x, int y) { return x + y; }
ICEs starting with the above revision in:
0x8fc5c2 start_preparsed_function(tree_node*, tree_node*, int)
../../gcc/cp/decl.c:15060
0x8fe24c start_function(cp_decl_specifier_seq*, cp_declarator const*,
tree_node*)
../../gcc/cp/decl.c:15287
0x9e01b3 cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/cp/parser.c:26700
0x9d1e88 cp_parser_init_declarator
../../gcc/cp/parser.c:19502
0x9c5be7 cp_parser_simple_declaration
../../gcc/cp/parser.c:13057
0x9c5750 cp_parser_block_declaration
../../gcc/cp/parser.c:12882
0x9c54d2 cp_parser_declaration
../../gcc/cp/parser.c:12780

[Bug tree-optimization/84841] [7/8 Regression] ICE: tree check: expected ssa_name, have real_cst in rewrite_expr_tree_parallel, at tree-ssa-reassoc.c:4624

2018-03-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84841

Marek Polacek  changed:

   What|Removed |Added

   Target Milestone|--- |7.4
Summary|[8 Regression] ICE: tree|[7/8 Regression] ICE: tree
   |check: expected ssa_name,   |check: expected ssa_name,
   |have real_cst in|have real_cst in
   |rewrite_expr_tree_parallel, |rewrite_expr_tree_parallel,
   |at tree-ssa-reassoc.c:4624  |at tree-ssa-reassoc.c:4624

[Bug tree-optimization/84841] [7/8 Regression] ICE: tree check: expected ssa_name, have real_cst in rewrite_expr_tree_parallel, at tree-ssa-reassoc.c:4624

2018-03-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84841

--- Comment #3 from Richard Biener  ---
At least latent on the GCC 7 branch and earlier.

  /* We start expression rewriting from the top statements.
 So, in this loop we create a full list of statements
 we will work with.  */
  stmts[stmt_num - 1] = stmt;
  for (i = stmt_num - 2; i >= 0; i--)
stmts[i] = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmts[i+1]));

assumes there are no unfolded CST +* CST ops in the IL.

OTOH we shouldn't rewrite any exprs with -frounding-math anyway?

That is, -fassociative-math and -frounding-math are (again) seemingly in
conflict?

[Bug target/84521] aarch64: Frame-pointer corruption with __builtin_setjmp/__builtin_longjmp and -fomit-frame-pointer

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84521

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P1  |P3
Summary|[8 Regression] aarch64: |aarch64: Frame-pointer
   |Frame-pointer corruption|corruption with
   |with|__builtin_setjmp/__builtin_
   |__builtin_setjmp/__builtin_ |longjmp and
   |longjmp and |-fomit-frame-pointer
   |-fomit-frame-pointer|

--- Comment #24 from Jakub Jelinek  ---
With the change of the default this actually isn't a regression anymore, so not
a release blocker.  That doesn't mean a simple fix, e.g. __builtin_setjmp
forcing frame pointer even if not otherwise needed, can't be accepted for GCC8
(as an exception), but it is unlikely right time for finding all issues with
the builtin and trying to fix all of them.  That can be done in GCC9.

[Bug ipa/84833] [8 Regression] target_clones regression since r251047

2018-03-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84833

--- Comment #4 from Martin Liška  ---
I can confirm the issue, there's missing edge to foo->baz and thus the symbol
is removed. I'll fix that.

[Bug ipa/84833] [8 Regression] target_clones regression since r251047

2018-03-13 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84833

--- Comment #3 from Martin Liška  ---
> Another (though preexisting) bug is lack of optimization, if we have a call
> or reference of a target_clones dispatcher in a function with the same
> target_clones attribute (or maybe even just target attribute or similar), we
> should optimize it at compile time into a reference to a particular target
> clone.
> 

Yes, I know about it and I'm planning to do it in next stage1. It's reported
here:
PR83411.

[Bug lto/81968] [8 regression] early lto debug objects make Solaris ld SEGV

2018-03-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81968

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |WAITING

--- Comment #62 from Richard Biener  ---
Waiting for Solaris engineer input...  (or a machine to be able to debug this
directly - is there one on the CF?).

[Bug libstdc++/83906] [8 Regression] Random FAIL: libstdc++-prettyprinters/80276.cc whatis p4

2018-03-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83906

--- Comment #17 from Jonathan Wakely  ---
Ideally I want the printer to still work for users with older versions of gdb.

[Bug lto/84805] [8 Regression] ICE in get_odr_type, at ipa-devirt.c:2096 since r258133

2018-03-13 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84805

--- Comment #7 from Eric Botcazou  ---
Author: ebotcazou
Date: Tue Mar 13 10:04:51 2018
New Revision: 258481

URL: https://gcc.gnu.org/viewcvs?rev=258481=gcc=rev
Log:
PR lto/84805
* ipa-devirt.c (odr_subtypes_equivalent_p): Do not get the ODR type of
incomplete types.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/ipa-devirt.c

[Bug lto/84805] [8 Regression] ICE in get_odr_type, at ipa-devirt.c:2096 since r258133

2018-03-13 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84805

Eric Botcazou  changed:

   What|Removed |Added

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

--- Comment #8 from Eric Botcazou  ---
Thanks for the reduced testcase.

[Bug target/84844] [8 Regression] ICE in extract_constrain_insn_cached, at recog.c:2217 (error: insn does not satisfy its constraints)

2018-03-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84844

Richard Biener  changed:

   What|Removed |Added

  Component|rtl-optimization|target
   Target Milestone|--- |8.0

[Bug go/84215] Random results in go/libgo tests

2018-03-13 Thread clyon at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84215

--- Comment #10 from Christophe Lyon  ---
Yesterday I noticed:
* on arm:
FAIL: libgo:database/sql
* on aarch64:
FAIL: libgo:runtime/pprof

[Bug tree-optimization/84841] New: [8 Regression] ICE: tree check: expected ssa_name, have real_cst in rewrite_expr_tree_parallel, at tree-ssa-reassoc.c:4624

2018-03-13 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84841

Bug ID: 84841
   Summary: [8 Regression] ICE: tree check: expected ssa_name,
have real_cst in rewrite_expr_tree_parallel, at
tree-ssa-reassoc.c:4624
   Product: gcc
   Version: 8.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-8.0.0-alpha20180311 snapshot (r258438) ICEs when compiling the following
snippet w/ -O1 (-O2, -O3, -Ofast, -Os) -fassociative-math -frounding-math
-fno-signed-zeros -fno-trapping-math -fno-tree-forwprop:

double
ko (double ov)
{
  return -ov * 0.1 * 0.1;
}

% gcc-8.0.0-alpha20180311 -O1 -fassociative-math -frounding-math
-fno-signed-zeros -fno-trapping-math -fno-tree-forwprop -c ocd0zbx6.c
during GIMPLE pass: reassoc
ocd0zbx6.c: In function 'ko':
ocd0zbx6.c:2:1: internal compiler error: tree check: expected ssa_name, have
real_cst in rewrite_expr_tree_parallel, at tree-ssa-reassoc.c:4624
 ko (double ov)
 ^~
0x6c0245 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/tree.c:9335
0x69e70c tree_check(tree_node*, char const*, int, char const*, tree_code)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/tree.h:3132
0x69e70c rewrite_expr_tree_parallel
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/tree-ssa-reassoc.c:4624
0xe494c1 reassociate_bb
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/tree-ssa-reassoc.c:5923
0xe489e7 reassociate_bb
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/tree-ssa-reassoc.c:5983
0xe4b315 do_reassoc
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/tree-ssa-reassoc.c:6095
0xe4b315 execute_reassoc
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/tree-ssa-reassoc.c:6182
0xe4b315 execute
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/tree-ssa-reassoc.c:6221

[Bug c/82186] [7 Regression] ICE (segfault), VLA type with inlining

2018-03-13 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82186

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|NEW
   Assignee|mpolacek at gcc dot gnu.org|unassigned at gcc dot 
gnu.org
Summary|[7/8 Regression] ICE|[7 Regression] ICE
   |(segfault), VLA type with   |(segfault), VLA type with
   |inlining|inlining

--- Comment #8 from Marek Polacek  ---
Fixed on trunk by r257620.  Unsure about backporting...

[Bug rtl-optimization/84844] New: [8 Regression] ICE in extract_constrain_insn_cached, at recog.c:2217 (error: insn does not satisfy its constraints)

2018-03-13 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84844

Bug ID: 84844
   Summary: [8 Regression] ICE in extract_constrain_insn_cached,
at recog.c:2217 (error: insn does not satisfy its
constraints)
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---
Target: x86_64-pc-linux-gnu-gcc

gcc-8.0.0-alpha20180311 snapshot (r258438) ICEs when compiling the following
snippet w/ -march=bdver1 (=bdver2) -O1 (-O2, -O3, -Ofast, -Og, -Os)
-fschedule-insns -fselective-scheduling:

double
vl (int *hm, int ue, int jy)
{
  *hm = ue;
  return jy;
}

% x86_64-pc-linux-gnu-gcc-8.0.0-alpha20180311 -march=bdver1 -O1
-fschedule-insns -fselective-scheduling -c iy3oz1yv.c
iy3oz1yv.c: In function 'vl':
iy3oz1yv.c:6:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 19 0 0 (set (reg:DF 91)
(float:DF (reg:SI 1 dx [ jy ]))) 205 {*floatsidf2_mixed}
 (expr_list:REG_DEAD (reg/v:SI 90 [ jy ])
(nil)))
during RTL pass: sched1
iy3oz1yv.c:6:1: internal compiler error: in extract_constrain_insn_cached, at
recog.c:2217
0x64a621 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/rtl-error.c:108
0x64a647 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/rtl-error.c:118
0x648bc4 extract_constrain_insn_cached(rtx_insn*)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/recog.c:2217
0x118653d get_attr_type(rtx_insn*)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/config/i386/i386.md:2241
0x11b6f86 internal_dfa_insn_code_bdver1(rtx_insn*)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/config/i386/i386.md:15271
0x11a29a8 dfa_insn_code
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/build/gcc/insn-automata.c:150079
0x11a29a8 state_transition(void*, rtx_def*)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/build/gcc/insn-automata.c:150094
0xc5f1fd estimate_insn_cost
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:4291
0xc6b0ab get_expr_cost
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:4322
0xc6b0ab choose_best_insn
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:4351
0xc6b0ab find_best_expr
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:4401
0xc6b0ab fill_insns
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:5544
0xc6b0ab schedule_on_fences
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:7361
0xc6b0ab sel_sched_region_2
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:7499
0xc6d227 sel_sched_region_1
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:7541
0xc6d227 sel_sched_region(int)
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:7642
0xc6e288 run_selective_scheduling()
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sel-sched.c:7718
0xc4ddfd rest_of_handle_sched
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sched-rgn.c:3715
0xc4ddfd execute
   
/var/tmp/portage/sys-devel/gcc-8.0.0_alpha20180311/work/gcc-8-20180311/gcc/sched-rgn.c:3825

[Bug lto/81968] [8 regression] early lto debug objects make Solaris ld SEGV

2018-03-13 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81968

--- Comment #64 from Eric Botcazou  ---
> Are the remaining issues only related to .debug_macro, or other stuff too?

The LTO testsuite is clean on SPARC/Solaris 10 for me (GNU as + Solaris ld) but
Rainer's testing exercises more combinations, in particular x86.

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

2018-03-13 Thread rsandifo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80283

rsandifo at gcc dot gnu.org  changed:

   What|Removed |Added

 CC||rsandifo at gcc dot gnu.org

--- Comment #20 from rsandifo at gcc dot gnu.org  
---
(In reply to Wilco from comment #12)
> 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.

This is kind-of expected in general, though almost certainly wrong in this
case.  The default "weighted" algorithm tended to overemphasise decreasing
spills (at the cost of decreasing ILP) and slowed down some important
benchmarks for which some spilling was better.  The "model" algorithm was
supposed to be a compromise.

I'll have a look to see whether there's an easy way of handling this case
better without regressing others.  (I'm not assigning myself since it's
unrelated to the x86 problem.)

> 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.

Yeah, the way arm_neon.h handles vmulq_n_f32 seems to leave lots of
uninitialised pseudo registers, which means that the VFP registers appear to
start the loop almost 2-times oversubscribed.  Do you know if we have a
separate PR for that?

[Bug target/84844] [8 Regression] ICE in extract_constrain_insn_cached, at recog.c:2217 (error: insn does not satisfy its constraints)

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84844

Jakub Jelinek  changed:

   What|Removed |Added

 CC||uros at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
Or shall I got for ?*v instead, or ???*v, or !???*v ?

[Bug target/59833] ARM soft-float extendsfdf2 fails to quiet signaling NaN

2018-03-13 Thread ramana at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59833

Ramana Radhakrishnan  changed:

   What|Removed |Added

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

--- Comment #17 from Ramana Radhakrishnan  ---
Fixed for GCC-7

[Bug tree-optimization/84841] [7/8 Regression] ICE: tree check: expected ssa_name, have real_cst in rewrite_expr_tree_parallel, at tree-ssa-reassoc.c:4624

2018-03-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84841

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/84830] [8 Regression] ICE in compute_antic, at tree-ssa-pre.c:2388

2018-03-13 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84830

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #2 from Richard Biener  ---
Mine.

[Bug c++/84843] [8 Regression] C++ ICE on builtin redefinition since r258391

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84843

Jakub Jelinek  changed:

   What|Removed |Added

   Keywords||error-recovery,
   ||ice-on-invalid-code
   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-13
   Target Milestone|--- |8.0
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
This is because of the return olddecl; for the builtins.

[Bug c++/84843] [8 Regression] C++ ICE on builtin redefinition since r258391

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84843

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jason at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
The ICE is because of assertion that DECL_INITIAL is non-NULL; when
duplicate_decls is called, olddecl is the builtin from builtins.def with NULL
DECL_INITIAL, and newdecl is the user definition with error_mark_node as
DECL_INITIAL.  If the pedwarn errors, I guess we could return error_mark_node
instead of olddecl and the error-recovery would work fine, but for -fpermissive
I have no idea what to do, except for returning NULL_TREE, but that is
something you didn't like.

[Bug libstdc++/83906] [8 Regression] Random FAIL: libstdc++-prettyprinters/80276.cc whatis p4

2018-03-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83906

--- Comment #18 from Jonathan Wakely  ---
But we can remove the [8 Regression] marker if it's messing with reports.

[Bug lto/81968] [8 regression] early lto debug objects make Solaris ld SEGV

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81968

--- Comment #63 from Jakub Jelinek  ---
Are the remaining issues only related to .debug_macro, or other stuff too?
If only .debug_macro, does:
--- gcc/dwarf2out.c 2018-03-11 17:48:53.498068316 +0100
+++ gcc/dwarf2out.c 2018-03-13 10:58:03.477514623 +0100
@@ -28282,6 +28282,7 @@ output_macinfo (const char *debug_line_l
case DW_MACINFO_undef:
  if ((!dwarf_strict || dwarf_version >= 5)
  && HAVE_COMDAT_GROUP
+ && !flag_lto
  && vec_safe_length (files) != 1
  && i > 0
  && i + 1 < length
help?  If yes, we could go for && (!flag_lto || !HAVE_BROKEN_LD_WHATEVER)
and add configure test for that.

[Bug target/84844] [8 Regression] ICE in extract_constrain_insn_cached, at recog.c:2217 (error: insn does not satisfy its constraints)

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84844

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-13
 CC||jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek  ---
Started with r247036.

[Bug target/84845] New: [8 Regression] ICE: in extract_insn, at recog.c:2304: unrecognizable insn at -O2 and above at aarch64

2018-03-13 Thread zsojka at seznam dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84845

Bug ID: 84845
   Summary: [8 Regression] ICE: in extract_insn, at recog.c:2304:
unrecognizable insn at -O2 and above at aarch64
   Product: gcc
   Version: 8.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

Created attachment 43640
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43640=edit
reduced testcase

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -O2 testcase.c
testcase.c: In function 'foo':
testcase.c:9:1: error: unrecognizable insn:
 }
 ^
(insn 30 29 26 2 (set (reg:DI 114)
(rotatert:DI (reg:DI 115 [ d ])
(subreg:QI (and:SI (reg:SI 118)
(const_int 65535 [0x])) 0))) "testcase.c":8 -1
 (expr_list:REG_DEAD (reg:SI 118)
(expr_list:REG_DEAD (reg:DI 115 [ d ])
(nil
during RTL pass: sched1
testcase.c:9:1: internal compiler error: in extract_insn, at recog.c:2304
0x5b87a4 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.c:108
0x5b8828 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.c:116
0xbbd41c extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.c:2304
0xa68ad7 scan_one_insn
/repo/gcc-trunk/gcc/ira-costs.c:1449
0xa68ad7 process_bb_for_costs
/repo/gcc-trunk/gcc/ira-costs.c:1613
0xa696c4 find_costs_and_classes
/repo/gcc-trunk/gcc/ira-costs.c:1720
0xa6abaa ira_set_pseudo_classes(bool, _IO_FILE*)
/repo/gcc-trunk/gcc/ira-costs.c:2267
0x1487e00 alloc_global_sched_pressure_data
/repo/gcc-trunk/gcc/haifa-sched.c:7157
0x1487e00 sched_init()
/repo/gcc-trunk/gcc/haifa-sched.c:7314
0x148978d haifa_sched_init()
/repo/gcc-trunk/gcc/haifa-sched.c:7326
0xc220b9 schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.c:3504
0xc22973 schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.c:3498
0xc22973 rest_of_handle_sched
/repo/gcc-trunk/gcc/sched-rgn.c:3717
0xc22973 execute
/repo/gcc-trunk/gcc/sched-rgn.c:3825
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.


$ aarch64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-aarch64/bin/aarch64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-258459-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/8.0.1/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl
--with-sysroot=/usr/aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-258459-checking-yes-rtl-df-extra-aarch64
Thread model: posix
gcc version 8.0.1 20180312 (experimental) (GCC)

[Bug c++/58407] [C++11] Should warn about deprecated implicit generation of copy constructor/assignment

2018-03-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58407

--- Comment #13 from Jonathan Wakely  ---
Thanks! I can take care of the rest of the library, but for now this makes all
the deque tests pass:


--- a/libstdc++-v3/include/bits/stl_deque.h
+++ b/libstdc++-v3/include/bits/stl_deque.h
@@ -149,9 +149,23 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
   _Deque_iterator() _GLIBCXX_NOEXCEPT
   : _M_cur(), _M_first(), _M_last(), _M_node() { }

+#if __cplusplus < 201103L
+  // Conversion from iterator to const_iterator.
   _Deque_iterator(const iterator& __x) _GLIBCXX_NOEXCEPT
   : _M_cur(__x._M_cur), _M_first(__x._M_first),
_M_last(__x._M_last), _M_node(__x._M_node) { }
+#else
+  // Conversion from iterator to const_iterator.
+  template,
+  is_same<_Iter, iterator>>>
+   _Deque_iterator(const _Iter& __x) noexcept
+   : _M_cur(__x._M_cur), _M_first(__x._M_first),
+ _M_last(__x._M_last), _M_node(__x._M_node) { }
+
+  _Deque_iterator(const _Deque_iterator&) = default;
+  _Deque_iterator& operator=(const _Deque_iterator&) = default;
+#endif

   iterator
   _M_const_cast() const _GLIBCXX_NOEXCEPT
diff --git a/libstdc++-v3/include/ext/throw_allocator.h
b/libstdc++-v3/include/ext/throw_allocator.h
index 5d9caa2bcae..f773a2d79ba 100644
--- a/libstdc++-v3/include/ext/throw_allocator.h
+++ b/libstdc++-v3/include/ext/throw_allocator.h
@@ -403,6 +403,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   struct condition_base
   {
 virtual ~condition_base() { };
+#if __cplusplus >= 201103L
+condition_base() = default;
+condition_base(const condition_base&) = default;
+condition_base& operator=(const condition_base&) = default;
+#endif
   };

[Bug target/65146] alignment of _Atomic structure member is not correct

2018-03-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65146

Jonathan Wakely  changed:

   What|Removed |Added

 Target||i386-*-*
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-03-13
 Ever confirmed|0   |1

[Bug go/84215] Random results in go/libgo tests

2018-03-13 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84215

--- Comment #11 from Ian Lance Taylor  ---
Please include all the output from each failure, if possible.  Thanks.

[Bug target/78090] [x86_64]: GCC allows integer register for inter unit conversion under -mtune-ctrl=^inter_unit_conversions .

2018-03-13 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78090

--- Comment #8 from Jakub Jelinek  ---
Even with this patch reverted, I can't reproduce the #c0 difference, neither in
7.3.1 nor on the trunk.  And even if we emit the direct inter-unit conversions
in cold sections, it is significantly smaller (4 vs. 10 bytes when going
through stack), so it is what we are looking for.

  1   2   3   >