[Bug libstdc++/71108] to_string is relatively slow

2022-07-03 Thread de34 at live dot cn via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71108

Jiang An  changed:

   What|Removed |Added

 CC||de34 at live dot cn

--- Comment #2 from Jiang An  ---
Seems (partially) fixed by this commit (included in gcc 10):
https://gcc.gnu.org/git/?p=gcc.git=commit;h=cd0b94e650a880b2ab04922e476aa28007277d5c

The floating-point overloads is seemly difficult to be improved as current
standard wording requires they to access C locale whatever. P2587
(https://wg21.link/p2587) may change the status quo.

Can this issue be considered fixed in gcc 10?

[Bug libgcc/56101] pthread program abort

2022-07-03 Thread masahiko.kimoto at miraclelinux dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56101

Masahiko Kimoto  changed:

   What|Removed |Added

 CC||masahiko.kimoto@miraclelinu
   ||x.com

--- Comment #6 from Masahiko Kimoto  
---
In case of removing GCC runtime libraries(libgcc_s.so, libstdc++.so) from root
filesystem, especially required in embedded environment, this constrainti
annoys us.

Is there any workaround without using dlopen(libgcc_s) ?

According to our examination, it does not abort when all libraries are linked
statically by -static option of GCC.

[Bug demangler/105039] rust demangler stack overflow

2022-07-03 Thread hs.naveen2u at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105039

--- Comment #6 from hs.naveen2u at gmail dot com ---
Thanks very much for committing the patch.

[Bug fortran/105473] semicolon allowed when list-directed read integer with decimal='point'

2022-07-03 Thread jvdelisle at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105473

--- Comment #26 from Jerry DeLisle  ---
I will be comitting it to trunk which is rev 13 if approved. John, I was not
expecting you to do anything.  Since all my time on this is unpaid volunteer
work, I get to it when I have time.

I am not sure we will get it backported to rev 9.  Will see as I get there.

[Bug c++/105044] [modules] ICE in comptypes, at cp/typeck.cc:1531

2022-07-03 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105044

--- Comment #3 from Johel Ernesto Guerrero Peña  ---
Enough recompilations from the actual use-case show this error:
```
/home/johel/Documents/C++/Repos/Waarudo/tests/unit/test.waarudo.quantities.cpp:
In substitution of ‘template struct
waarudo::is_unit@waarudo.quantities*> [with auto ...D = {waarudo::ratio@waarudo.quantities{146097, 400}, (&
waarudo::day@waarudo.quantities)}]’:
/home/johel/Documents/C++/Repos/Waarudo/tests/unit/test.waarudo.quantities.cpp:21:57:
  required from here
/home/johel/Documents/C++/Repos/Waarudo/tests/unit/test.waarudo.quantities.cpp:21:57:
internal compiler error: tree check: expected tree that contains ‘typed’
structure, have ‘ggc_freed’ in convert_nontype_argument, at cp/pt.cc:7763
   21 | static_assert(waarudo::is_unit::value);
  | ^~
0x226d11c internal_error(char const*, ...)
???:0
0x8d094f tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
???:0
0xbc4daa lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
???:0
0xbafdb7 tsubst(tree_node*, tree_node*, int, tree_node*)
???:0
0xbbf9eb tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
???:0
0xbae4e6 most_specialized_partial_spec(tree_node*, int)
???:0
0xbd7a1c instantiate_class_template(tree_node*)
???:0
0xc2fe01 complete_type(tree_node*)
???:0
0xb7a0db c_parse_file()
???:0
0xcb9cd1 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
```

[Bug bootstrap/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
 Ever confirmed|0   |1
   Last reconfirmed||2022-07-03

--- Comment #14 from Andrew Pinski  ---
> make[2]: *** [Makefile:20255: all-stage2-target-libgcc] Error 2
> make[2]: Leaving directory '/home/chris/rpm/BUILD/gcc-obj-x86_64-pc-linux-gnu'
> make[1]: *** [Makefile:25739: stage2-bubble] Error 2
> make[1]: Leaving directory '/home/chris/rpm/BUILD/gcc-obj-x86_64-pc-linux-gnu'
> make: *** [Makefile:1072: all] Error 2


Did you set any CFLAGS or STAGE1_CFLAGS (or CXXFLAGS) env?
What the above means is stage1 is being miscompiled.
I Noticed you used --disable-checking, these days the default for releases is
--enable-checking=release rather than --disable-checking (slightly different
though).

[Bug bootstrap/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

Andrew Pinski  changed:

   What|Removed |Added

 Target||x86_64-Krisux-linux
   Host||x86_64-Krisux-linux
  Component|middle-end  |bootstrap
  Build||x86_64-Krisux-linux

--- Comment #13 from Andrew Pinski  ---
// Configured with: ../gcc-13-20220626/configure --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --prefix=/usr/local
--enable-shared --enable-threads=posix --enable-haifa
--enable-languages=c,c++,fortran --enable-long-long --enable-namespaces
--with-gnu-as --with-gnu-ld --with-system-zlib --without-x --disable-werror
--disable-checking --enable-__cxa_atexit --disable-nls
--without-included-gettext --disable-multilib --program-suffix=13
x86_64-Krisux-linux

[Bug middle-end/106173] -fleading-underscore option inactive although reported as active

2022-07-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106173

Andrew Pinski  changed:

   What|Removed |Added

  Known to work||12.1.0
  Known to fail||11.1.0

--- Comment #1 from Andrew Pinski  ---
Note in GCC 11+, you need to add --help to get which option has enabled or not.
Also note in GCC 12+ we get:
  -fleading-underscore  

Which means it is not enabled or disabled. Still trying to figure out what
changed that.

[Bug c++/106176] New: Compiler diagnostic doesn't show where it's coming from in my code

2022-07-03 Thread barry.revzin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106176

Bug ID: 106176
   Summary: Compiler diagnostic doesn't show where it's coming
from in my code
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

Consider the following program, carefully reduced from real code:

#include 

// template  using which = std::map;
template  using which = T;

struct C
{
C();
~C() = default;

static C create();   

struct M
{
M(M&&) = default;
};

which member;
};

C C::create()
{
C c;
return c;
}

This, when compiled with gcc 12.1 -std=c++20 emits
(https://godbolt.org/z/YhfzWTjKq):

: In static member function 'static C C::create()':
:24:12: error: use of deleted function 'C::C(const C&)'
   24 | return c;
  |^
:6:8: note: 'C::C(const C&)' is implicitly deleted because the default
definition would be ill-formed:
6 | struct C
  |^
:6:8: error: use of deleted function 'constexpr C::M::M(const C::M&)'
:13:12: note: 'constexpr C::M::M(const C::M&)' is implicitly declared
as deleted because 'C::M' declares a move constructor or move assignment
operator
   13 | struct M
  |^
Compiler returned: 1

This diagnostic (a) points to the offending line in my code, precisely, and (b)
explains what the problem is. That's pretty good. It could be better: the real
problem here is that C's explicitly default destructor inhibited the
compiler-generated move constructor, why is why the copy is a problem to begin
with. 

If we change the definition of the member from M to std::map (by
changing which declaration of which is commented), nothing really changes about
this program - we still have a move-only member, so this is broken since C is
missing the move constructor, etc. However, the new diagnostic becomes
(https://godbolt.org/z/9TG3WK75G):

In file included from
/opt/compiler-explorer/gcc-12.1.0/include/c++/12.1.0/ext/alloc_traits.h:34,
 from
/opt/compiler-explorer/gcc-12.1.0/include/c++/12.1.0/bits/stl_tree.h:67,
 from
/opt/compiler-explorer/gcc-12.1.0/include/c++/12.1.0/map:60,
 from :1:
/opt/compiler-explorer/gcc-12.1.0/include/c++/12.1.0/bits/alloc_traits.h: In
instantiation of 'static constexpr void
std::allocator_traits >::construct(allocator_type&, _Up*,
_Args&& ...) [with _Up = std::pair; _Args = {const
std::pair&}; _Tp = std::_Rb_tree_node >; allocator_type = std::allocator > >]':
/opt/compiler-explorer/gcc-12.1.0/include/c++/12.1.0/bits/stl_tree.h:595:32:  
required from 'void std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare,
_Alloc>::_M_construct_node(_Link_type, _Args&& ...) [with _Args = {const
std::pair&}; _Key = int; _Val = std::pair;
_KeyOfValue = std::_Select1st >; _Compare =
std::less; _Alloc = std::allocator >;
_Link_type = std::_Rb_tree_node >*]'
/opt/compiler-explorer/gcc-12.1.0/include/c++/12.1.0/bits/stl_tree.h:612:21:  
required from 'std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_M_create_node(_Args&& ...) [with _Args = {const
std::pair&}; _Key = int; _Val = std::pair;
_KeyOfValue = std::_Select1st >; _Compare =
std::less; _Alloc = std::allocator >;
_Link_type = std::_Rb_tree_node >*]'
/opt/compiler-explorer/gcc-12.1.0/include/c++/12.1.0/bits/stl_tree.h:529:32:  
required from 'std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_Alloc_node::operator()(_Arg&&) const [with _Arg = const
std::pair&; _Key = int; _Val = std::pair;
_KeyOfValue = std::_Select1st >; _Compare =
std::less; _Alloc = std::allocator >;
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type =
std::_Rb_tree_node >*]'
/opt/compiler-explorer/gcc-12.1.0/include/c++/12.1.0/bits/stl_tree.h:645:18:  
required from 'std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_M_clone_node(_Link_type, _NodeGen&) [with bool _MoveValue =
false; _NodeGen = std::_Rb_tree,
std::_Select1st >, std::less,
std::allocator > >::_Alloc_node; _Key = int; _Val =
std::pair; _KeyOfValue = std::_Select1st >; _Compare = std::less; _Alloc = std::allocator >; _Link_type = std::_Rb_tree_node >*]'
/opt/compiler-explorer/gcc-12.1.0/include/c++/12.1.0/bits/stl_tree.h:1895:47:  
required from 'std::_Rb_tree_node<_Val>* std::_Rb_tree<_Key, _Val, _KeyOfValue,
_Compare, _Alloc>::_M_copy(_Link_type, _Base_ptr, _NodeGen&) [with bool
_MoveValues = false; _NodeGen = std::_Rb_tree,
std::_Select1st >, std::less,
std::allocator > >::_Alloc_node; _Key = int; _Val =
std::pair; _KeyOfValue = std::_Select1st >; _Compare = std::less; _Alloc = std::allocator >; _Link_type = std::_Rb_tree_node >*;
_Base_ptr = std::_Rb_tree_node_base*]'

[Bug c++/106174] c++20: compilation fails erroneously with "deallocation of already deallocated storage"

2022-07-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106174

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|UNCONFIRMED |RESOLVED

--- Comment #1 from Andrew Pinski  ---
This is the same issue as PR 101777 which has a nice reduced testcase which
does not depend on the libstdc++ headers.

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

[Bug c++/101777] Copying array of non-trivial type during constant evaluation is incorrect

2022-07-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101777

Andrew Pinski  changed:

   What|Removed |Added

 CC||janpmoeller at gmx dot de

--- Comment #2 from Andrew Pinski  ---
*** Bug 106174 has been marked as a duplicate of this bug. ***

[Bug c++/105044] [modules] ICE in comptypes, at cp/typeck.cc:1531

2022-07-03 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105044

Johel Ernesto Guerrero Peña  changed:

   What|Removed |Added

Summary|[modules] ICE in comptypes, |[modules] ICE in comptypes,
   |at cp/typeck.c:1529 |at cp/typeck.cc:1531

--- Comment #2 from Johel Ernesto Guerrero Peña  ---
Another simpler reproducer from another use-case:
https://godbolt.org/z/jroqv6Kzq.

`mod.cpp`:
```C++
export module mod;
export template struct constant { };
export template struct is_constant { };
struct monostate { };
inline constexpr constant c1{};
```

`test.cpp`:
```C++
import mod;
is_constant> v;
int main() { }
```

Output:
```
In module mod, imported at /app/test.cpp:1:
mod.cpp: In instantiation of 'struct is_constant@mod >':
test.cpp:2:26:   required from here
mod.cpp:3:31: internal compiler error: in comptypes, at cp/typeck.cc:1531
3 | export template struct is_constant { };
  |   ^~~
0x2216469 internal_error(char const*, ...)
???:0
0x74b7d9 fancy_abort(char const*, int, char const*)
???:0
0xa90b66 comptypes(tree_node*, tree_node*, int)
???:0
0x833e5d complete_vars(tree_node*)
???:0
0x7ab99b finish_struct_1(tree_node*)
???:0
0xa13ed4 instantiate_class_template(tree_node*)
???:0
0x823818 start_decl_1(tree_node*, bool)
???:0
0x84b6a6 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
???:0
0x99555d c_parse_file()
???:0
0xb2bc61 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
```

[Bug c++/105044] [modules] ICE in comptypes, at cp/typeck.c:1529

2022-07-03 Thread johelegp at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105044

--- Comment #1 from Johel Ernesto Guerrero Peña  ---
Another simpler reproducer from another use-case:
https://godbolt.org/z/jroqv6Kzq.

`mod.cpp`:
```C++
export module mod;
export template struct constant { };
export template struct is_constant { };
struct monostate { };
inline constexpr constant c1{};
```

`test.cpp`:
```C++
import mod;
is_constant> v;
int main() { }
```

Output:
```
In module mod, imported at /app/test.cpp:1:
mod.cpp: In instantiation of 'struct is_constant@mod >':
test.cpp:2:26:   required from here
mod.cpp:3:31: internal compiler error: in comptypes, at cp/typeck.cc:1531
3 | export template struct is_constant { };
  |   ^~~
0x2216469 internal_error(char const*, ...)
???:0
0x74b7d9 fancy_abort(char const*, int, char const*)
???:0
0xa90b66 comptypes(tree_node*, tree_node*, int)
???:0
0x833e5d complete_vars(tree_node*)
???:0
0x7ab99b finish_struct_1(tree_node*)
???:0
0xa13ed4 instantiate_class_template(tree_node*)
???:0
0x823818 start_decl_1(tree_node*, bool)
???:0
0x84b6a6 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
???:0
0x99555d c_parse_file()
???:0
0xb2bc61 c_common_parse_file()
???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.
```

[Bug tree-optimization/94026] combine missed opportunity to simplify comparisons with zero

2022-07-03 Thread roger at nextmovesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94026

Roger Sayle  changed:

   What|Removed |Added

 CC||roger at nextmovesoftware dot 
com
   Target Milestone|--- |13.0
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #13 from Roger Sayle  ---
This should now be fixed on mainline.  For the corrected code in comment #4,GCC
now generates (on arm):
tst w0, 1536
csetw0, ne
ret
as suggested by Fei in the original PR.

[Bug libstdc++/106175] std::prev and next should check for equality with std::begin

2022-07-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106175

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #7 from Andrew Pinski  ---
(In reply to KL from comment #6)
> And this is not a normal situation for a language that aims to be safer.

GCC's debug mode for libstdc++ detects it. If you don't want to use that while
debugging your program, then you should raise this up to the standards
committee ...

[Bug fortran/105243] ICE in next_char, at fortran/io.cc:160

2022-07-03 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105243

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

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

--- Comment #16 from anlauf at gcc dot gnu.org ---
Fixed on all open branches.  Closing.

Thanks for the report!

[Bug fortran/103693] [12/13 Regression] ICE in gfc_array_dimen_size(): Bad EXPR_ARRAY expr since r12-4967-gbcf3728abe848888

2022-07-03 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103693

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|12.2|10.5
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #8 from anlauf at gcc dot gnu.org ---
Fixed on all open branches.  Closing.

Thanks for the report!

[Bug fortran/103138] [12/13 Regression] ICE in gfc_simplify_cshift, at fortran/simplify.c:2139 since r12-4967-gbcf3728abe848888

2022-07-03 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103138

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   Target Milestone|12.2|10.5
 Resolution|--- |FIXED

--- Comment #12 from anlauf at gcc dot gnu.org ---
Fixed on all open branches.  Closing.

Thanks for the report!

[Bug fortran/103137] [12/13 Regression] ICE in gfc_simplify_transpose, at fortran/simplify.c:8181 since r12-4967-gbcf3728abe848888

2022-07-03 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103137

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|12.2|10.5
 Status|NEW |RESOLVED

--- Comment #13 from anlauf at gcc dot gnu.org ---
Fixed on all open branches.  Closing.

Thanks for the report!

[Bug fortran/106121] ICE in gfc_simplify_extends_type_of, at fortran/simplify.cc:3109

2022-07-03 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106121

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |10.5

[Bug fortran/103693] [12/13 Regression] ICE in gfc_array_dimen_size(): Bad EXPR_ARRAY expr since r12-4967-gbcf3728abe848888

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103693

--- Comment #7 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:290147c4c8e3d9d1f13297b511d3a0afb5e952d4

commit r10-10882-g290147c4c8e3d9d1f13297b511d3a0afb5e952d4
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.c (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/103137] [12/13 Regression] ICE in gfc_simplify_transpose, at fortran/simplify.c:8181 since r12-4967-gbcf3728abe848888

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103137

--- Comment #12 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:290147c4c8e3d9d1f13297b511d3a0afb5e952d4

commit r10-10882-g290147c4c8e3d9d1f13297b511d3a0afb5e952d4
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.c (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/103138] [12/13 Regression] ICE in gfc_simplify_cshift, at fortran/simplify.c:2139 since r12-4967-gbcf3728abe848888

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103138

--- Comment #11 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:290147c4c8e3d9d1f13297b511d3a0afb5e952d4

commit r10-10882-g290147c4c8e3d9d1f13297b511d3a0afb5e952d4
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.c (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/105243] ICE in next_char, at fortran/io.cc:160

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105243

--- Comment #15 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:290147c4c8e3d9d1f13297b511d3a0afb5e952d4

commit r10-10882-g290147c4c8e3d9d1f13297b511d3a0afb5e952d4
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.c (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/106121] ICE in gfc_simplify_extends_type_of, at fortran/simplify.cc:3109

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106121

--- Comment #10 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:8bb7567f5a3e67ab91614d4538eb3a14a5a76274

commit r10-10881-g8bb7567f5a3e67ab91614d4538eb3a14a5a76274
Author: Harald Anlauf 
Date:   Tue Jun 28 22:29:28 2022 +0200

Fortran: improve error recovery for EXTENDS_TYPE_OF() [PR106121]

gcc/fortran/ChangeLog:

PR fortran/106121
* simplify.c (gfc_simplify_extends_type_of): Do not attempt to
simplify when one of the arguments is a CLASS variable that was
not properly declared.

gcc/testsuite/ChangeLog:

PR fortran/106121
* gfortran.dg/extends_type_of_4.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit b8f284d3673004dffae714b56ed663467c2a52a7)

[Bug fortran/105243] ICE in next_char, at fortran/io.cc:160

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105243

--- Comment #14 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:5c293d9abc4b14e987a574fc11666809a2b8b8da

commit r11-10107-g5c293d9abc4b14e987a574fc11666809a2b8b8da
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.c (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/103138] [12/13 Regression] ICE in gfc_simplify_cshift, at fortran/simplify.c:2139 since r12-4967-gbcf3728abe848888

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103138

--- Comment #10 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:5c293d9abc4b14e987a574fc11666809a2b8b8da

commit r11-10107-g5c293d9abc4b14e987a574fc11666809a2b8b8da
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.c (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/103137] [12/13 Regression] ICE in gfc_simplify_transpose, at fortran/simplify.c:8181 since r12-4967-gbcf3728abe848888

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103137

--- Comment #11 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:5c293d9abc4b14e987a574fc11666809a2b8b8da

commit r11-10107-g5c293d9abc4b14e987a574fc11666809a2b8b8da
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.c (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/103693] [12/13 Regression] ICE in gfc_array_dimen_size(): Bad EXPR_ARRAY expr since r12-4967-gbcf3728abe848888

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103693

--- Comment #6 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:5c293d9abc4b14e987a574fc11666809a2b8b8da

commit r11-10107-g5c293d9abc4b14e987a574fc11666809a2b8b8da
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.c (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/106121] ICE in gfc_simplify_extends_type_of, at fortran/simplify.cc:3109

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106121

--- Comment #9 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:19f6e8ddfc447ac3b6198ab4b0176323e75a65cc

commit r11-10106-g19f6e8ddfc447ac3b6198ab4b0176323e75a65cc
Author: Harald Anlauf 
Date:   Tue Jun 28 22:29:28 2022 +0200

Fortran: improve error recovery for EXTENDS_TYPE_OF() [PR106121]

gcc/fortran/ChangeLog:

PR fortran/106121
* simplify.c (gfc_simplify_extends_type_of): Do not attempt to
simplify when one of the arguments is a CLASS variable that was
not properly declared.

gcc/testsuite/ChangeLog:

PR fortran/106121
* gfortran.dg/extends_type_of_4.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit b8f284d3673004dffae714b56ed663467c2a52a7)

