[Bug c/94558] New: Designated initializer inside _Generic is misinterpreted

2020-04-11 Thread elronnd at elronnd dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94558

Bug ID: 94558
   Summary: Designated initializer inside _Generic is
misinterpreted
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: elronnd at elronnd dot net
  Target Milestone: ---

POC:

typedef struct{int _;} A;
typedef struct{int _;} B;

typedef union {
A a;
B b;
} O;

#define NO(o) _Generic((o), \
A: ((O){.a=o}), \
B: ((O){.b=o}))

int main() {
A a;
O o = NO(a);
}


Generates the error message:

incompatible types when initializing type ‘int’ using type ‘A’ {aka ‘struct
’}

Because it's trying to initialize the '_' field in 'A' with 'a', instead of the
'a' field in 'O'.

[Bug libstdc++/94559] New: Nitpick: constexpr_fill test isn't constexpr

2020-04-11 Thread eyalroz at technion dot ac.il
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94559

Bug ID: 94559
   Summary: Nitpick: constexpr_fill test isn't constexpr
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: eyalroz at technion dot ac.il
  Target Milestone: ---

This test:
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/testsuite/23_containers/array/requirements/constexpr_fill.cc

is named constexpr_fill, but that test is a runtime one.

[Bug libstdc++/94559] Nitpick: std::array constexpr_fill test isn't constexpr

2020-04-11 Thread eyalroz at technion dot ac.il
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94559

Eyal Rozenberg  changed:

   What|Removed |Added

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

--- Comment #1 from Eyal Rozenberg  ---
Sorry, I misread.

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-11 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Uros Bizjak :

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

commit r10-7687-gf883c46b4877f637e0fa5025b4d6b5c9040ec566
Author: Uros Bizjak 
Date:   Sat Apr 11 11:51:41 2020 +0200

i386: Fix REDUC_SSE_SMINMAX_MODE mode conditions.

V4SI, V8HI and V16QI modes of redux__scal_ expander
expand with SSE2 instructions (PSRLDQ and PCMPGTx) so use
TARGET_SSE2 as relevant mode iterator codition.

PR target/94494
* config/i386/sse.md (REDUC_SSE_SMINMAX_MODE): Use TARGET_SSE2
condition for V4SI, V8HI and V16QI modes.

testsuite/ChangeLog:

PR target/94494
* gcc.target/i386/pr94494.c: New test.

[Bug c++/94560] New: ICE on recursive templated alias

2020-04-11 Thread pacoarjonilla at yahoo dot es
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94560

Bug ID: 94560
   Summary: ICE on recursive templated alias
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pacoarjonilla at yahoo dot es
  Target Milestone: ---

Maybe related to Bug ID 93085

Only on GCC10 with --std=c++17 and --std=c++20

ICE with tuples and variants. Could not replicate with my own types.

>

#include 

template 
using B = std::tuple;

using A = std::tuple>;

int main()
{
B b;
}

>

Compiler output:

prueba.cc:6:24: error: ‘A’ was not declared in this scope
6 | using A = std::tuple>;
  |^
prueba.cc:6:24: error: template argument 1 is invalid
prueba.cc:6:25: error: template argument 1 is invalid
6 | using A = std::tuple>;
  | ^~
prueba.cc:6:16: error: ‘’ in namespace ‘std’ does not name a
type
6 | using A = std::tuple>;
  |^~~
prueba.cc: In function ‘int main()’:
prueba.cc:10:7: internal compiler error: in alias_ctad_tweaks, at cp/pt.c:28319
   10 | B b;
  |   ^
