[Bug tree-optimization/93326] switch optimisation of multiple jumptables into a lookup

2020-01-19 Thread felix.von.s at posteo dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93326

--- Comment #2 from felix  ---
Created attachment 47681
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47681=edit
Optimised into a jumptable, then load of an immediate (-O3 -fno-pic)

[Bug tree-optimization/93326] switch optimisation of multiple jumptables into a lookup

2020-01-19 Thread felix.von.s at posteo dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93326

--- Comment #1 from felix  ---
Created attachment 47680
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47680=edit
Optimised into a lookup table of constants (-O3 -fno-pic)

[Bug tree-optimization/93326] New: switch optimisation of multiple jumptables into a lookup

2020-01-19 Thread felix.von.s at posteo dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93326

Bug ID: 93326
   Summary: switch optimisation of multiple jumptables into a
lookup
   Product: gcc
   Version: 9.2.1
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: felix.von.s at posteo dot de
  Target Milestone: ---
Target: i686-linux-gnu

Attached two code samples are equivalent, yet they are optimised wildly
differently (with -O3 -fno-pic).

Apparently, GCC is capable of recognising that a switch/return realised by a
single jumptable can be optimised into a lookup table, but is unable to do so
when a switch is realised by multiple jumptables.

When compiling in PIC mode, neither switch is optimised into a lookup table; I
don't see a reason why it couldn't be.

[Bug tree-optimization/85628] Make better use of BFI (BFXIL)

2020-01-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85628

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2020-01-20
  Component|target  |tree-optimization
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #4 from Andrew Pinski  ---
Mine for GCC 11.
I can produce:
  _15 = (unsigned int) b_3(D);
  _13 = BIT_INSERT_EXPR ;
  *c_5(D) = _13;
  _16 = (unsigned int) a_2(D);
  _10 = BIT_INSERT_EXPR ;
  *d_8(D) = _10;


mov x5, x0
mov x4, x1
bfi x5, x1, 0, 32
str x5, [x2]
bfi x4, x0, 0, 32
str x4, [x3]
ret

[Bug fortran/93308] bind(c) subroutine changes lower bound of array argument in caller

2020-01-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93308

Thomas Koenig  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-01-20
 CC||pault at gcc dot gnu.org,
   ||tkoenig at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Thomas Koenig  ---
Confirmed.

[Bug c++/91476] [9/10 Regression] const reference variables sharing the same name in two anonymous namespaces cause a multiple definition error

2020-01-19 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91476

Jason Merrill  changed:

   What|Removed |Added

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

[Bug c++/33799] Return value's destructor not executed when a local variable's destructor throws

2020-01-19 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33799

Jason Merrill  changed:

   What|Removed |Added

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

--- Comment #12 from Jason Merrill  ---
Fixed for GCC 10.

[Bug tree-optimization/93321] Unlimited recursion in prepare_block_for_update

2020-01-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93321

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||patch
URL||https://gcc.gnu.org/ml/gcc-
   ||patches/2020-01/msg01145.ht
   ||ml

--- Comment #5 from Andrew Pinski  ---
Posted the patch:
https://gcc.gnu.org/ml/gcc-patches/2020-01/msg01145.html

gcc.gnu.org Mailbox Restioration!

2020-01-19 Thread Mail Server
friendly reminder

[Bug ipa/93318] [10 regression] Firefox LTO+FDO ICEs in speculative_call_info

2020-01-19 Thread hubicka at ucw dot cz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93318

--- Comment #4 from Jan Hubicka  ---
Ok,
I managed to reproduce the crash locally (it was not that easy)
At the point of failure the node passes verification and I suppose
problem is that the call stmt hash contains indirect call while it is
supposed to contain direct call.

Edge removal code probably replaces direct edge by indreict one since it
does not know about additional speculations.  I will continue tomorrow.

Honza

Re: [Bug ipa/93318] [10 regression] Firefox LTO+FDO ICEs in speculative_call_info

2020-01-19 Thread Jan Hubicka
Ok,
I managed to reproduce the crash locally (it was not that easy)
At the point of failure the node passes verification and I suppose
problem is that the call stmt hash contains indirect call while it is
supposed to contain direct call.

Edge removal code probably replaces direct edge by indreict one since it
does not know about additional speculations.  I will continue tomorrow.

Honza