[Bug analyzer/106000] RFE: -fanalyzer should complain about memory accesses that are definitely out-of-bounds

2022-07-03 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106000

--- Comment #5 from David Malcolm  ---
Consider also:

   write (fd, "hello world", 200);

where the write call is definitely going to access beyond the string literal.

[Bug fortran/103693] [12/13 Regression] ICE in gfc_array_dimen_size(): Bad EXPR_ARRAY expr since r12-4967-gbcf3728abe848888

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103693

--- Comment #5 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Harald Anlauf
:

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

commit r12-8544-gd870ce1a112c0cbdff6172346a4a164503d92573
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.cc (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/105243] ICE in next_char, at fortran/io.cc:160

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105243

--- Comment #13 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Harald Anlauf
:

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

commit r12-8544-gd870ce1a112c0cbdff6172346a4a164503d92573
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.cc (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/103137] [12/13 Regression] ICE in gfc_simplify_transpose, at fortran/simplify.c:8181 since r12-4967-gbcf3728abe848888

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103137

--- Comment #10 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Harald Anlauf
:

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

commit r12-8544-gd870ce1a112c0cbdff6172346a4a164503d92573
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.cc (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/103138] [12/13 Regression] ICE in gfc_simplify_cshift, at fortran/simplify.c:2139 since r12-4967-gbcf3728abe848888

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103138