0x674f3f alias_ctad_tweaks
/home/paco/git/gcc/gcc/cp/pt.c:28319
0x674f3f deduction_guides_for
/home/paco/git/gcc/gcc/cp/pt.c:28491
0x9f5ccb do_class_deduction
/home/paco/git/gcc/gcc/cp/pt.c:28596
0x9f5ccb do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
/home/paco/git/gcc/gcc/cp/pt.c:28725
0x929e5c cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
/home/paco/git/gcc/gcc/cp/decl.c:7503
0x9d0f69 cp_parser_init_declarator
/home/paco/git/gcc/gcc/cp/parser.c:20906
0x9b2422 cp_parser_simple_declaration
/home/paco/git/gcc/gcc/cp/parser.c:13731
0x9b418a cp_parser_declaration_statement
/home/paco/git/gcc/gcc/cp/parser.c:13163
0x9b4e0d cp_parser_statement
/home/paco/git/gcc/gcc/cp/parser.c:11469
0x9b5d38 cp_parser_statement_seq_opt
/home/paco/git/gcc/gcc/cp/parser.c:11835
0x9b5e18 cp_parser_compound_statement
/home/paco/git/gcc/gcc/cp/parser.c:11785
0x9cd1b5 cp_parser_function_body
/home/paco/git/gcc/gcc/cp/parser.c:23059
0x9cd1b5 cp_parser_ctor_initializer_opt_and_function_body
/home/paco/git/gcc/gcc/cp/parser.c:23110
0x9d050d cp_parser_function_definition_after_declarator
/home/paco/git/gcc/gcc/cp/parser.c:28958
0x9d1589 cp_parser_function_definition_from_specifiers_and_declarator
/home/paco/git/gcc/gcc/cp/parser.c:28874
0x9d1589 cp_parser_init_declarator
/home/paco/git/gcc/gcc/cp/parser.c:20666
0x9b2422 cp_parser_simple_declaration
/home/paco/git/gcc/gcc/cp/parser.c:13731
0x9db752 cp_parser_declaration
/home/paco/git/gcc/gcc/cp/parser.c:13430
0x9dbeda cp_parser_translation_unit
/home/paco/git/gcc/gcc/cp/parser.c:4731
0x9dbeda c_parse_file()
/home/paco/git/gcc/gcc/cp/parser.c:43829
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-11 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #7 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Uros Bizjak :

https://gcc.gnu.org/g:59eddd9769057ee094cdae09b15b257cc3db690f

commit r9-8491-g59eddd9769057ee094cdae09b15b257cc3db690f
Author: Uros Bizjak 
Date:   Sat Apr 11 13:22:52 2020 +0200

i386: Fix REDUC_SSE_SMINMAX_MODE mode conditions.

V4SI, V8HI and V16QI modes of redux__scal_ expander
expand with SSE2 instructions (PSRLDQ and PCMPGTx) so use
TARGET_SSE2 as relevant mode iterator codition.

PR target/94494
* config/i386/sse.md (REDUC_SSE_SMINMAX_MODE): Use TARGET_SSE2
condition for V4SI, V8HI and V16QI modes.

testsuite/ChangeLog:

PR target/94494
* gcc.target/i386/pr94494.c: New test.

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-11 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #8 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Uros Bizjak :

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

commit r9-8492-gd2fee90546d0f04595301af8f3786b8e1671814a
Author: Uros Bizjak 
Date:   Sat Apr 11 13:25:51 2020 +0200

i386: Fix REDUC_SSE_SMINMAX_MODE mode conditions.

V4SI, V8HI and V16QI modes of redux__scal_ expander
expand with SSE2 instructions (PSRLDQ and PCMPGTx) so use
TARGET_SSE2 as relevant mode iterator codition.

PR target/94494
* config/i386/sse.md (REDUC_SSE_SMINMAX_MODE): Use TARGET_SSE2
condition for V4SI, V8HI and V16QI modes.

testsuite/ChangeLog:

PR target/94494
* gcc.target/i386/pr94494.c: New test.

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-11 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

Uroš Bizjak  changed:

   What|Removed |Added

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

--- Comment #9 from Uroš Bizjak  ---
Fixed for gcc-9.4+.

[Bug c++/90526] Missing DW_AT_const_value for constexpr field

2020-04-11 Thread ssbssa at yahoo dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90526

Hannes Domani  changed:

   What|Removed |Added

 CC||ssbssa at yahoo dot de

--- Comment #1 from Hannes Domani  ---
The DW_AT_const_value is also emitted if the variable is used, like:

int main()
{
  foo p;
  return !p.is_always_lock_free;
}

[Bug c++/86327] Spurious error on non-constant expression in constexpr function

2020-04-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86327

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #1 from Marek Polacek  ---
Fixed by r264171, will add the test.

[Bug target/94561] New: [10 Regression] ICE in ix86_get_ssemov

2020-04-11 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94561

Bug ID: 94561
   Summary: [10 Regression] ICE in ix86_get_ssemov
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: asolokha at gmx dot com
  Target Milestone: ---
Target: x86_64-unknown-linux-gnu

gcc-10.0.1-alpha20200405 snapshot (g:2a1a0c8c0db0aae50a2cebce59bd64334cd6ba2a)
ICEs when compiling the following testcase w/ -march=knl -O3 -funroll-loops:

struct xi {
  long int mg;
  int lx;
};

struct xi *di;
int *eu;

void
he (void);

int
m8 (int we, int i8)
{
  int wd, cj = 0;

  for (wd = 0; wd < 80; ++wd)
{
  if (di->mg == 0 && (eu[wd] | !!we) == 0 && di->lx == 0)
continue;

  if (i8 == 0)
he ();

  ++cj;
}

  return cj;
}

% x86_64-unknown-linux-gnu-gcc-10.0.1 -march=knl -O3 -funroll-loops -c
cn71lqz4.c
during RTL pass: final
cn71lqz4.c: In function 'm8':
cn71lqz4.c:29:1: internal compiler error: in ix86_get_ssemov, at
config/i386/i386.c:4979
   29 | }
  | ^
0x718cbd ix86_get_ssemov
   
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/config/i386/i386.c:4979
0xa34303 final_scan_insn_1
   
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/final.c:3039
0xa3480b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*)
   
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/final.c:3152
0xa34917 final_1
   
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/final.c:2020
0xa35524 rest_of_handle_final
   
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/final.c:4658
0xa35524 execute
   
/var/tmp/portage/sys-devel/gcc-10.0.1_alpha20200405/work/gcc-10-20200405/gcc/final.c:4736

[Bug c++/86327] Spurious error on non-constant expression in constexpr function

2020-04-11 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86327

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Marek Polacek :

https://gcc.gnu.org/g:4ded16a7782fd3a9e7b37291d04bca596b00b8bd

commit r10-7688-g4ded16a7782fd3a9e7b37291d04bca596b00b8bd
Author: Marek Polacek 
Date:   Sat Apr 11 10:45:33 2020 -0400

c++: Add test for PR 86327.

Fixed by r264171.

PR c++/86327
* g++.dg/cpp1y/constexpr-return5.C: New test.

[Bug c++/86327] Spurious error on non-constant expression in constexpr function

2020-04-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86327

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #3 from Marek Polacek  ---
Fixed in GCC 9.

[Bug c++/55004] [meta-bug] constexpr issues

2020-04-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
Bug 55004 depends on bug 86327, which changed state.

Bug 86327 Summary: Spurious error on non-constant expression in constexpr 
function
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86327

   What|Removed |Added

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

[Bug c++/94477] ICE in tsubst_expr, at cp/pt.c:18181

2020-04-11 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94477

--- Comment #5 from Arseny Solokha  ---
Is there some further work pending, or can this PR be closed?

[Bug target/93069] Assembler messages: Error: unsupported masking for `vextracti32x8'

2020-04-11 Thread asolokha at gmx dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93069

--- Comment #7 from Arseny Solokha  ---
Is there some further work pending, or can this PR be closed?

[Bug target/93069] Assembler messages: Error: unsupported masking for `vextracti32x8'

2020-04-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93069

--- Comment #8 from Jakub Jelinek  ---
Yes, there is a larger patch approved for GCC11, but not for GCC10.

[Bug c++/94477] ICE in tsubst_expr, at cp/pt.c:18181

2020-04-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94477

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #6 from Jakub Jelinek  ---
GCC 8 doesn't support parallel master, so this is now fixed everywhere.