[Bug tree-optimization/93321] Unlimited recursion in prepare_block_for_update

2020-01-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93321

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2020-01-19
 Ever confirmed|0   |1

--- Comment #4 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> Created attachment 47679 [details]
> fully untested patch
> 
> This patch improves prepare_block_for_update but there might be others.

With this patch, I was able to compile the testcase with the referenced
options.

[Bug tree-optimization/93321] Unlimited recursion in prepare_block_for_update

2020-01-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93321

--- Comment #3 from Andrew Pinski  ---
Note prepare_block_for_update  has been this way since 2005 with
g:0bca51f080dfff5e943b1f1775d874a73bbc441a

[Bug tree-optimization/93321] Unlimited recursion in prepare_block_for_update

2020-01-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93321

--- Comment #2 from Andrew Pinski  ---
Created attachment 47679
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47679=edit
fully untested patch

This patch improves prepare_block_for_update but there might be others.

[Bug tree-optimization/93321] Unlimited recursion in prepare_block_for_update

2020-01-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93321

--- Comment #1 from Andrew Pinski  ---
I don't think this is a bug.
You requested inlining a lot.  And that increases the number of basic blocks by
a lot because of recursive inlining.

I can decrease the stack recusriveness slightly by peeling off the last
iteration of the loop at the end of the function but I don't know how much it
could help here ...

[Bug c++/93323] Internal Compiler Error in unify at cp/pt.c:22219

2020-01-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93323

Marek Polacek  changed:

   What|Removed |Added

   Keywords|needs-reduction |

--- Comment #2 from Marek Polacek  ---
Reduced (invalid):

template  struct a;
template  struct b {};
template  class c { template  c(b...);
};
c f {
  b<1, 3> {}
}

[Bug c++/93320] internal compiler error: in is_base_type, at dwarf2out.c:12987

2020-01-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93320

--- Comment #5 from Marek Polacek  ---
Seems like it started with g:3075affdbcb3232fe549fbeed87bd94114c14758

[Bug c++/93324] [10 Regression] ICE with -Wall on constexpr if

2020-01-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93324

Marek Polacek  changed:

   What|Removed |Added

   Keywords||patch

--- Comment #2 from Marek Polacek  ---
https://gcc.gnu.org/ml/gcc-patches/2020-01/msg01141.html

[Bug c++/93320] internal compiler error: in is_base_type, at dwarf2out.c:12987

2020-01-19 Thread mike.redd at 4embedded dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93320

--- Comment #4 from Mike Redd  ---
FWIW: My code had a problem, but it would have been much easier to debug if the
compile didn't crash. :-)

In other words, it is possibly not important to handle "type_pack_expansion" in
a meaningful way here-- just report some kind of compile error instead of
crashing?

[Bug c++/93320] internal compiler error: in is_base_type, at dwarf2out.c:12987

2020-01-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93320

--- Comment #3 from Marek Polacek  ---
We crash in is_base_type because it gets 

(gdb) p type
$1 = 
and that is not handled:
12990 gcc_unreachable ();

[Bug c++/93320] internal compiler error: in is_base_type, at dwarf2out.c:12987

2020-01-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93320

Marek Polacek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-01-19
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #2 from Marek Polacek  ---
Confirmed with a cross:

subrepos/thingi/include/thingi/Interface.h:241:19: internal compiler error: in
is_base_type, at dwarf2out.c:12990
0x6bf559 is_base_type
/home/mpolacek/src/gcc/gcc/dwarf2out.c:12990
0x6bf559 is_base_type
/home/mpolacek/src/gcc/gcc/dwarf2out.c:12960
0x6bf559 modified_type_die
/home/mpolacek/src/gcc/gcc/dwarf2out.c:13179
0xc47410 add_type_attribute
/home/mpolacek/src/gcc/gcc/dwarf2out.c:21580
0xc54543 gen_formal_parameter_die
/home/mpolacek/src/gcc/gcc/dwarf2out.c:22261
0xc59be9 gen_formal_types_die
/home/mpolacek/src/gcc/gcc/dwarf2out.c:22356
0xc40dba gen_subprogram_die
/home/mpolacek/src/gcc/gcc/dwarf2out.c:23212
0xc5c52c gen_decl_die
/home/mpolacek/src/gcc/gcc/dwarf2out.c:26320
0xc5b183 gen_member_die
/home/mpolacek/src/gcc/gcc/dwarf2out.c:25165
0xc5b183 gen_struct_or_union_type_die
/home/mpolacek/src/gcc/gcc/dwarf2out.c:25261
0xc5b183 gen_tagged_type_die
/home/mpolacek/src/gcc/gcc/dwarf2out.c:25462
0xc43a0d gen_type_die_with_usage
/home/mpolacek/src/gcc/gcc/dwarf2out.c:25657
0xc45036 gen_type_die
/home/mpolacek/src/gcc/gcc/dwarf2out.c:25711
0xc5cd00 gen_decl_die
/home/mpolacek/src/gcc/gcc/dwarf2out.c:26343
0xc5df96 dwarf2out_decl
/home/mpolacek/src/gcc/gcc/dwarf2out.c:26884
0xc5e468 dwarf2out_type_decl
/home/mpolacek/src/gcc/gcc/dwarf2out.c:26611
0xc5e468 dwarf2out_type_decl
/home/mpolacek/src/gcc/gcc/dwarf2out.c:26606
0xf331c8 rest_of_type_compilation(tree_node*, int)
/home/mpolacek/src/gcc/gcc/passes.c:339
0xa66a5d note_debug_info_needed(tree_node*)
/home/mpolacek/src/gcc/gcc/cp/search.c:2263
0x969705 maybe_emit_vtables
/home/mpolacek/src/gcc/gcc/cp/decl2.c:2313
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug fortran/92805] gfortran: blanks within literal constants should not be allowed

2020-01-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92805

--- Comment #8 from kargl at gcc dot gnu.org ---
(In reply to Thomas Koenig from comment #7)
> (In reply to kargl from comment #6)
> 
> > No.  I do not do git and have little time/need/interest
> > in learning.
> 
> In that case, I hope you don't mind if I take this up.
> 
> I'm just learning git myself (having semi-messed up my
> first commit :-).

Fine with me.

[Bug ipa/93322] [10 Regression] gcc.dg/tree-ssa/flatten-1.c ICEs with -fPIC

2020-01-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93322

--- Comment #4 from Andrew Pinski  ---
  size_info->size = 0;

[Bug ipa/93322] [10 Regression] gcc.dg/tree-ssa/flatten-1.c ICEs with -fPIC

2020-01-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93322

Andrew Pinski  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org

--- Comment #3 from Andrew Pinski  ---
Caused by g:7237f93eb3aaecb27800ce1688ece4c4cbcb790b .

[Bug c++/33799] Return value's destructor not executed when a local variable's destructor throws

2020-01-19 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33799

--- Comment #11 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:bcfc2227c556f2801a657ce3007374732baa8333

commit r10-6077-gbcfc2227c556f2801a657ce3007374732baa8333
Author: Jason Merrill 
Date:   Sun Jan 19 09:14:54 2020 -0500

PR c++/33799 - destroy return value, take 2.

This patch differs from the reverted patch for 33799 in that it adds the
CLEANUP_STMT for the return value at the end of the function, and only if
we've seen a cleanup that might throw, so it should not affect most C++11
code.

* cp-tree.h (current_retval_sentinel): New macro.
(struct language_function): Add throwing_cleanup bitfield.
* decl.c (cxx_maybe_build_cleanup): Set it.
* except.c (maybe_set_retval_sentinel)
(maybe_splice_retval_cleanup): New functions.
* parser.c (cp_parser_compound_statement): Call
maybe_splice_retval_cleanup.
* typeck.c (check_return_expr): Call maybe_set_retval_sentinel.

[Bug libstdc++/93325] libstdc++ wrongly uses direct clock_gettime syscall on non-glibc, breaks time64

2020-01-19 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93325

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2020-01-19
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
 Ever confirmed|0   |1

[Bug libstdc++/93325] New: libstdc++ wrongly uses direct clock_gettime syscall on non-glibc, breaks time64

2020-01-19 Thread bugdal at aerifal dot cx
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93325

Bug ID: 93325
   Summary: libstdc++ wrongly uses direct clock_gettime syscall on
non-glibc, breaks time64
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: bugdal at aerifal dot cx
  Target Milestone: ---

The configure logic for libstdc++ is choosing to make direct clock_gettime
syscalls (via syscall()) rather than using the clock_gettime function except on
glibc 2.17 or later (when it was moved from librt to libc). This is
incompatible with time64 (because struct timespec mismatches the form the old
clock_gettime syscall uses) and also undesirable because it can't take
advantage of vdso.

The hard-coded glibc version dependency is a configure anti-pattern and should
be removed; the right way to test this would be just probing for the
clock_gettime function without adding any libs (like -lrt).

[Bug c++/93324] [10 Regression] ICE with -Wall on constexpr if

2020-01-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93324

Marek Polacek  changed:

   What|Removed |Added

   Priority|P3  |P1
 Status|UNCONFIRMED |ASSIGNED
  Known to work||9.2.0
   Keywords||ice-on-valid-code
   Last reconfirmed||2020-01-19
 CC||mpolacek at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Ever confirmed|0   |1
   Target Milestone|--- |10.0

--- Comment #1 from Marek Polacek  ---
Started with g:14da3939da3adcef84816573caa9d93c7367507e

Author: Marek Polacek 
Date:   Wed Aug 28 02:03:48 2019 +

PR c++/91428 - warn about std::is_constant_evaluated in if constexpr.

* cp-tree.h (decl_in_std_namespace_p): Declare.
* semantics.c (is_std_constant_evaluated_p): New.
(finish_if_stmt_cond): Warn about "std::is_constant_evaluated ()"
in
an if-constexpr.
* typeck.c (decl_in_std_namespace_p): No longer static.

* g++.dg/cpp2a/is-constant-evaluated9.C: New test.

From-SVN: r274981

and hence mine.

[Bug fortran/92805] gfortran: blanks within literal constants should not be allowed

2020-01-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92805

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

> No.  I do not do git and have little time/need/interest
> in learning.

In that case, I hope you don't mind if I take this up.

I'm just learning git myself (having semi-messed up my
first commit :-).