--- Comment #9 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Harald Anlauf
:

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

commit r12-8544-gd870ce1a112c0cbdff6172346a4a164503d92573
Author: Harald Anlauf 
Date:   Wed Jun 29 21:36:17 2022 +0200

Fortran: error recovery on invalid CLASS(), PARAMETER declarations
[PR105243]

gcc/fortran/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* decl.cc (gfc_match_data_decl): Reject CLASS entity declaration
when it is given the PARAMETER attribute.

gcc/testsuite/ChangeLog:

PR fortran/103137
PR fortran/103138
PR fortran/103693
PR fortran/105243
* gfortran.dg/class_58.f90: Fix test.
* gfortran.dg/class_73.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit 4c233cabbe388a6b8957c1507e129090e9267ceb)

[Bug fortran/106121] ICE in gfc_simplify_extends_type_of, at fortran/simplify.cc:3109

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106121

--- Comment #8 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Harald Anlauf
:

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

commit r12-8543-gcf12a703cf7af34d91a6346883600caac2156e6e
Author: Harald Anlauf 
Date:   Tue Jun 28 22:29:28 2022 +0200

Fortran: improve error recovery for EXTENDS_TYPE_OF() [PR106121]

gcc/fortran/ChangeLog:

PR fortran/106121
* simplify.cc (gfc_simplify_extends_type_of): Do not attempt to
simplify when one of the arguments is a CLASS variable that was
not properly declared.