[Bug c++/94560] ICE on recursive templated alias

2020-04-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94560

Marek Polacek  changed:

   What|Removed |Added

   Last reconfirmed||2020-04-11
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Keywords||ice-on-invalid-code
 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
Confirmed but looks invalid.

[Bug c++/55588] Failure to diagnose non-template-id prefixed by keyword template

2020-04-11 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55588

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #8 from Marek Polacek  ---
This is CWG 96.  Too late for GCC 10 but I'll take a look in GCC 11.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94404
[Bug 94404] [meta-bug] C++ core issues

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2020-04-11 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #13 from Piotr Kubaj  ---
Breakage in GCC 10 was caused after 201900818 snapshot, but before 201900825
(201900825 is the first broken).

[Bug bootstrap/89494] Bootstrap error when using GCC 4.2.1

2020-04-11 Thread pkubaj at anongoth dot pl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89494

--- Comment #14 from Piotr Kubaj  ---
Exact error for 10.0:
In file included from
/usr/ports/lang/gcc10-devel/work/gcc-10-20190825/libgcc/libgcc2.c:56:
/usr/ports/lang/gcc10-devel/work/gcc-10-20190825/libgcc/libgcc2.c: In function
'__multi3':
/usr/ports/lang/gcc10-devel/work/gcc-10-20190825/libgcc/libgcc2.h:203:20:
internal compiler error: tree check: expected class 'type', have 'exceptional'
(error_mark) in build_int_cst, at tree.c:1371
  203 | #define __NDW(a,b) __ ## a ## ti ## b
  |^~
/usr/ports/lang/gcc10-devel/work/gcc-10-20190825/libgcc/libgcc2.h:273:18: note:
in expansion of macro '__NDW'
  273 | #define __muldi3 __NDW(mul,3)
  |  ^
/usr/ports/lang/gcc10-devel/work/gcc-10-20190825/libgcc/libgcc2.c:548:1: note:
in expansion of macro '__muldi3'
  548 | __muldi3 (DWtype u, DWtype v)
  | ^~~~

[Bug target/94561] [10 Regression] ICE in ix86_get_ssemov

2020-04-11 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94561

Uroš Bizjak  changed:

   What|Removed |Added

   Last reconfirmed||2020-04-11
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
 CC||hjl.tools at gmail dot com

--- Comment #1 from Uroš Bizjak  ---
Confirmed, CC author.

[Bug fortran/94109] Memory leak introduced in 8.3.0->8.3.1

2020-04-11 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94109

Thomas Koenig  changed:

   What|Removed |Added

 CC||tkoenig at gcc dot gnu.org
   Last reconfirmed||2020-04-11
 Ever confirmed|0   |1
 Status|UNCONFIRMED |WAITING

--- Comment #1 from Thomas Koenig  ---
Is there a test case?

[Bug fortran/94104] Request for diagnostic improvement

2020-04-11 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94104

Thomas Koenig  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2020-04-11
 Status|UNCONFIRMED |NEW
 CC||tkoenig at gcc dot gnu.org
   Severity|normal  |enhancement

--- Comment #1 from Thomas Koenig  ---
Would be useful, yes.

[Bug libstdc++/94562] New: C++20: std::shared_ptr{} <=> nullptr ill-formed

2020-04-11 Thread daniel.kruegler at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94562

Bug ID: 94562
   Summary: C++20: std::shared_ptr{} <=> nullptr ill-formed
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daniel.kruegler at googlemail dot com
  Target Milestone: ---

The following program (using -Wall -Wextra -std=c++2a -pedantic) is rejected:

#include 

bool ok = std::shared_ptr{} <=> nullptr; 

int main()
{
}

with the following diagnostics:
>>
prog.cc:3:34: error: no match for 'operator<=>' (operand types are
'std::shared_ptr' and 'std::nullptr_t')
3 | bool ok = std::shared_ptr{} <=> nullptr;
  |~~^~~
In file included from
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/stl_algobase.h:67,
 from /opt/wandbox/gcc-head/include/c++/10.0.1/memory:63,
 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/stl_iterator.h:474:5: note:
candidate: 'template  requires 
three_way_comparable_with<_IteratorR, _IteratorL, std::partial_ordering>
constexpr std::compare_three_way_result_t<_IteratorL, _IteratorR>
std::operator<=>(const std::reverse_iterator<_IteratorL>&, const
std::reverse_iterator<_IteratorR>&)' (reversed)
  474 | operator<=>(const reverse_iterator<_IteratorL>& __x,
  | ^~~~
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/stl_iterator.h:474:5: note:  
template argument deduction/substitution failed:
prog.cc:3:38: note:   mismatched types 'const
std::reverse_iterator<_IteratorL>' and 'std::nullptr_t'
3 | bool ok = std::shared_ptr{} <=> nullptr;
  |  ^~~
In file included from
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/stl_algobase.h:67,
 from /opt/wandbox/gcc-head/include/c++/10.0.1/memory:63,
 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/stl_iterator.h:1433:5: note:
candidate: 'template  requires 
three_way_comparable_with<_IteratorR, _IteratorL, std::partial_ordering>
constexpr std::compare_three_way_result_t<_IteratorL, _IteratorR>
std::operator<=>(const std::move_iterator<_IteratorL>&, const
std::move_iterator<_IteratorR>&)' (reversed)
 1433 | operator<=>(const move_iterator<_IteratorL>& __x,
  | ^~~~
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/stl_iterator.h:1433:5: note:  
template argument deduction/substitution failed:
prog.cc:3:38: note:   mismatched types 'const std::move_iterator<_IteratorL>'
and 'std::nullptr_t'
3 | bool ok = std::shared_ptr{} <=> nullptr;
  |  ^~~
In file included from /opt/wandbox/gcc-head/include/c++/10.0.1/ranges:45,
 from
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/ranges_algobase.h:38,
 from
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/ranges_uninitialized.h:36,
 from /opt/wandbox/gcc-head/include/c++/10.0.1/memory:69,
 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/10.0.1/optional:1036:5: note: candidate:
'template  requires  three_way_comparable_with<_Up, _Tp,
std::partial_ordering> constexpr std::compare_three_way_result_t<_IteratorL,
_IteratorR> std::operator<=>(const std::optional<_Tp>&, const
std::optional<_Up>&)' (reversed)
 1036 | operator<=>(const optional<_Tp>& __x, const optional<_Up>& __y)
  | ^~~~
/opt/wandbox/gcc-head/include/c++/10.0.1/optional:1036:5: note:   template
argument deduction/substitution failed:
prog.cc:3:38: note:   mismatched types 'const std::optional<_Tp>' and
'std::nullptr_t'
3 | bool ok = std::shared_ptr{} <=> nullptr;
  |  ^~~
In file included from /opt/wandbox/gcc-head/include/c++/10.0.1/ranges:45,
 from
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/ranges_algobase.h:38,
 from
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/ranges_uninitialized.h:36,
 from /opt/wandbox/gcc-head/include/c++/10.0.1/memory:69,
 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/10.0.1/optional:1051:5: note: candidate:
'template constexpr std::strong_ordering std::operator<=>(const
std::optional<_Tp>&, std::nullopt_t)' (reversed)
 1051 | operator<=>(const optional<_Tp>& __x, nullopt_t) noexcept
  | ^~~~
/opt/wandbox/gcc-head/include/c++/10.0.1/optional:1051:5: note:   template
argument deduction/substitution failed:
prog.cc:3:38: note:   mismatched types 'const std::optional<_Tp>' and
'std::nullptr_t'
3 | bool ok = std::shared_ptr{} <=> nullptr;
  |  ^~~
In file included from /opt/wandbox/gcc-head/include/c++/10.0.1/ranges:45,
 from
/opt/wandbox/gcc-head/include/c++/10.0.1/bits/ranges_algobase.h:38,
 from
/opt/wandbox/

[Bug fortran/94109] Memory leak introduced in 8.3.0->8.3.1

2020-04-11 Thread antony at cosmologist dot info
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94109

--- Comment #2 from Antony Lewis  ---
This may be the test case, though I'm not 100% sure:

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

[Bug libstdc++/94562] C++20: std::shared_ptr{} <=> nullptr ill-formed

2020-04-11 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94562

--- Comment #1 from Jonathan Wakely  ---
No, it's because that operator isn't implemented yet.

[Bug fortran/94091] Erroneous __builtin_memcpy warning for character assignment

2020-04-11 Thread tkoenig at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94091

Thomas Koenig  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |tkoenig at gcc dot 
gnu.org
   Last reconfirmed||2020-04-11
 Ever confirmed|0   |1
 CC||tkoenig at gcc dot gnu.org
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Thomas Koenig  ---
This seems to be fixed on current trunk.

Once I have wrestled git into a state that I can work with, I will commit
a test case and then close as FIXED.

[Bug c++/94563] New: Relational operations between pointer and nullptr accepted

2020-04-11 Thread daniel.kruegler at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94563

Bug ID: 94563
   Summary: Relational operations between pointer and nullptr
accepted
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daniel.kruegler at googlemail dot com
  Target Milestone: ---

The following code is accepted for language versions c++14, c++17, as well as
c++20 using the following additional compiler flags:

-Wall -Wextra -pedantic

bool test(int* p)
{
  return p < nullptr;
}

int main()
{
}

It should be noted, that a warning is emitted, satisfying the requirement for a
diagnostic in a strict sense:

>>
prog.cc: In function 'bool test(int*)':
prog.cc:3:12: warning: ordered comparison of pointer with integer zero
[-Wextra]
3 |   return p < nullptr;
  |  ~~^

0
>>

This code should be ill-formed since the acceptance of

http://wg21.link/n3624

[Bug c++/94563] Relational operations between pointer and nullptr accepted

2020-04-11 Thread daniel.kruegler at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94563

--- Comment #1 from Daniel Krügler  ---
To clarify the actual bug character of this issue, the following example shows
it more clearly:

template
bool test(T*)
{
  return true;
}

int main()
{
  test((int*)(nullptr));
}

This program should be ill-formed because the invalid expression

((T*) 0) < nullptr

should not make test available, but the code is accepted without any
diagnostics.

[Bug c++/94564] New: C++20: Three-way comparison between pointer and nullptr accepted

2020-04-11 Thread daniel.kruegler at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94564

Bug ID: 94564
   Summary: C++20: Three-way comparison between pointer and
nullptr accepted
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daniel.kruegler at googlemail dot com
  Target Milestone: ---

The following program is accepted when compiling against C++20, but should be
rejected, because the C++20 working draft does not support three-way comparison
between pointer and std::nullptr_t (See [expr.spaceship] p6):

Compiler options:

-Wall -Wextra -pedantic -std=c++20

//---
#include 

template nullptr), true) = false>
void test(T*)
{
}