[Bug c++/93323] Internal Compiler Error in unify at cp/pt.c:22219

2020-01-19 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93323

Marek Polacek  changed:

   What|Removed |Added

   Keywords||needs-reduction
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2020-01-19
 CC||mpolacek at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Marek Polacek  ---
Started with g:daaa6fcc70ffe66bd56f5819ad4ee78fecd54bb6, before that:

main5.cc:10:47: error: invalid use of incomplete type ‘struct std::array’
In file included from main5.cc:1:
/usr/include/c++/9.2.0/array:94:12: note: declaration of ‘struct
std::array’
main5.cc:26:66: note: invalid template non-type parameter
main5.cc:26:7: error: trailing return type ‘’ of deduction guide is
not a specialization of ‘Guided’
main5.cc: In function ‘int main()’:
main5.cc:32:43: error: class template argument deduction failed:
main5.cc:32:43: error: no matching function for call to ‘Guided(const
Shield<111, 3>&, const Shield<200, 3>&, Shield<321, 3>)’
main5.cc:16:55: note: candidate: ‘templatearr,
int ...i, class ... D, D ...d> Guided(Shield...)-> Guided’
main5.cc:16:55: note:   template argument deduction/substitution failed:
main5.cc:10:58: note: candidate: ‘templatearr>
Guided(Guided)-> Guided’
main5.cc:10:58: note:   template argument deduction/substitution failed:
main5.cc:32:43: note:   ‘Shield<111, 3>’ is not derived from ‘Guided’

[Bug fortran/92805] gfortran: blanks within literal constants should not be allowed

2020-01-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92805

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org