gcc/testsuite/ChangeLog:

PR fortran/106121
* gfortran.dg/extends_type_of_4.f90: New test.

Co-authored-by: Steven G. Kargl 
(cherry picked from commit b8f284d3673004dffae714b56ed663467c2a52a7)

[Bug libstdc++/106175] std::prev and next should check for equality with std::begin

2022-07-03 Thread deco33000 at yandex dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106175

KL  changed:

   What|Removed |Added

 Resolution|WORKSFORME  |---
 Status|RESOLVED|UNCONFIRMED

--- Comment #6 from KL  ---
And this is not a normal situation for a language that aims to be safer.

[Bug libstdc++/106175] std::prev and next should check for equality with std::begin

2022-07-03 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106175

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #5 from Andrew Pinski  ---
> A segfault here is not acceptable for a language like C++.

Well no. This is how the language is defined. It is undefined which means you
should have a check before.

[Bug libstdc++/106175] std::prev and next should check for equality with std::begin

2022-07-03 Thread deco33000 at yandex dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106175

KL  changed:

   What|Removed |Added

 Resolution|WORKSFORME  |---
 Status|RESOLVED|UNCONFIRMED

--- Comment #4 from KL  ---
it is not resolved as is

[Bug libstdc++/106175] std::prev and next should check for equality with std::begin