int main()
{
  test((int*)(nullptr));
}
//---

[Bug libstdc++/94565] New: C++20: Comparing comparison category types against 0/nullptr is not noexcept

2020-04-11 Thread daniel.kruegler at googlemail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94565

Bug ID: 94565
   Summary: C++20: Comparing comparison category types against
0/nullptr is not noexcept
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: daniel.kruegler at googlemail dot com
  Target Milestone: ---

The following program should be accepted, but is rejected due to a violation of
the static_assertion:

Compiler options:

-Wall -Wextra -pedantic "-std=c++20"

//-
#include 

int main()
{
  static_assert(noexcept(std::partial_ordering::less == 0));
}
//-

prog.cc: In function 'int main()':
prog.cc:5:17: error: static assertion failed
5 |   static_assert(noexcept(std::partial_ordering::less == 0));
  | ^~

The corresponding comparison functions for are all declared as noexcept
([cmp.partialord], [cmp.weakord], [cmp.strongord]), so the clear intention is
that such an comparison should be observable as non-throwing operations. The
reason why above test fails for all of the existing mixed comparison functions
of all the three comparison category types against 0/nullptr is caused by the
fact that the implementation-internal type std::__cmp_cat::__unspec in header
 misses to declare its converting constructor as noexcept:

struct __unspec
{
  constexpr __unspec(__unspec*) { }
};