--- Comment #6 from kargl at gcc dot gnu.org ---
(In reply to Thomas Koenig from comment #5)
> Hi Steve,
> 
> > Index: gcc/fortran/primary.c
> > ===
> > --- gcc/fortran/primary.c   (revision 279052)
> > +++ gcc/fortran/primary.c   (working copy)
> > @@ -90,16 +90,22 @@ match_kind_param (int *kind, int *is_iso_c)
> >  static int
> >  get_kind (int *is_iso_c)
> >  {
> > +  char c;
> >int kind;
> >match m;
> >  
> >*is_iso_c = 0;
> >  
> > +  c = gfc_peek_ascii_char ();
> > +  if (gfc_current_form == FORM_FREE && gfc_is_whitespace (c))
> > +return -2;
> > +
> >if (gfc_match_char ('_') != MATCH_YES)
> >  return -2;
> >  
> > -  m = match_kind_param (, is_iso_c);
> > -  if (m == MATCH_NO)
> > +  c = gfc_peek_ascii_char ();
> > +  if ((gfc_current_form == FORM_FREE && gfc_is_whitespace (c))
> > +  || (m = match_kind_param (, is_iso_c)) == MATCH_NO)
> >  gfc_error ("Missing kind-parameter at %C");
> >  
> >return (m == MATCH_YES) ? kind : -1;
> 
> That patch looks good. Do you plan on submitting it?

No.  I do not do git and have little time/need/interest
in learning.

[Bug c++/93324] New: [10 Regression] ICE with -Wall on constexpr if

2020-01-19 Thread gcc-bugs at marehr dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93324

Bug ID: 93324
   Summary: [10 Regression] ICE with -Wall on constexpr if
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gcc-bugs at marehr dot dialup.fu-berlin.de
  Target Milestone: ---

The following code works on gcc 9 and below, but ICEs on gcc10 with -Wall.

```
struct
{
  template 
  static constexpr bool a() { return 0; }
} e;

template 
void d()
{
  auto c(e);
  using b = decltype(c);
  if constexpr (b::a<2>());
}

```

See godbolt: https://godbolt.org/z/3wEnL7

```
> g++-git  -std=c++17 -Wall -c ice.cpp

ice.cpp: In function ‘void d()’:
ice.cpp:12:26: internal compiler error: Segmentation fault
   12 |   if constexpr (b::a<2>());
  |  ^
0xc7230f crash_signal
/home/marehr/Packages/gcc-git/src/gcc/gcc/toplev.c:328
0x783eca fndecl_built_in_p(tree_node const*, built_in_class)
/home/marehr/Packages/gcc-git/src/gcc/gcc/tree.h:6208
0x783eca fndecl_built_in_p(tree_node const*, unsigned int, built_in_class)
/home/marehr/Packages/gcc-git/src/gcc/gcc/tree.h:6217
0x783eca is_std_constant_evaluated_p
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/semantics.c:737
0x783eca finish_if_stmt_cond(tree_node*, tree_node*)
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/semantics.c:771
0x71bfcb cp_parser_selection_statement
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:11898
0x71bfcb cp_parser_statement
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:11261
0x71c8f8 cp_parser_statement_seq_opt
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:11745
0x71c9b0 cp_parser_compound_statement
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:11699
0x7325b0 cp_parser_function_body
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:22907
0x7325b0 cp_parser_ctor_initializer_opt_and_function_body
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:22958
0x735cad cp_parser_function_definition_after_declarator
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:28745
0x736ca7 cp_parser_function_definition_from_specifiers_and_declarator
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:28661
0x736ca7 cp_parser_init_declarator
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:20536
0x73b7b4 cp_parser_single_declaration
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:29236
0x73b93d cp_parser_template_declaration_after_parameters
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:28808
0x73beea cp_parser_explicit_template_declaration
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:29074
0x73f0f9 cp_parser_declaration
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:13277
0x73f6d8 cp_parser_translation_unit
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:4723
0x73f6d8 c_parse_file()
/home/marehr/Packages/gcc-git/src/gcc/gcc/cp/parser.c:43569
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
```

This code compiles when removing the -Wall flag.


```
> g++-git -v
Using built-in specs.
COLLECT_GCC=g++-git
COLLECT_LTO_WRAPPER=/opt/gcc/gcc-git/bin/../lib/gcc/x86_64-pc-linux-gnu/10.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/marehr/Packages/gcc-git/src/gcc/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++ --enable-shared --enable-threads=posix
--with-system-zlib --with-isl --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-lto --enable-plugin --enable-install-libiberty
--with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib
--disable-werror --enable-checking=release --enable-default-pie
--enable-default-ssp --enable-cet=auto --disable-boostrap
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.0.1 20200116 (experimental) (GCC)
```

[Bug ipa/93322] [10 Regression] gcc.dg/tree-ssa/flatten-1.c ICEs with -fPIC

2020-01-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93322

--- Comment #2 from Andrew Pinski  ---
It worked with:
gcc version 9.0.0 20181231 (experimental) 

g:c6579387bdc84adc76fbb0aa04e4942dd21d4ff0

Trying to do a git bisect right now.

[Bug ipa/93322] [10 Regression] gcc.dg/tree-ssa/flatten-1.c ICEs with -fPIC

2020-01-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93322

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |10.0

--- Comment #1 from Andrew Pinski  ---
I saw this while I was looking at my testsuite results; I test sometimes with
-fPIC.


gcc version 10.0.1 20200119 (experimental) [master revision
6a9a10407ef:19bdd6115e4:c7518183b8058b31d10a77bc0e2d392552ffbf0d] (GCC)

[Bug c++/93323] New: Internal Compiler Error in unify at cp/pt.c:22219

2020-01-19 Thread julius_huelsmann at freenet dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93323

Bug ID: 93323
   Summary: Internal Compiler Error in unify at cp/pt.c:22219
   Product: gcc
   Version: 9.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: julius_huelsmann at freenet dot de
  Target Milestone: ---

Created attachment 47678
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47678=edit
The source file which throws the bug.

Bug Description
---
I was experimenting a little bit with custom class template argument
deductions, and wrote the small c++ program. In case you would like to also
have the (single, 13 loc) source file, I can upload that, too. I tried to
adhere to the Bug submitting guidelines, and therefore only uploaded the .ii
file.


G++ Version and OS
--


g++ (GCC) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Linux machine 5.4.12-arch1-1 #1 SMP PREEMPT Tue, 14 Jan 2020 21:44:31 +
x86_64 GNU/Linux


the options given when GCC was configured/built;

I use the G++ version shipped with my operating system (binary via pacman).


the complete command line that triggers the bug;

g++ -Wall -Wextra -std=c++2a -fno-strict-aliasing -fwrapv   main5.cc


Compile Output
--

/home/juli/main5.cc:31:43:   required from here
/home/juli/main5.cc:31:43: internal compiler error: in unify, at cp/pt.c:22219
   31 |   const Guided k{sh, sh2, Shield<321, 3>{}};
  |   ^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

[Bug ipa/93322] New: [10 Regression] gcc.dg/tree-ssa/flatten-1.c ICEs with -fPIC

2020-01-19 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93322

Bug ID: 93322
   Summary: [10 Regression] gcc.dg/tree-ssa/flatten-1.c ICEs with
-fPIC
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 47677
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47677=edit
flatten-1.c

gcc.dg/tree-ssa/flatten-1.c ICEs at -O2 -fPIC.

apinski@xeond:~/src/toolchain-10/objdir/gcc$ ./cc1 -O2 -fPIC t.c -quiet
during IPA pass: inline
t.c:53:1: internal compiler error: Segmentation fault
   53 | }
  | ^
0xd6dfdf crash_signal
../../gits/gcc/gcc/toplev.c:328
0x654dc1 ipa_update_overall_fn_summary(cgraph_node*, bool)
../../gits/gcc/gcc/ipa-fnsummary.c:3994
0x1687cd9 ipa_inline
../../gits/gcc/gcc/ipa-inline.c:2674
0x1687cd9 execute
../../gits/gcc/gcc/ipa-inline.c:3089
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/93321] New: Unlimited recursion in prepare_block_for_update