2022-07-03 Thread deco33000 at yandex dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106175

--- Comment #3 from KL  ---
Please note, that comparison should only occur when you use next, prev or
advance.
It is useless for normal operations using end() directly. So no cost here.

[Bug libstdc++/106175] std::prev and next should check for equality with std::begin

2022-07-03 Thread deco33000 at yandex dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106175

--- Comment #2 from KL  ---
During the parsing stage, the compiler has this information.

It knows that we want the end of v.
So it can inject a comparison into the resulting code.

A segfault here is not acceptable for a language like C++. There is no trap for
the compiler here.

That comparison is cheap.

[Bug libstdc++/106175] std::prev and next should check for equality with std::begin

2022-07-03 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106175

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WORKSFORME

--- Comment #1 from Jonathan Wakely  ---
How do you get the begin iterator from another iterator? That's impossible in
general. The std::prev function has no access to the vector, it can't call
begin on it.

For the debug mode, we already abort when you use prev on the begin iterator:


In function:
gnu_debug::_Safe_iterator<_Iterator, _Sequence, 
std::random_access_iterator_tag>& gnu_debug::_Safe_iterator<_Iterator, 
_Sequence, std::random_access_iterator_tag>::operator+=(difference_type) 
[with _Iterator = gnu_cxx::normal_iterator > >; _Sequence = std::debug::vector; 
difference_type = long int]

Error: attempt to advance a past-the-end iterator -1 steps, which falls 
outside its valid range.

Objects involved in the operation:
iterator @ 0x7fff987ee7a0 {
  type = gnu_cxx::normal_iterator > > (mutable iterator);
  state = past-the-end;
  references sequence with type 'std::debug::vector >' @ 0x7fff987ee730
}

[Bug target/106022] [12/13 Regression] Enable vectorizer generates extra load

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106022

--- Comment #18 from CVS Commits  ---
The master branch has been updated by H.J. Lu :

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

commit r13-1415-gf3a5e75cb66dc96efca7d494fe6060746c88acb1
Author: H.J. Lu 
Date:   Fri Jun 17 17:02:05 2022 -0700

x86: Support 2/4/8 byte constant vector stores

1. Add a predicate for constant vectors which can be converted to integer
constants suitable for constant integer stores.  For a 8-byte constant
vector, the converted 64-bit integer must be valid for store with 64-bit
immediate, which is a 64-bit integer sign-extended from a 32-bit integer.
2. Add a new pattern to allow 2-byte, 4-byte and 8-byte constant vector
stores, like

(set (mem:V2HI (reg:DI 84))
 (const_vector:V2HI [(const_int 0 [0]) (const_int 1 [0x1])]))

3. After reload, convert constant vector stores to constant integer
stores, like

(set (mem:SI (reg:DI 5 di [84]))
 (const_int 65536 [0x1]))

For

void
foo (short * c)
{
  c[0] = 0;
  c[1] = 1;
}

it generates

movl$65536, (%rdi)

instead of

movl.LC0(%rip), %eax
movl%eax, (%rdi)

gcc/