[Bug tree-optimization/94566] New: conversion between std::strong_ordering and int

2020-04-11 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94566

Bug ID: 94566
   Summary: conversion between std::strong_ordering and int
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: glisse at gcc dot gnu.org
  Target Milestone: ---

#include 

int conv1(std::strong_ordering s){
  if(s==std::strong_ordering::less) return -1;
  if(s==std::strong_ordering::equal) return 0;
  if(s==std::strong_ordering::greater) return 1;
  __builtin_unreachable();
}
std::strong_ordering conv2(int i){
  switch(i){
case -1: return std::strong_ordering::less;
case 0: return std::strong_ordering::equal;
case 1: return std::strong_ordering::greater;
default: __builtin_unreachable();
  }
}

Compiling with -std=gnu++2a -O3. I would like the compiler to notice that those
are just NOP (at most a sign-extension). Clang manages it for conv2. Gcc
generates:

movl$-1, %eax
cmpb$-1, %dil
je  .L1
xorl%eax, %eax
testb   %dil, %dil
setne   %al
.L1:
ret

and

xorl%eax, %eax
testl   %edi, %edi
je  .L10
cmpl$1, %edi
sete%al
leal-1(%rax,%rax), %eax
.L10:
ret


(apparently the C++ committee thinks it is a good idea to provide a type that
is essentially an int that can only be -1, 0 or 1, but not provide any direct
way to convert to/from int)

[Bug c++/94550] False positive with -Wparentheses

2020-04-11 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94550

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2020-04-11
 Status|UNCONFIRMED |WAITING
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
Do you have a full example?  Where the problem occurs since your example does
not compile at all.

[Bug ada/87972] remove -f*-prefix-map= options from Ada Library Information files

2020-04-11 Thread nicolas at debian dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87972

Nicolas Boulenguez  changed:

   What|Removed |Added

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

--- Comment #1 from Nicolas Boulenguez  ---
This patch does not fix the initial problem.

Imagine a compilation driven by gnatmake with
gnatmake main.adb -cargs -fdebug-prefix-map=OLD=NEW

During the compilation phase:
gcc -c -fdebug-prefix-map=OLD=NEW main.adb
* does not write the path to .o   (because of the option)
* does not write the path to .ali (because of the patch)
This is good. However, during the link phase, the source generated by the
linker (b~main.adb) is compiled by gnatlink. The flags are taken from main.ali,
they do not contain -fdebug-prefix-map anymore.
So the path appears in b~main.o then the executable, which is exactly what we
want to avoid.

The problem is more general, see
https://gcc.gnu.org/pipermail/gcc-patches/2016-November/46.html

Sorry for the noise.

[Bug tree-optimization/94567] New: wrong code at -O2 and -O3 on x86_64-linux-gnu

2020-04-11 Thread qrzhang at gatech dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94567

Bug ID: 94567
   Summary: wrong code at -O2 and -O3 on x86_64-linux-gnu
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: qrzhang at gatech dot edu
  Target Milestone: ---

It's a recent regression. Bisection points to g:529ea7d9596b26ba103578eeab


$ gcc-trunk -v
gcc version 10.0.1 20200411 (experimental) [master revision
bb87d5cc77d:75961caccb7:f883c46b4877f637e0fa5025b4d6b5c9040ec566] (GCC)


$ gcc-trunk abc.c ; ./a.out
4

$ gcc-trunk -O2 abc.c ; ./a.out
0


$ cat abc.c
volatile int a = 1, b;
short c, d = 4, e = 53736, f = 2, g;
int(h)(int i, int j) { return i && j ? 0 : i + j; }
int main() {
  for (; a; a = 0) {
unsigned short k = e;
g = k >> 3;
if (h(g < (f || c), b))
  d = 0;
  }
  printf("%X\n", d);
}