2020-01-19 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93321

Bug ID: 93321
   Summary: Unlimited recursion in prepare_block_for_update
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Keywords: compile-time-hog
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-10.0.0-alpha20200110 snapshot (r280115) and g++ 9.2.0 ICE due to stack
exhaustion when compiling gcc/testsuite/g++.old-deja/g++.other/inline20.C w/
-O1 -fno-early-inlining --param max-inline-recursive-depth=9 --param
uninlined-function-insns=50:

% ulimit -s
8192
% g++-10.0.0-alpha20200110 -O1 -fno-early-inlining --param
max-inline-recursive-depth=9 --param uninlined-function-insns=50 -c
gcc/testsuite/g++.old-deja/g++.other/inline20.C -wrapper gdb,--args

<…>

Program received signal SIGSEGV, Segmentation fault.
0x00ac006d in bitmap_set_bit (head=0x2d067d0, bit=403896)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/bitmap.c:950
950
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/bitmap.c:
No such file or directory.
(gdb) where
#0  0x00ac006d in bitmap_set_bit (head=0x2d067d0, bit=403896)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/bitmap.c:950
#1  0x00febf9e in mark_block_for_update (bb=0x7fffdd733888)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/tree-into-ssa.c:449
#2  prepare_block_for_update (bb=0x7fffdd733888, insert_phi_p=true)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/tree-into-ssa.c:2619
#3  0x00fec4e7 in prepare_block_for_update (bb=0x753a74e0,
insert_phi_p=true)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/tree-into-ssa.c:2701