PR target/106022
* config/i386/i386-protos.h (ix86_convert_const_vector_to_integer):
New.
* config/i386/i386.cc (ix86_convert_const_vector_to_integer):
New.
* config/i386/mmx.md (V_16_32_64): New.
(*mov_imm): New patterns for stores with 16-bit, 32-bit
and 64-bit constant vector.
* config/i386/predicates.md (x86_64_const_vector_operand): New.

gcc/testsuite/

PR target/106022
* gcc.target/i386/pr106022-1.c: New test.
* gcc.target/i386/pr106022-2.c: Likewise.
* gcc.target/i386/pr106022-3.c: Likewise.
* gcc.target/i386/pr106022-4.c: Likewise.

[Bug libstdc++/106175] New: std::prev and next should check for equality with std::begin

2022-07-03 Thread deco33000 at yandex dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106175

Bug ID: 106175
   Summary: std::prev and next should check for equality with
std::begin
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: deco33000 at yandex dot com
  Target Milestone: ---

Hi,

To get better defined algorithms, we should not have a segfault in that case:

int main() 
{
std::vector v;

// if (v.empty()) {return;}; <- should not need that line

for (auto i = begin(v); i != prev(end(v)); i += 1){

std::cout << *i << std::endl;

} 

return 0;

}

std::prev should always check for equality with begin() or empty() for its
argument.
If equal, do nothing to the iterator. The loop won't be entered.

Same for std::next, and by extension std::advance.

if we need to do specific actions in case the vector is empty, that is an
opt-in decision.

There may be some good counter arguments but I don't see them..

[Bug c++/106174] New: c++20: compilation fails erroneously with "deallocation of already deallocated storage"

2022-07-03 Thread janpmoeller at gmx dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106174

Bug ID: 106174
   Summary: c++20: compilation fails erroneously with
"deallocation of already deallocated storage"
   Product: gcc
   Version: 12.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: janpmoeller at gmx dot de
  Target Milestone: ---

The following c++20 source fails to compile on gcc 12.1 and current trunk:


#include 
#include 

struct test_vector
{
constexpr ~test_vector() noexcept
{
m_allocator.deallocate(m_begin, m_capacity);
}

constexpr test_vector(std::size_t n)
: m_begin(m_allocator.allocate(n))
, m_capacity(n)
{
}

constexpr test_vector(test_vector const& other)
: test_vector(other.m_capacity)
{
}

constexpr test_vector() = delete;
constexpr test_vector(test_vector&& other) noexcept = delete;
constexpr auto operator=(test_vector const& other) -> test_vector& =
delete;
constexpr auto operator=(test_vector&& other) noexcept -> test_vector& =
delete;

std::allocator m_allocator{};
int*m_begin;
std::size_t m_capacity;
};

static_assert( // This fails with "deallocation of already deallocated storage"
[]
{
std::array const values{test_vector(42)};
std::array const copy = values;
return true;
}());


The compiler outputs:
:46:6: error: non-constant condition for static assertion
   41 | []
  | ~~
   42 | {
  | ~ 
   43 | std::array const values{test_vector(42)};
  | ~
   44 | std::array const copy = values;
  | ~~~
   45 | return true;
  | 
   46 | }());
  | ~^~
In file included from
/opt/compiler-explorer/gcc-trunk-20220703/include/c++/13.0.0/memory:64,
 from :2:
:46:6:   in 'constexpr' expansion of '().()'
:46:5:   in 'constexpr' expansion of '((std::array*)(&
copy))->std::array::~array()'
/opt/compiler-explorer/gcc-trunk-20220703/include/c++/13.0.0/array:94:12:   in
'constexpr' expansion of '->test_vector::~test_vector()'
:8:31:   in 'constexpr' expansion of
'((test_vector*)this)->test_vector::m_allocator.std::allocator::deallocate(((test_vector*)this)->test_vector::m_begin,
((test_vector*)this)->test_vector::m_capacity)'
/opt/compiler-explorer/gcc-trunk-20220703/include/c++/13.0.0/bits/allocator.h:202:30:
error: deallocation of already deallocated storage
  202 | ::operator delete(__p);
  | ~^
Compiler returned: 1


Weirdly, the usage of std::array seems to be important here. I was unable to
reproduce this without the std::array. For example, the following variants
compile just fine:

// 1) This is accepted
test_vector const values(42);
test_vector const copy = values;

// 2) This is accepted
test_vector const values(42);
std::array const copy = {values};

// 3) This is accepted
std::array const values{test_vector(42)};
test_vector const copy = values[0];

The above test case is also available on compiler explorer:
https://godbolt.org/z/6xvx4fx6E