<…>

#279589 0x00fec4e7 in prepare_block_for_update (bb=0x777f1270,
insert_phi_p=true)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/tree-into-ssa.c:2701
#279590 0x00fee92c in update_ssa (update_flags=update_flags@entry=2048)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/tree-into-ssa.c:3395
#279591 0x00fac8c0 in cleanup_tree_cfg_noloop (ssa_update_flags=2048)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/tree-cfgcleanup.c:1060
#279592 0x00face6c in cleanup_tree_cfg (ssa_update_flags=)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/tree-cfgcleanup.c:1165
#279593 0x00e92576 in execute_function_todo (fn=0x779562c0,
data=)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/passes.c:1949
#279594 0x00e931c8 in do_per_function (data=0x208a20, callback=0xe9235c
)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/passes.c:1638
#279595 execute_todo (flags=2132512) at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/passes.c:2037
#279596 0x00e95124 in execute_one_ipa_transform_pass
(do_not_collect=false, ipa_pass=0x2631d00, node=0x779595a0)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/passes.c:2234
#279597 execute_all_ipa_transforms (do_not_collect=do_not_collect@entry=false)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/passes.c:2270
#279598 0x00b37193 in cgraph_node::expand (this=0x779595a0)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/cgraphunit.c:2276
#279599 0x00b382bf in expand_all_functions ()
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/cgraphunit.c:2454
#279600 symbol_table::compile (this=0x777e9100)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/cgraphunit.c:2804
#279601 0x00b3a46c in symbol_table::compile (this=0x777e9100)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/cgraphunit.c:2984
#279602 symbol_table::finalize_compilation_unit (this=0x777e9100)
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/cgraphunit.c:2984
#279603 0x00f60061 in compile_file ()
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/toplev.c:483
#279604 0x00832615 in do_compile ()
at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/toplev.c:2269
#279605 toplev::main (this=this@entry=0x7fffd516, argc=,
argc@entry=17, argv=, 
argv@entry=0x7fffd618) at
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20200110/work/gcc-10-20200110/gcc/toplev.c:2408
#279606 0x008351fe in 

[Bug target/93319] -mtls-dialect=gnu2 doesn't work for x32

2020-01-19 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93319

H.J. Lu  changed:

   What|Removed |Added

URL||https://gcc.gnu.org/ml/gcc-
   ||patches/2020-01/msg01123.ht
   ||ml

--- Comment #2 from H.J. Lu  ---
A patch is posted at

https://gcc.gnu.org/ml/gcc-patches/2020-01/msg01123.html

[Bug fortran/91640] [9 Regression] ICE: gimplification failed (contiguous expr)

2020-01-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91640

Thomas Koenig  changed:

   What|Removed |Added

Summary|[9/10 Regression] ICE:  |[9 Regression] ICE:
   |gimplification failed   |gimplification failed
   |(contiguous expr)   |(contiguous expr)

--- Comment #6 from Thomas Koenig  ---
The patch looks to have caused no trouble, will you backport to gcc 9?

[Bug fortran/57711] Accepts non-matching invalid dummy procedure as actual argument

2020-01-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57711

Thomas Koenig  changed:

   What|Removed |Added

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

--- Comment #7 from Thomas Koenig  ---
I'm a bit confused about this PR.
Is there anything to fix?

[Bug fortran/92805] gfortran: blanks within literal constants should not be allowed

2020-01-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92805

--- Comment #5 from Thomas Koenig  ---
Hi Steve,

> Index: gcc/fortran/primary.c
> ===
> --- gcc/fortran/primary.c (revision 279052)
> +++ gcc/fortran/primary.c (working copy)
> @@ -90,16 +90,22 @@ match_kind_param (int *kind, int *is_iso_c)
>  static int
>  get_kind (int *is_iso_c)
>  {
> +  char c;
>int kind;
>match m;
>  
>*is_iso_c = 0;
>  
> +  c = gfc_peek_ascii_char ();
> +  if (gfc_current_form == FORM_FREE && gfc_is_whitespace (c))
> +return -2;
> +
>if (gfc_match_char ('_') != MATCH_YES)
>  return -2;
>  
> -  m = match_kind_param (, is_iso_c);
> -  if (m == MATCH_NO)
> +  c = gfc_peek_ascii_char ();
> +  if ((gfc_current_form == FORM_FREE && gfc_is_whitespace (c))
> +  || (m = match_kind_param (, is_iso_c)) == MATCH_NO)
>  gfc_error ("Missing kind-parameter at %C");
>  
>return (m == MATCH_YES) ? kind : -1;

That patch looks good. Do you plan on submitting it?

[Bug ipa/93318] [10 regression] Firefox LTO+FDO ICEs in speculative_call_info

2020-01-19 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93318

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Jan Hubicka :

https://gcc.gnu.org/g:118aa5e31ce479bb81a003199b4c6ca0d997c9a2

commit r10-6074-g118aa5e31ce479bb81a003199b4c6ca0d997c9a2
Author: Jan Hubicka 
Date:   Sun Jan 19 13:49:38 2020 +0100

Fix ICE in speculative_call_info

this fixes two issues with the new multi-target speculation code which
reproduce
on Firefox.  I can now build firefox with FDO locally but on Mozilla build
bots
it still fails with ICE in speculative_call_info.

One problem is that speuclative code compares call_stmt and lto_stmt_uid in
a way that may get unwanted effect when these gets out of sync.  It does
not
make sense to have both non-zero so I added code clearing it and sanity
check
that it is kept this way.

Other problem is cgraph_edge::make_direct not working well with multiple
targets.  In this case it removed one speuclative target and the indirect
call
leaving other targets in the tree.

This is fixed by iterating across all targets and removing all except the
good
one (if it exists).

PR lto/93318
* cgraph.c (cgraph_edge::resolve_speculation): Fix foramting.
(cgraph_edge::make_direct): Remove all indirect targets.
(cgraph_edge::redirect_call_stmt_to_callee): Use make_direct..
(cgraph_node::verify_node): Verify that only one call_stmt or
lto_stmt_uid is set.
* cgraphclones.c (cgraph_edge::clone): Set only one call_stmt or
lto_stmt_uid.
* lto-cgraph.c (lto_output_edge): Simplify streaming of stmt.
(lto_output_ref): Simplify streaming of stmt.
* lto-streamer-in.c (fixup_call_stmt_edges_1): Clear lto_stmt_uid.

[Bug libfortran/92836] segfault with inquire()

2020-01-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92836

--- Comment #16 from Thomas Koenig  ---
(In reply to Jerry DeLisle from comment #15)
> Did we conclude that this is an expected race condition?
> 
> I run the example comment 14 and it just hangs for me.

It's certainly not mandated to work, but I think that, as
a quality of implementation issue, it should not hang or
crash.

[Bug target/71727] -O3 -mstrict-align produces code which assumes unaligned vector accesses work

2020-01-19 Thread wilco at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71727

Wilco  changed:

   What|Removed |Added

 CC||wilco at gcc dot gnu.org

--- Comment #8 from Wilco  ---
(In reply to Martin Liška from comment #7)
> Christophe: Can the bug be marked as resolved?

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91927 - it's still failing
since the underlying issues haven't been resolved.

[Bug fortran/44960] non-array used as an array, identified as an external function

2020-01-19 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44960

Thomas Koenig  changed:

   What|Removed |Added

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

--- Comment #2 from Thomas Koenig  ---
Fixed on 

https://gcc.gnu.org/ml/gcc-cvs/2020-01/msg01575.html

[Bug lto/93166] [10 Regression] ICE in get_info_about_necessary_edges, at ipa-cp.c:4137 since r278893

2020-01-19 Thread fxue at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93166

--- Comment #5 from fxue at gcc dot gnu.org ---
To add a specialized class for tree lattices is a way, but will complicate the
code. We can simple remove the assertion. And a one-file test case was made
from original files.

[Bug lto/93166] [10 Regression] ICE in get_info_about_necessary_edges, at ipa-cp.c:4137 since r278893

2020-01-19 Thread fxue at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93166

--- Comment #4 from fxue at gcc dot gnu.org ---
Created attachment 47676
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47676=edit
all-in-one test case