[Bug target/106122] [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 since r12-6106-gef26c151c14a8717

2022-07-03 Thread roger at nextmovesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106122

Roger Sayle  changed:

   What|Removed |Added

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

--- Comment #5 from Roger Sayle  ---
This should now be fixed on both mainline and the gcc12 release branch.

[Bug target/106122] [12/13 Regression] ICE in fixup_args_size_notes, at expr.cc:4493 since r12-6106-gef26c151c14a8717

2022-07-03 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106122

--- Comment #4 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Roger Sayle :

https://gcc.gnu.org/g:55899e33de74082521708a58fdc79510e0c5efad

commit r12-8542-g55899e33de74082521708a58fdc79510e0c5efad
Author: Roger Sayle 
Date:   Sun Jul 3 14:01:17 2022 +0100

PR target/106122: Don't update %esp via the stack with -Oz on x86.

When optimizing for size with -Oz, setting a register can be minimized by
pushing an immediate value to the stack and popping it to the destination.
Alas the one general register that shouldn't be updated via the stack is
the stack pointer itself, where "pop %esp" can't be represented in GCC's
RTL ("use of a register mentioned in pre_inc, pre_dec, post_inc or
post_dec is not permitted within the same instruction").  This patch
fixes PR target/106122 by explicitly checking for SP_REG in the
problematic peephole2.

2022-07-O3  Roger Sayle  

gcc/ChangeLog
PR target/106122
* config/i386/i386.md (peephole2): Avoid generating pop %esp
when optimizing for size.

gcc/testsuite/ChangeLog
PR target/106122
* gcc.target/i386/pr106122.c: New test case.

[Bug c/106173] New: -fleading-underscore option inactive although reported as active

2022-07-03 Thread mcn at onet dot pl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106173

Bug ID: 106173
   Summary: -fleading-underscore option inactive although reported
as active
   Product: gcc
   Version: og10 (devel/omp/gcc-10)
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mcn at onet dot pl
  Target Milestone: ---

Compiling a sample C program test.c

#include 

int main()
{
puts("TEST");
return 0;
}

with gcc 10.2.1 (on Debian GNU/Linux running on WSL 2) with default options
(gcc test.c) works fine, but adding -fleading-underscore option produces an
error:

gcc -fleading-underscore test.c
/usr/bin/ld:
/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o: in function
`_start':
(.text+0x20): undefined reference to `main'
/usr/bin/ld: /tmp/cc8SXM3o.o: in function `_main':
test.c:(.text+0xc): undefined reference to `_puts'
collect2: error: ld returned 1 exit status

Interestingly, gcc -Q -V test.c shows -fleading-underscore among enabled
options.

$ gcc -Q -v test.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6'
--with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr
--with-gcc-major-version-only --program-suffix=-10
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib
--enable-libphobos-checking=release --with-target-system-zlib=auto
--enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic
--enable-offload-targets=nvptx-none=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-10-Km9U7s/gcc-10-10.2.1/debian/tmp-gcn/usr,hsa
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
--with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20210110 (Debian 10.2.1-6)
COLLECT_GCC_OPTIONS='-Q' '-v' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/10/cc1 -v -imultiarch x86_64-linux-gnu test.c
-dumpbase test.c -mtune=generic -march=x86-64 -auxbase test -version
-fasynchronous-unwind-tables -o /tmp/ccFkJ2ej.s
GNU C17 (Debian 10.2.1-6) version 10.2.1 20210110 (x86_64-linux-gnu)
compiled by GNU C version 10.2.1 20210110, GMP version 6.2.1, MPFR
version 4.1.0, MPC version 1.2.0, isl version isl-0.23-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/10/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/10/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C17 (Debian 10.2.1-6) version 10.2.1 20210110 (x86_64-linux-gnu)
compiled by GNU C version 10.2.1 20210110, GMP version 6.2.1, MPFR
version 4.1.0, MPC version 1.2.0, isl version isl-0.23-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
options passed:  -v -imultiarch x86_64-linux-gnu test.c -mtune=generic
 -march=x86-64 -fasynchronous-unwind-tables
options enabled:  -fPIC -fPIE -faggressive-loop-optimizations
 -fallocation-dce -fasynchronous-unwind-tables -fauto-inc-dec
 -fdelete-null-pointer-checks -fdwarf2-cfi-asm -fearly-inlining
 -feliminate-unused-debug-symbols -feliminate-unused-debug-types
 -ffp-int-builtin-inexact -ffunction-cse -fgcse-lm -fgnu-unique -fident
 -finline-atomics -fipa-stack-alignment -fira-hoist-pressure
 -fira-share-save-slots -fira-share-spill-slots -fivopts
 -fkeep-static-consts -fleading-underscore -flifetime-dse -fmath-errno
 -fmerge-debug-strings -fpeephole -fplt -fprefetch-loop-arrays
 -freg-struct-return -fsched-critical-path-heuristic
 -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
 -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
 -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fschedule-fusion
 -fsemantic-interposition -fshow-column -fshrink-wrap-separate

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #12 from Chris Clayton  ---
I've just run the build again with gcc-11-20220701 and get the same set of
ICEs. I've kept the files of diagnostics output by gcc and can provide them id
they will be helpful.

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #11 from Chris Clayton  ---
On 03/07/2022 12:00, sch...@linux-m68k.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172
> 
> --- Comment #10 from Andreas Schwab  ---
> How did you build the bootstrap compiler?
> 

I assume that by bootstrap compiler you mean xgcc/xg++. If not, what is it?

In any case, I didn't do anything in particular. As I understand it, the
bootstrap compiler is built as an early step of
the gcc build system so it will have been built with gcc-12-20220702.

[Bug tree-optimization/106171] wrong code at -O1 and above on x86_64-linux-gnu

2022-07-03 Thread zhendong.su at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171

--- Comment #7 from Zhendong Su  ---
(In reply to Jakub Jelinek from comment #5)
> And -O1 -Wall warns:
> pr106171.c: In function ‘c’:
> pr106171.c:10:15: warning: ‘e[0]’ is used uninitialized [-Wuninitialized]
>10 |   return e[0];
>   |  ~^~~
> pr106171.c:6:9: note: ‘e’ declared here
> 6 | int e[2];
>   | ^

Ah, this is quite clever of GCC :)
Clang fails to detect and warn about it.
CompCert lifts "int e[2]" to the same scope as "int d", thus also misses the
UB.

[Bug tree-optimization/106171] wrong code at -O1 and above on x86_64-linux-gnu

2022-07-03 Thread zhendong.su at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171

Zhendong Su  changed:

   What|Removed |Added

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

--- Comment #6 from Zhendong Su  ---
The test has UB.

[Bug tree-optimization/106171] wrong code at -O1 and above on x86_64-linux-gnu

2022-07-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171

--- Comment #5 from Jakub Jelinek  ---
And -O1 -Wall warns:
pr106171.c: In function ‘c’:
pr106171.c:10:15: warning: ‘e[0]’ is used uninitialized [-Wuninitialized]
   10 |   return e[0];
  |  ~^~~
pr106171.c:6:9: note: ‘e’ declared here
6 | int e[2];
  | ^

[Bug tree-optimization/106171] wrong code at -O1 and above on x86_64-linux-gnu

2022-07-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171

--- Comment #4 from Jakub Jelinek  ---
We don't have uninitialized memory sanitizer.
-fsanitize-address-use-after-scope doesn't trigger because it is use in scope,
just not initialized there.

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread schwab--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #10 from Andreas Schwab  ---
How did you build the bootstrap compiler?

[Bug tree-optimization/106171] wrong code at -O1 and above on x86_64-linux-gnu

2022-07-03 Thread zhendong.su at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171

--- Comment #3 from Zhendong Su  ---
Yes, you're right, Jakub.

Then, it's a false negative for the sanitizers.

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #9 from Chris Clayton  ---
Created attachment 53255
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53255=edit
Error messages output to terminal

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #8 from Chris Clayton  ---
Created attachment 53254
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53254=edit
GCC diagnostics file 9

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #7 from Chris Clayton  ---
Created attachment 53253
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53253=edit
GCC diagnostics file 8

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #6 from Chris Clayton  ---
Created attachment 53252
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53252=edit
GCC diagnostics file 7

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #5 from Chris Clayton  ---
Created attachment 53251
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53251=edit
GCC diagnostics file 6

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #4 from Chris Clayton  ---
Created attachment 53250
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53250=edit
GCC diagnostics file 5

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #3 from Chris Clayton  ---
Created attachment 53249
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53249=edit
GCC diagnostics file 4

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #2 from Chris Clayton  ---
Created attachment 53248
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53248=edit
GCC diagnostics file 3

[Bug c/106172] Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

--- Comment #1 from Chris Clayton  ---
Created attachment 53247
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53247=edit
GCC diagnostics file 2

[Bug c/106172] New: Multiple ICEs building gcc-13 with gcc-12

2022-07-03 Thread chris2553 at googlemail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106172

Bug ID: 106172
   Summary: Multiple ICEs building gcc-13 with gcc-12
   Product: gcc
   Version: 12.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: chris2553 at googlemail dot com
  Target Milestone: ---

Created attachment 53246
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53246=edit
GCC diagnostics file 1

I'm trying to build the gcc-13-20220626 snapshot with the gcc-12-20220702
snapshot but get multiple ICEs. I got the same (or similar) bunch of ICE's last
week trying to build gcc-13-20220626 with gcc-12-20220625, but didn't have time
to get the diagnostics and report it last week)

I've run the build again with the recommended -freport-bug added to CFLAGSand
the files saved to /tmp/ are attached as is a file containing the text splat on
the console when the ICEs happened.

[Bug tree-optimization/106171] wrong code at -O1 and above on x86_64-linux-gnu

2022-07-03 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Isn't that UB?  Both e[0] and e[1] initialized in the first loop when d == 0,
but not used there, then e goes out of scope, in the d == 1 iteration e is
uninitialized, nothing initializes it and e[0] is returned.

[Bug tree-optimization/106171] wrong code at -O1 and above on x86_64-linux-gnu

2022-07-03 Thread zhendong.su at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171

--- Comment #1 from Zhendong Su  ---
Compiler Explorer: https://godbolt.org/z/eEhKn8x9T

[Bug tree-optimization/106171] New: wrong code at -O1 and above on x86_64-linux-gnu

2022-07-03 Thread zhendong.su at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106171

Bug ID: 106171
   Summary: wrong code at -O1 and above 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: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

It appears to be quite long-latent, and affects all versions 7.* and later. 

[560] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-sanitizers
--enable-languages=c,c++ --disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.0 20220703 (experimental) [master r13-1411-ga26f3eb2683] (GCC) 
[561] % 
[561] % gcctk -O0 small.c; ./a.out
1
[562] % gcctk -O1 small.c; ./a.out
0
[563] % gcctk -Os small.c; ./a.out
-2089837456
[564] % gcctk -O2 small.c; ./a.out
0
[565] % gcctk -O3 small.c; ./a.out
0
[566] % 
[566] % cat small.c
int printf(const char *, ...);
int a, b;
int c() {
  int d = 0;
  for (; d < 2; d++) {
int e[2];
for (; b < 2; b++)
  e[b] = 1;
if (d)
  return e[0];
  }
  return 0;
}
int main() {
  a = c();
  printf("%d\n", a);
  return 0;
}

[Bug lto/106170] x86_64-w64-mingw32 host GCC with win32 thread model does not provide pthread.h. lto-plugin fails with canadian compilation

2022-07-03 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106170

cqwrteur  changed:

   What|Removed |Added

  Attachment #53244|0   |1
is obsolete||

--- Comment #5 from cqwrteur  ---
Created attachment 53245
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53245=edit
Patch by manually copying autoconf. better use autoreconf

pthread_mutex_lock and pthread_mutex_unlock can fail. Better just let the
program crash if they fail.

[Bug lto/106170] x86_64-w64-mingw32 host GCC with win32 thread model does not provide pthread.h. lto-plugin fails with canadian compilation

2022-07-03 Thread unlvsur at live dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106170

cqwrteur  changed:

   What|Removed |Added

  Attachment #53243|0   |1
is obsolete||

--- Comment #4 from cqwrteur  ---
Created attachment 53244
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53244=edit
My patch without autoreconf. Please run autoreconf by yourself

I have just fixed them, but need to run autoreconf by yourself.

BTW. -lpthread -pthread lpthreads whatever i remember they all exist.

Plus win32 does not need -lpthread anymore since it uses win32 CriticalSection
api.