[Bug rtl-optimization/101594] ICE: Segmentation fault with "-O2 -fno-if-conversion -fno-ssa-phiopt -fno-tree-ch -fno-tree-dominator-opts -fno-tree-pre -fno-tree-reassoc -fselective-scheduling -fschedu

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101594

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=97972

--- Comment #2 from Andrew Pinski  ---
Most likely related to PR 97972.

[Bug tree-optimization/101594] ICE: Segmentation fault with "-O2 -fno-if-conversion -fno-ssa-phiopt -fno-tree-ch -fno-tree-dominator-opts -fno-tree-pre -fno-tree-reassoc -fselective-scheduling -fsched

2021-07-22 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101594

Martin Liška  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 CC||marxin at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-07-23

--- Comment #1 from Martin Liška  ---
Confirmed, it's quite old (5.1.0).

[Bug driver/101546] Sporadic issue during compiling a code with a '--save-temps' option

2021-07-22 Thread stanislav.simek at siemens dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101546

--- Comment #4 from Stanislav Šimek  ---
Hi this is copy paste mistake, we are using same compile comands for 11.1.0 and
10.2.

Correct one
Command Line: mips_gcc_sde_elf_11.1.0/bin/mips-sde-elf-gcc-O0 -Wunused
> -Wreturn-type -Wundef -fno-common -fno-merge-constants -g  -UNDEBUG 
> -save-temps=obj  -IAAA/FolderA-fno-builtin -c -std=gnu99 -nostdinc -G0
> -mips32r2 -EL -fdata-sections -ffunction-sections-MD -MF tlb.d -o tlb.o
> tlb.c 
> 
> Second command
> Command Line: mips_gcc_sde_elf_11.1.0/bin/mips-sde-elf-gcc-O0 -Wunused
> -Wreturn-type -Wundef -fno-common -fno-merge-constants -g  -UNDEBUG 
> -save-temps=obj  -IAAA/FolderA-fno-builtin -c -std=gnu99 -nostdinc -G0
> -mips32r2 -EL -fdata-sections -ffunction-sections-MD -MF tlba.d -o
> tlba.o tlba.c



-V command
Using built-in specs.
COLLECT_GCC=D:\git\s7p.cpu1500_1\s7p.tools\mips_gcc_sde_elf_11.1.0\bin\mips-sde-elf-gcc
Target: mips-sde-elf
Configured with: ../../gcc-11.1.0//configure --host=x86_64-w64-mingw32
--build=x86_64-w64-mingw32
--prefix=/build/mips-sde-elf_11.1.0/cross-gcc/mips-sde-elf
--target=mips-sde-elf --disable-nls --enable-multilib
--enable-poison-system-directories --enable-languages=c,c++
--disable-decimal-float --with-mips-plt
--with-sysroot=/build/mips-sde-elf_11.1.0/cross-gcc/mips-sde-elf
--without-headers --disable-shared --disable-threads --disable-lto
--disable-libmudflap --disable-libssp --disable-libgomp --disable-libffi
--disable-libstdcxx-pch --disable-win32-registry
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
--with-newlib --with-gcc --with-gnu-as --with-gnu-ld --with-arch=mips32r2
--enable-sgxx-sde-multilibs --with-gmp=/build/mips-sde-elf_11.1.0/host
--with-mpfr=/build/mips-sde-elf_11.1.0/host
--with-mpc=/build/mips-sde-elf_11.1.0/host
--with-isl=/build/mips-sde-elf_11.1.0/host
--with-zstd=/build/mips-sde-elf_11.1.0/host : (reconfigured)
../../gcc-11.1.0//configure --host=x86_64-w64-mingw32
--build=x86_64-w64-mingw32 --enable-languages=c,c++ --enable-multilib
--with-mips-plt --enable-sgxx-sde-multilibs --with-arch=mips32r2
--enable-poison-system-directories --enable-interwork --disable-lto
--disable-libmudflap --disable-libssp --disable-libgomp --disable-libffi
--with-newlib --with-gcc --with-gnu-ld --with-gnu-as --with-stabs
--disable-shared --disable-threads --disable-win32-registry --disable-nls
--disable-libstdcxx-pch --with-host-libstdcxx='-static-libgcc
-Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --target=mips-sde-elf
--prefix=/build/mips-sde-elf_11.1.0/cross-gcc/mips-sde-elf
--with-gmp=/build/mips-sde-elf_11.1.0/host
--with-mpfr=/build/mips-sde-elf_11.1.0/host
--with-mpc=/build/mips-sde-elf_11.1.0/host
--with-isl=/build/mips-sde-elf_11.1.0/host
--with-zstd=/build/mips-sde-elf_11.1.0/host
--with-sysroot=/build/mips-sde-elf_11.1.0/cross-gcc/mips-sde-elf
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 11.1.0 (GCC) 
COLLECT_GCC_OPTIONS= -I###INCLUDEPATHS### '-O3' '-Wunused' '-Wreturn-type'
'-Wundef' '-fno-common' '-fno-merge-constants' '-ffunction-sections'
'-fdata-sections' '-g' '-U' 'NDEBUG' '-save-temps=obj' '-fno-builtin'
'-mlong-calls' '-c' '-std=gnu99' '-nostdinc' '-G' '0' '-mips32r2' '-EL' '-v'
'-o' '/abc.o' '-mplt' '-mabi=32' '-dumpdir' ''
 mips_gcc_sde_elf_11.1.0/bin/../libexec/gcc/mips-sde-elf/11.1.0/cc1.exe -E
-quiet -nostdinc -v @/.args.0 -imultilib el -iprefix
\mips_gcc_sde_elf_11.1.0\bin\../lib/gcc/mips-sde-elf/11.1.0/ /abc.c -G 0
-mel -mlong-calls -mips32r2 -mplt -mabi=32 -std=gnu99 -Wunused -Wreturn-type
-Wundef -fno-common -fno-merge-constants -ffunction-sections -fdata-sections
-fno-builtin -g -fworking-directory -O3 -fpch-preprocess -o /abc.i
#include "..." search starts here:
#include <...> search starts here:
 s7p.os_infra/adonis/arch/mips/soc12

[Bug tree-optimization/101594] New: ICE: Segmentation fault with "-O2 -fno-if-conversion -fno-ssa-phiopt -fno-tree-ch -fno-tree-dominator-opts -fno-tree-pre -fno-tree-reassoc -fselective-scheduling -f

2021-07-22 Thread suochenyao at 163 dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101594

Bug ID: 101594
   Summary: ICE: Segmentation fault with "-O2 -fno-if-conversion
-fno-ssa-phiopt -fno-tree-ch -fno-tree-dominator-opts
-fno-tree-pre -fno-tree-reassoc -fselective-scheduling
-fschedule-insns -fvar-tracking-assignments"
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: suochenyao at 163 dot com
  Target Milestone: ---

***
OS and Platform:
CentOS Linux release 7.8.2003 (Core), x86_64 GNU/Linux
***
Program:
long a;
int b, c;
char *d;
char(e)(f) { return f; }
void g() {
  char h;
  for (; a;) {
h = e(c || b);
*d = h;
  }
}
int main() {}
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/data/bin/gcc-dev/bin/gcc
COLLECT_LTO_WRAPPER=/data/bin/gcc-dev/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/data/bin/gcc-dev --disable-multilib
--enable-languages=c,c++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210722 (experimental) (GCC)

git version 4048d8a08621820dd6cc6035e13de3c3c82af4a5
***
$ gcc -O2 -fno-if-conversion -fno-ssa-phiopt -fno-tree-ch
-fno-tree-dominator-opts -fno-tree-pre -fno-tree-reassoc -fselective-scheduling
-fschedule-insns -fvar-tracking-assignments a.c
cc1: warning: var-tracking-assignments changes selective scheduling
a.c: In function ‘e’:
a.c:4:6: warning: type of ‘f’ defaults to ‘int’ [-Wimplicit-int]
4 | char(e)(f) { return f; }
  |  ^
during RTL pass: sched1
a.c: In function ‘g’:
a.c:11:1: internal compiler error: Segmentation fault
   11 | }
  | ^
0xe4483f crash_signal
../../gcc/toplev.c:328
0xe0369a moving_insn_creates_bookkeeping_block_p
../../gcc/sel-sched.c:2031
0xe0369a moveup_expr
../../gcc/sel-sched.c:2199
0xe0369a moveup_expr_cached
../../gcc/sel-sched.c:2544
0xe0649e move_op_ascend
../../gcc/sel-sched.c:6149
0xe0865f code_motion_path_driver
../../gcc/sel-sched.c:6648
0xe08cf3 code_motion_process_successors
../../gcc/sel-sched.c:6342
0xe08cf3 code_motion_path_driver
../../gcc/sel-sched.c:6608
0xe08cf3 code_motion_process_successors
../../gcc/sel-sched.c:6342
0xe08cf3 code_motion_path_driver
../../gcc/sel-sched.c:6608
0xe09219 move_op
../../gcc/sel-sched.c:6702
0xe09219 move_exprs_to_boundary
../../gcc/sel-sched.c:5223
0xe09219 schedule_expr_on_boundary
../../gcc/sel-sched.c:5436
0xe0c756 fill_insns
../../gcc/sel-sched.c:5578
0xe0c756 schedule_on_fences
../../gcc/sel-sched.c:7353
0xe0c756 sel_sched_region_2
../../gcc/sel-sched.c:7491
0xe0e248 sel_sched_region_1
../../gcc/sel-sched.c:7533
0xe0f85b sel_sched_region(int)
../../gcc/sel-sched.c:7634
0xe0f85b sel_sched_region(int)
../../gcc/sel-sched.c:7619
0xe0fa09 run_selective_scheduling()
../../gcc/sel-sched.c:7720
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug target/101593] New: mips: operands missing mode

2021-07-22 Thread xry111 at mengyan1223 dot wang via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101593

Bug ID: 101593
   Summary: mips: operands missing mode
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: xry111 at mengyan1223 dot wang
  Target Milestone: ---

../../gcc/gcc/config/mips/mips.md:5610:1: warning: source missing a mode?
../../gcc/gcc/config/mips/mips.md:5610:1: warning: source missing a mode?
../../gcc/gcc/config/mips/mips.md:6923:1: warning: operand 0 missing mode?
../../gcc/gcc/config/mips/mips.md:6943:1: warning: operand 1 missing mode?
../../gcc/gcc/config/mips/mips.md:6952:1: warning: operand 1 missing mode?
../../gcc/gcc/config/mips/mips.md:7011:1: warning: operand 0 missing mode?
../../gcc/gcc/config/mips/mips.md:7028:1: warning: operand 0 missing mode?
../../gcc/gcc/config/mips/mips.md:7085:1: warning: operand 1 missing mode?
../../gcc/gcc/config/mips/mips.md:7105:1: warning: operand 1 missing mode?
../../gcc/gcc/config/mips/mips.md:7151:1: warning: operand 1 missing mode?
../../gcc/gcc/config/mips/mips.md:7174:1: warning: operand 1 missing mode?
../../gcc/gcc/config/mips/mips.md:7457:1: warning: operand 0 missing mode?
../../gcc/gcc/config/mips/mips.md:7470:1: warning: operand 0 missing mode?
../../gcc/gcc/config/mips/mips-msa.md:2488:1: warning: operand 2 missing mode?
../../gcc/gcc/config/mips/mips-msa.md:2488:1: warning: operand 2 missing mode?
../../gcc/gcc/config/mips/mips-msa.md:2488:1: warning: operand 2 missing mode?
../../gcc/gcc/config/mips/mips-msa.md:2488:1: warning: operand 2 missing mode?

[Bug c++/101592] New: ICE in wide_int_to_tree, at tree.c:1427

2021-07-22 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101592

Bug ID: 101592
   Summary: ICE in wide_int_to_tree, at tree.c:1427
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

The following ICEs:

$ g++ /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp0x/nullptr46.C
-Wlogical-op
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp0x/nullptr46.C: In
function ‘bool bar()’:
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/cpp0x/nullptr46.C:10:39:
internal compiler error: in wide_int_to_tree_1, at tree.c:1716
   10 |   return foo () > nullptr || foo () < nullptr;
  |   ^~~
0x89bab5 wide_int_to_tree_1
/home/marxin/Programming/gcc/gcc/tree.c:1716
0x14a4510 build_int_cst(tree_node*, poly_int<1u, long>)
/home/marxin/Programming/gcc/gcc/tree.c:1505
0xe614aa range_successor
/home/marxin/Programming/gcc/gcc/fold-const.c:5510
0xe61a47 merge_ranges(int*, tree_node**, tree_node**, int, tree_node*,
tree_node*, int, tree_node*, tree_node*)
/home/marxin/Programming/gcc/gcc/fold-const.c:5646
0xe65345 make_range_step(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*, tree_node**, tree_node**, int*, bool*)
/home/marxin/Programming/gcc/gcc/fold-const.c:5047
0xe658fe make_range(tree_node*, int*, tree_node**, tree_node**, bool*)
/home/marxin/Programming/gcc/gcc/fold-const.c:5293
0xc842c2 warn_logical_operator(unsigned int, tree_code, tree_node*, tree_code,
tree_node*, tree_code, tree_node*)
/home/marxin/Programming/gcc/gcc/c-family/c-warn.c:265
0x984fa7 build_new_op_1
/home/marxin/Programming/gcc/gcc/cp/call.c:6730
0x9853d1 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
/home/marxin/Programming/gcc/gcc/cp/call.c:6806
0xbd614f build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node**, int)
/home/marxin/Programming/gcc/gcc/cp/typeck.c:4330
0xae8bc4 cp_parser_binary_expression
/home/marxin/Programming/gcc/gcc/cp/parser.c:10038
0xae93cc cp_parser_assignment_expression
/home/marxin/Programming/gcc/gcc/cp/parser.c:10176
0xaeaa6a cp_parser_expression
/home/marxin/Programming/gcc/gcc/cp/parser.c:10346
0xafa7c8 cp_parser_jump_statement
/home/marxin/Programming/gcc/gcc/cp/parser.c:13872
0xafa7c8 cp_parser_statement
/home/marxin/Programming/gcc/gcc/cp/parser.c:11950
0xafb4ae cp_parser_statement_seq_opt
/home/marxin/Programming/gcc/gcc/cp/parser.c:12433
0xafb5a0 cp_parser_compound_statement
/home/marxin/Programming/gcc/gcc/cp/parser.c:12382
0xb1a137 cp_parser_function_body
/home/marxin/Programming/gcc/gcc/cp/parser.c:24448
0xb1a137 cp_parser_ctor_initializer_opt_and_function_body
/home/marxin/Programming/gcc/gcc/cp/parser.c:24499
0xb1bdaa cp_parser_function_definition_after_declarator
/home/marxin/Programming/gcc/gcc/cp/parser.c:30572
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug middle-end/101586] ICE:in clear_padding_type, at gimple-fold.c:4783 with call to __builtin_clear_padding for C++

2021-07-22 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101586

Martin Liška  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-07-23
 Ever confirmed|0   |1

--- Comment #1 from Martin Liška  ---
Started with the introduction commit r11-5196-g1bea0d0aa5936cb3.

[Bug tree-optimization/101591] (a|b) ==/!= a -> (b & ~a) ==/!= 0 on gimple

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101591

--- Comment #3 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #2)
> Mine, something like:
> (for cmp (eq ne)
>  (simplify
>   (cmp:c (bit_ior @0 INTEGER_CST@1) @0)
>   (cmp:c (bit_and @1 (bit_not @0)) { build_zero_cst (TREE_TYPE(@0)); })))
> 
> Note

maybe a power of 2 integer constant might be better because is just a shift and
an and in the end.

[Bug tree-optimization/101591] (a|b) ==/!= a -> (b & ~a) ==/!= 0 on gimple

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101591

Andrew Pinski  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED
   Keywords||easyhack
   Last reconfirmed||2021-07-23

--- Comment #2 from Andrew Pinski  ---
Mine, something like:
(for cmp (eq ne)
 (simplify
  (cmp:c (bit_ior @0 INTEGER_CST@1) @0)
  (cmp:c (bit_and @1 (bit_not @0)) { build_zero_cst (TREE_TYPE(@0)); })))

Note

[Bug tree-optimization/96779] Failure to optimize comparison of negative version of self

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96779

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Keywords||easyhack
   Assignee|unassigned at gcc dot gnu.org  |pinskia at gcc dot 
gnu.org

--- Comment #2 from Andrew Pinski  ---
This is simple, I will take.
(for cmp (eq ne)
 (simplify
  (cmp:c @0 (negate @0))
   (if (ANY_INTEGRAL_TYPE_P (TREE_TYPE (@0)))
(cmp:c @0 { build_zero_cst (TREE_TYPE(@0)); })

Should be enough.

[Bug tree-optimization/101591] (a|b) ==/!= a -> (b & ~a) ==/!= 0 on gimple

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101591

--- Comment #1 from Andrew Pinski  ---
I noticed this while working on PR96779

[Bug tree-optimization/101591] New: (a|b) ==/!= a -> (b & ~a) ==/!= 0 on gimple

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101591

Bug ID: 101591
   Summary: (a|b) ==/!= a -> (b & ~a) ==/!= 0 on gimple
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
bool f(unsigned a, unsigned b)
{
return (a|b) == a;
}

This should be optimized to:
bool f(unsigned a, unsigned b)
{
return (b & ~a) ==/!= 0;
}

It might be only best if you we do for constant b's though.

[Bug libstdc++/101589] Incorrect implementation of LWG 3533 for elements_view

2021-07-22 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101589

Patrick Palka  changed:

   What|Removed |Added

   Target Milestone|--- |10.4
   Last reconfirmed||2021-07-23
 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |ppalka at gcc dot 
gnu.org
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Patrick Palka  ---
D'oh... mine.

We also need to apply LWG 3533 to lazy_split_view::_InnerIter, which I
overlooked in r12-1662.

[Bug tree-optimization/101590] New: (len & - N) <= len is not optimized to 1

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101590

Bug ID: 101590
   Summary: (len & - N) <= len is not optimized to 1
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: missed-optimization
  Severity: enhancement
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

#include 

const size_t N = 4;

bool foo(size_t len) {
size_t newlen = len & -N;
return newlen <= len;
}

[Bug tree-optimization/97529] Condition not constant folded

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97529

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-23
 CC||pinskia at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
   Severity|normal  |enhancement
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
Confirmed.

[Bug c++/68258] core 879 Missing built-in comparison operators for pointer types not supported

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68258

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=87699
   Target Milestone|--- |11.0
 Resolution|--- |FIXED

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 11 by r11-467:
* call.c (add_builtin_candidate) : Create candidate
operator functions when type is std::nullptr_t for ==/!=.

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

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
Bug 55004 depends on bug 69700, which changed state.

Bug 69700 Summary: [C++14] constexpr incorrectly implies const
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69700

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug c++/69700] [C++14] constexpr incorrectly implies const

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69700

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |7.0
 Blocks||55004

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 7.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
[Bug 55004] [meta-bug] constexpr issues

[Bug c++/71534] [C++11/14] Initializing a static constexpr data member of a base class by using a static constexpr data member of a derived class should be an error

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71534

Andrew Pinski  changed:

   What|Removed |Added

 Blocks||55004
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2021-07-23
 Ever confirmed|0   |1
Summary|Initializing a static   |[C++11/14] Initializing a
   |constexpr data member of a  |static constexpr data
   |base class by using a   |member of a base class by
   |static constexpr data   |using a static constexpr
   |member of a derived class   |data member of a derived
   |should be an error  |class should be an error

--- Comment #4 from Andrew Pinski  ---
Confirmed.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
[Bug 55004] [meta-bug] constexpr issues

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

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
Bug 55004 depends on bug 68985, which changed state.

Bug 68985 Summary: braced initializer bug when defining a static constexpr int 
within a class
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68985

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug c++/68985] braced initializer bug when defining a static constexpr int within a class

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68985

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Blocks||55004
 Resolution|--- |FIXED
   Target Milestone|--- |6.4

--- Comment #1 from Andrew Pinski  ---
Fixed in GCC 6.4.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55004
[Bug 55004] [meta-bug] constexpr issues

[Bug c++/101588] [DR2126] rejects valid constexpr when binding from a constexpr function and initializer_list

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101588

Andrew Pinski  changed:

   What|Removed |Added

Summary|rejects valid constexpr |[DR2126] rejects valid
   |when binding from a |constexpr when binding from
   |constexpr function and  |a constexpr function and
   |initializer_list|initializer_list
  Alias||DR2126

--- Comment #2 from Andrew Pinski  ---
GCC implements DR2126 mostly except when the type is intialized like: T{42} .

[Bug c++/101588] rejects valid constexpr when binding from a constexpr function and initializer_list

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101588

--- Comment #1 from Andrew Pinski  ---
Note clang was only fixed in clang 12.

[Bug c++/101589] New: Incorrect implementation of LWG 3533 for elements_view

2021-07-22 Thread ensadc at mailnesia dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101589

Bug ID: 101589
   Summary: Incorrect implementation of LWG 3533 for elements_view
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ensadc at mailnesia dot com
CC: ppalka at gcc dot gnu.org
  Target Milestone: ---

LWG 3533 changed the const& overload of `elements_view::iterator::base` to
return a const reference, but it seems that g:eb1aa9ad incorrectly applied the
change to `elements_view::base` (that is, the `base()` member of the *view*,
when it's supposed to change the member of the *iterator*).

[Bug c++/66287] [C++11] A constexpr variable of "const int* const&" cannot be initialized

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66287

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=101588
   Target Milestone|--- |7.0
 Resolution|--- |FIXED

--- Comment #2 from Andrew Pinski  ---
All have been fixed except for the last case which I filed as  PR101588 .

[Bug c++/101588] New: rejects valid constexpr when binding from a constexpr function

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101588

Bug ID: 101588
   Summary: rejects valid constexpr when binding from a constexpr
function
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: rejects-valid
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Split out from PR 66287.

Take:
struct T { int i; };
constexpr T copy(const T& v) { return v; }
constexpr const auto& r = T{42};
constexpr const auto& c = copy(r);
int main() {}
- CUT 
This should be accepted by GCC but currently is rejected:
:11:33: error: modification of '' is not a constant
expression
   11 | constexpr const auto& c = copy(r);
  | ^

[Bug libstdc++/101587] New: uninitialized_copy/move incorrectly uses std::min

2021-07-22 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101587

Bug ID: 101587
   Summary: uninitialized_copy/move incorrectly uses std::min
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: libstdc++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: hewillk at gmail dot com
  Target Milestone: ---

ranges_uninitialized.h#L269:

if constexpr (sized_sentinel_for<_ISent, _Iter>
  && sized_sentinel_for<_OSent, _Out>
  && is_trivial_v<_OutType>
  && is_nothrow_assignable_v<_OutType&,
 iter_reference_t<_Iter>>)
  {
auto __d1 = __ilast - __ifirst;
auto __d2 = __olast - __ofirst;
return ranges::copy_n(std::move(__ifirst), std::min(__d1, __d2),
  __ofirst);
  }

We should make sure that __d1 and __d2 are the same types before calling
std::min, the same goes for uninitialized_copy_n/move_n.

#include 
#include 

int main() {
  auto r = std::views::iota(0l, 5l);
  std::array o;
  std::ranges::uninitialized_copy(r, o);
}

https://godbolt.org/z/fj7hM8qdx

[Bug target/100952] [12 regression] several test case failures after r12-1202

2021-07-22 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100952

--- Comment #9 from CVS Commits  ---
The master branch has been updated by HaoChen Gui :

https://gcc.gnu.org/g:3382846558e02044598556e66e5ea1cb3115429d

commit r12-2479-g3382846558e02044598556e66e5ea1cb3115429d
Author: Haochen Gui 
Date:   Fri Jul 23 09:47:23 2021 +0800

Fix execution failure of parity_1.f90 on P10 [PR100952]

gcc/
PR target/100952
* config/rs6000/rs6000.md (cstore4): Fix wrong fall through.

[Bug c++/44282] fastcall is not mangled at all

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44282

Andrew Pinski  changed:

   What|Removed |Added

 CC||jacek at codeweavers dot com

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

[Bug c++/79582] Wrong mangled name for stdcall functions with templated arguments when referenced directly from vtbl.

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79582

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Dup of bug 44282.

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

[Bug c++/29328] calling convention attributes not encoded in member function pointer

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29328

Andrew Pinski  changed:

   What|Removed |Added

 CC||puetzk at puetzk dot org

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

[Bug target/65789] "cannot convert" calling convention

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65789

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE
  Component|c++ |target

--- Comment #2 from Andrew Pinski  ---
Dup of bug 29328.

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

[Bug c++/65591] G++ should use default constructor for {}-init when possible

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65591

--- Comment #3 from Andrew Pinski  ---
We should be able to do a loop instead of 1000 calls though.

[Bug c++/61834] __attribute__((may_alias)) causes compilation error with forward-declared constructor

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61834

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |6.0
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=53725,
   ||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=49377

--- Comment #1 from Andrew Pinski  ---
Fixed in GCC 6.1 and above.

[Bug c++/53725] Prototype does not match error if the definition of the ctor is separated from its declaration and attributes

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53725

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |6.0
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=49377
 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Andrew Pinski  ---
Fixed in GCC 6.1.0

[Bug c++/60273] [DR 1430] gcc gets confused when one class uses variadic

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60273

--- Comment #3 from Andrew Pinski  ---
The DR is still active but clang no longer accepts the code. and GCC no longer
crashes either.

[Bug c++/58184] Pointer to overloaded function is non-deduced context

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58184

--- Comment #2 from Andrew Pinski  ---
Still accepted on the trunk.

[Bug c++/58091] Non-ambiguous member lookup rejected

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58091

--- Comment #5 from Andrew Pinski  ---
clang started to reject it in clang 9.

[Bug c++/28389] [DR 563] linkage and variables

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28389

Andrew Pinski  changed:

   What|Removed |Added

 Status|SUSPENDED   |NEW

--- Comment #2 from Andrew Pinski  ---
> [Accepted at the November, 2020 meeting as part of paper P1787R6 and moved to 
> DR at the February, 2021 meeting.]

[Bug c++/57752] during the lookup for a base class name, non-type names should be ignored

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57752

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||rejects-valid
 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=71173
   Target Milestone|--- |6.2

--- Comment #2 from Andrew Pinski  ---
Fixed for GCC 6.2 and above.
Most likely by the patch which fixed PR 71173.

[Bug c++/38658] trivial try/catch statement not eliminated

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38658

Andrew Pinski  changed:

   What|Removed |Added

   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=53294
 CC||glisse at gcc dot gnu.org

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

[Bug c++/53294] Optimize out some exception code

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53294

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=38658
 Status|NEW |RESOLVED

--- Comment #5 from Andrew Pinski  ---
Dup of bug 38658.

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

[Bug c++/64372] [DR1560] Gratuitous lvalue-to-rvalue conversion in conditional-expression with throw-expression operand

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64372

Andrew Pinski  changed:

   What|Removed |Added

 CC||zhonghao at pku dot org.cn

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

[Bug c++/86475] CWG 1550

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86475

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
This is a dup of bug 64372.

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

[Bug c/101585] [11/12 Regression] Bad interaction of -fsanitize=undefined and -Wvla-parameters

2021-07-22 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101585

Martin Sebor  changed:

   What|Removed |Added

   Target Milestone|--- |11.2

[Bug tree-optimization/86605] Suboptimal code for pointer arithmetic with 'this'

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86605

--- Comment #4 from Andrew Pinski  ---
(In reply to Andrew Pinski from comment #3)
> So on the trunk we get:
>   if ( != 4B)
> goto ; [70.00%]
>   else
> goto ; [30.00%]
> 
>[local count: 322122544]:
> 
>[local count: 1073741824]:
>   # iftmp.0_3 = PHI <10(2), 20(3)>
> 
> I know we fold  != 0B but it seems like if the constant is within a few
> bytes of 0, we should fold it similar.  Shouldn't we?

Interesting we fold " != 4B" on aarch64-linux-gnu but not on
x86_64-linux-gnu.

If we change 4 to 16, we don't fold on either.

[Bug c/101585] [11/12 Regression] Bad interaction of -fsanitize=undefined and -Wvla-parameters

2021-07-22 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101585

Martin Sebor  changed:

   What|Removed |Added

Summary|Bad interaction of  |[11/12 Regression] Bad
   |-fsanitize=undefined and|interaction of
   |-Wvla-parameters|-fsanitize=undefined and
   ||-Wvla-parameters
 Ever confirmed|0   |1
 CC||msebor at gcc dot gnu.org
  Known to fail||11.1.0, 12.0
   Keywords||diagnostic
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2021-07-23

--- Comment #1 from Martin Sebor  ---
Confirmed.  It looks like an oversight in r12-2329.  The following fixes it:

diff --git a/gcc/c-family/c-warn.c b/gcc/c-family/c-warn.c
index 552a29f9944..7a50baedea9 100644
--- a/gcc/c-family/c-warn.c
+++ b/gcc/c-family/c-warn.c
@@ -3275,7 +3275,8 @@ warn_parm_ptrarray_mismatch (location_t origloc, tree
curparms, tree newparms)
  /* Move on if the bounds look the same.  */
  if (!pcurbndpos && !pnewbndpos
  && curbnd && newbnd
- && operand_equal_p (curbnd, newbnd, OEP_LEXICOGRAPHIC))
+ && operand_equal_p (curbnd, newbnd, OEP_LEXICOGRAPHIC
+ | OEP_DECL_NAME))
continue;

  if ((curbnd && TREE_CODE (curbnd) != INTEGER_CST)

[Bug tree-optimization/86605] Suboptimal code for pointer arithmetic with 'this'

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86605

Andrew Pinski  changed:

   What|Removed |Added

  Component|c++ |tree-optimization
   Last reconfirmed|2018-07-20 00:00:00 |2021-7-22
   Severity|normal  |enhancement

--- Comment #3 from Andrew Pinski  ---
So on the trunk we get:
  if ( != 4B)
goto ; [70.00%]
  else
goto ; [30.00%]

   [local count: 322122544]:

   [local count: 1073741824]:
  # iftmp.0_3 = PHI <10(2), 20(3)>

I know we fold  != 0B but it seems like if the constant is within a few bytes
of 0, we should fold it similar.  Shouldn't we?

[Bug c++/87699] Implement CWG 1512

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87699

Andrew Pinski  changed:

   What|Removed |Added

 CC||zhonghao at pku dot org.cn

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

[Bug c++/86579] invalid operands to binary expression

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86579

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
This is a dup of bug 87699.

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

[Bug c++/84971] ICE in build_non_dependent_expr, at cp/pt.c:25367

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84971

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2018-03-20 00:00:00 |2021-7-22

--- Comment #2 from Andrew Pinski  ---
Note this has nothing to do with the __builtin decl either, It can be repoduced
with:
void a();
void a(short);
bool f(double);
template  decltype(f) b { int(&() >) }

[Bug c++/84977] ICE: Segmentation fault (build_x_unary_op())

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84977

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |11.0
 Status|NEW |RESOLVED

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 11.

[Bug c++/84714] internal compiler error: in create_tmp_var, at gimple-expr.c:476

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84714

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
   Target Milestone|--- |10.0
 Status|NEW |RESOLVED

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 10.

[Bug c++/101219] [12 Regression] ice in perform_or_defer_access_check since r12-1804-g65870e75616ee435

2021-07-22 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101219

--- Comment #8 from Sergei Trofimovich  ---
Proposed simplistic change as
https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575867.html

[Bug c/100501] ICE: segmentation fault on embedded asm code

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100501

Andrew Pinski  changed:

   What|Removed |Added

 CC||vegard.nossum at gmail dot com

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

[Bug inline-asm/84728] internal compiler error: Segmentation fault (is_gimple_variable())

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84728

Andrew Pinski  changed:

   What|Removed |Added

  Component|c++ |inline-asm
 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #2 from Andrew Pinski  ---
This now only fails for the C front-end which is recorded as PR 100501.

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

[Bug target/101393] PowerPC32 inline assembly broken by commit 2d94f7dea9c73ef3c116a0ddc722724578a860fe

2021-07-22 Thread segher at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101393

--- Comment #17 from Segher Boessenkool  ---
(In reply to Franz Sirl from comment #15)
> > "7400" and "403" are not supported target attribute values, fwiw (says the
> > manual).
> 
> Hmm, I don't understand what you mean.

I mean that I cannot read :-)  You wrote "cpu=403" of course, which should
be fine (as opposed to just "403".

[Bug c++/772] Statement expressions issues

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

Andrew Pinski  changed:

   What|Removed |Added

 CC||vegard.nossum at gmail dot com

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

[Bug c++/84745] internal compiler error: Segmentation fault (main_block_label())

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84745

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
jumping into statement expressions should be invalid, and is correctly rejected
for the C front-end.
This is a dup of PR 772.

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

[Bug c++/70401] [c++1z] variadic template failed

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70401

--- Comment #10 from Andrew Pinski  ---
This is still rejected with -std=c++17 but accepted with -std=c++14 .  Note
since GCC 11, we default to C++17 so this might be important thing to fix.

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

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
Bug 67491 depends on bug 84344, which changed state.

Bug 84344 Summary: [concepts] ICE with invalid use of auto
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84344

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug c++/84344] [concepts] ICE with invalid use of auto

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84344

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #3 from Andrew Pinski  ---
Fixed.

[Bug tree-optimization/101494] [11 Regression] -Wmaybe-uninitialized false alarm with memrchr of size 0

2021-07-22 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101494

Martin Sebor  changed:

   What|Removed |Added

   Keywords||patch
   Target Milestone|--- |11.2

--- Comment #4 from Martin Sebor  ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575862.html

[Bug tree-optimization/101584] missing -Wuninitialized with an allocated object after a built-in call

2021-07-22 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101584

Martin Sebor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
 Ever confirmed|0   |1
   Keywords||patch
   Last reconfirmed||2021-07-22

--- Comment #1 from Martin Sebor  ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2021-July/575863.html

[Bug c++/71543] [concepts] ICE on ill-formed declaration of a parameter with a constrained-type-specifier in a requires expression

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71543

--- Comment #3 from Andrew Pinski  ---
GCC 10 and above reject the code:
:4:28: error: placeholder type not allowed in this context
4 | concept bool C2 = requires(C1 c1) {};
  |^~
:4:36: error: expected primary-expression before '}' token
4 | concept bool C2 = requires(C1 c1) {};
  |^
:4:36: error: expected ';' before '}' token
4 | concept bool C2 = requires(C1 c1) {};
  |^
  |;

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

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
Bug 67491 depends on bug 71141, which changed state.

Bug 71141 Summary: [concepts] Example variadic concept code in the Concepts TS 
14.1p9.4 rejected
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71141

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug c++/71141] [concepts] Example variadic concept code in the Concepts TS 14.1p9.4 rejected

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71141

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
   Keywords||rejects-valid
   Target Milestone|--- |10.0
 Resolution|--- |FIXED

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 10.

[Bug c++/79994] Concepts technical specification

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79994

--- Comment #3 from Andrew Pinski  ---
GCC 10 and above rejects reduced testcase in comment 1:
GCC 10:
: In instantiation of 'void add(T&) [with T = Directed_Graph_impl]':
:3:8:   recursively required from 'void add(T&) [with T =
Directed_Graph_impl]'
:3:8:   required from 'void add(T&) [with T = Directed_Graph_impl]'
:14:10:   required from here
:3:8: fatal error: template instantiation depth exceeds maximum of 900
(use '-ftemplate-depth=' to increase the maximum)
3 | add(g);
  | ~~~^~~

GCC 11/trunk:
: In substitution of 'template  requires  Graph void
add(T&) [with T = Directed_Graph_impl]':
:3:8:   required by substitution of 'template  requires 
Graph void add(T&) [with T = Directed_Graph_impl]'
:14:8:   required from here
:2:14:   required for the satisfaction of 'Graph' [with T =
Directed_Graph_impl]
:2:22:   in requirements with 'G& g' [with G = Directed_Graph_impl]
:2:22: error: satisfaction of atomic constraint 'requires(G& g)
{add(g);} [with G = T]' depends on itself
2 | concept bool Graph = requires (G& g) {
  |  ^
3 | add(g);
  | ~~~   
4 | };
  | ~ 
: In function 'int main()':
:14:8: error: no matching function for call to
'add(Directed_Graph_impl&)'
   14 | add(t);
  | ~~~^~~
:7:6: note: candidate: 'template  requires  Graph void
add(T&)'
7 | void add(T& g) {
  |  ^~~
:7:6: note:   substitution of deduced template arguments resulted in
errors seen above

[Bug c++/71808] [concepts] ICE in finish_member_declaration

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71808

--- Comment #2 from Andrew Pinski  ---
GCC 10 and above don't ICE but errors out:
: In instantiation of 'struct model':
:2:42:   required from here
:17:25: error: template constraint failure for 'template 
requires  Fooable struct container'
   17 | container> bar() { return {}; }
  | ^~~
:17:25: note: constraints not satisfied
:2:14:   required for the satisfaction of 'Fooable' [with X =
model]
:2:24:   in requirements with 'X x' [with X = model]
:2:45: note: the required expression 'x.foo()' is invalid, because
2 | concept bool Fooable = requires(X x) { x.foo(); };
  |~^~
:2:35: error: 'x' has incomplete type
2 | concept bool Fooable = requires(X x) { x.foo(); };
  | ~~^
:12:8: note: declaration of 'struct model'
   12 | struct model {
  |^
: In function 'int main()':
:22:38: error: 'struct model' has no member named 'bar'
   22 | container> {}.payload.bar();
  |  ^~~


GCC 11/trunk:
: In substitution of 'template  requires  Fooable struct
container [with X = model]':
:17:25:   required from 'struct model'
:2:42:   required by substitution of 'template  requires 
Fooable struct container [with X = model]'
:22:24:   required from here
:2:14:   required for the satisfaction of 'Fooable' [with X =
model]
:2:24:   in requirements with 'X x' [with X = model]
:2:24: error: satisfaction of atomic constraint 'requires(X x)
{x.foo();} [with X = X]' depends on itself
2 | concept bool Fooable = requires(X x) { x.foo(); };
  |^~
: In instantiation of 'struct model':
:2:42:   required by substitution of 'template  requires 
Fooable struct container [with X = model]'
:22:24:   required from here
:17:25: error: template constraint failure for 'template 
requires  Fooable struct container'
   17 | container> bar() { return {}; }
  | ^~~
:17:25: note: constraints not satisfied
: In substitution of 'template  requires  Fooable struct
container [with X = model]':
:17:25:   required from 'struct model'
:2:42:   required by substitution of 'template  requires 
Fooable struct container [with X = model]'
:22:24:   required from here
:2:14:   required for the satisfaction of 'Fooable' [with X =
model]
:2:24:   in requirements with 'X x' [with X = model]
:2:24: error: satisfaction of atomic constraint 'requires(X x)
{x.foo();} [with X = X]' depends on itself
2 | concept bool Fooable = requires(X x) { x.foo(); };
  |^~
: In function 'int main()':
:22:38: error: 'struct model' has no member named 'bar'
   22 | container> {}.payload.bar();
  |  ^~~

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

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
Bug 67491 depends on bug 69189, which changed state.

Bug 69189 Summary: [concepts] ICE: segmentation fault in instantiate_template_1
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69189

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

[Bug c++/69189] [concepts] ICE: segmentation fault in instantiate_template_1

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69189

Andrew Pinski  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
   Keywords||ice-on-valid-code
   Target Milestone|--- |7.0
 Resolution|--- |FIXED

--- Comment #1 from Andrew Pinski  ---
Fixed in GCC 7.0.

[Bug c++/68246] [concepts] Incorrect evaluation of C++1z fold expressions (... || expr) in concepts

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68246

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |7.0

--- Comment #2 from Andrew Pinski  ---
Fixed in GCC 7.

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

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
Bug 67491 depends on bug 68487, which changed state.

Bug 68487 Summary: [concepts] bad "invalid reference to variadic concept" error
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68487

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

[Bug c++/68487] [concepts] bad "invalid reference to variadic concept" error

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68487

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED
   Target Milestone|--- |10.0

--- Comment #1 from Andrew Pinski  ---
Fixed in GCC 10.

[Bug middle-end/101586] New: ICE:in clear_padding_type, at gimple-fold.c:4783 with call to __builtin_clear_padding for C++

2021-07-22 Thread qinzhao at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101586

Bug ID: 101586
   Summary: ICE:in clear_padding_type, at gimple-fold.c:4783 with
call to __builtin_clear_padding for C++
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: qinzhao at gcc dot gnu.org
  Target Milestone: ---

gcc12 failed with the following small testing case:

namespace std {
inline namespace __cxx11 {}
typedef char string;
namespace __cxx11 {
template 
class basic_stringstream;
}
typedef basic_stringstream stringstream;
template  class basic_ios {
  typedef _CharT char_type;
  char_type _M_fill;
};
template 
class basic_istream : virtual basic_ios<_CharT, _Traits> {};
template 
class basic_iostream : basic_istream<_CharT, _Traits> {};
namespace __cxx11 {
template 
class basic_stringstream : basic_iostream<_CharT, _Traits> {};
} // namespace __cxx11
} // namespace std
class cMessage {
  std::string info() const;
};
std::string cMessage::info() const 
{ 
  std::stringstream out;
  __builtin_clear_padding ();
}

compiled with g++ -std=c++03 -m64, and got:

tf.c: In member function ‘std::string cMessage::info() const’:
tf.c:29:1: warning: no return statement in function returning non-void
[-Wreturn-type]
   29 | }
  | ^
during GIMPLE pass: lower
tf.c:25:13: internal compiler error: in clear_padding_type, at
gimple-fold.c:4783
   25 | std::string cMessage::info() const
  | ^~~~
0x10e2037 clear_padding_type
../../latest-gcc-2/gcc/gimple-fold.c:4783
0x10e1fae clear_padding_type
../../latest-gcc-2/gcc/gimple-fold.c:4779
0x10e1fae clear_padding_type
../../latest-gcc-2/gcc/gimple-fold.c:4779
0x10e3216 gimple_fold_builtin_clear_padding
../../latest-gcc-2/gcc/gimple-fold.c:4981
0x10e39f5 gimple_fold_builtin
../../latest-gcc-2/gcc/gimple-fold.c:5155
0x10e5c95 gimple_fold_call
../../latest-gcc-2/gcc/gimple-fold.c:5563
0x10e916c fold_stmt_1
../../latest-gcc-2/gcc/gimple-fold.c:6265
0x10e94eb fold_stmt(gimple_stmt_iterator*)
../../latest-gcc-2/gcc/gimple-fold.c:6361
0x253052f lower_stmt
../../latest-gcc-2/gcc/gimple-low.c:388
0x2530093 lower_sequence
../../latest-gcc-2/gcc/gimple-low.c:217
0x253025e lower_stmt
../../latest-gcc-2/gcc/gimple-low.c:286
0x2530093 lower_sequence
../../latest-gcc-2/gcc/gimple-low.c:217
0x25309b0 lower_gimple_bind
../../latest-gcc-2/gcc/gimple-low.c:473
0x252fc89 lower_function_body
../../latest-gcc-2/gcc/gimple-low.c:110
0x252ffdc execute
../../latest-gcc-2/gcc/gimple-low.c:195
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
ubuntu@qinzhao-ubuntu-x86:~/Bugs/uninit/bug_1$ 


This testing case is Reduced from CPU2017 benchmark and has been modified a
little bit (by adding the call to __builtin_clear_padding).

[Bug c++/96396] initializer_list in `-fconcepts -std=c++11` reports internal compiler error

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96396

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2020-08-03 00:00:00 |2021-7-22

--- Comment #2 from Andrew Pinski  ---
'-fconcepts -std=c++17' works though.

[Bug analyzer/101570] [12 Regression] ICE in maybe_reconstruct_from_def_stmt, at analyzer/analyzer.cc:133

2021-07-22 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101570

David Malcolm  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-22
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1

--- Comment #1 from David Malcolm  ---
Thanks for filing this bug.

Confirmed; I'm working on a fix.

[Bug c++/95703] [9 only] Please backport 0998d2fd59e7a5eb3a3566c57625702bbdc6a05f to gcc 9

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95703

Andrew Pinski  changed:

   What|Removed |Added

Summary|Please backport |[9 only] Please backport
   |0998d2fd59e7a5eb3a3566c5762 |0998d2fd59e7a5eb3a3566c5762
   |5702bbdc6a05f to gcc 9  |5702bbdc6a05f to gcc 9
   Target Milestone|--- |9.5

[Bug middle-end/95103] Unexpected -Wclobbered in bits/vector.tcc with -O2

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95103

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2021-07-22
  Component|c++ |middle-end
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #6 from Andrew Pinski  ---
There was a patch series to move -Wclobbered to gimple but it never went in.
https://gcc.gnu.org/pipermail/gcc-patches/2019-October/530992.html


Confirmed, this should say the variable is from inlined functions even.

[Bug c/101585] New: Bad interaction of -fsanitize=undefined and -Wvla-parameters

2021-07-22 Thread jahns at dkrz dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101585

Bug ID: 101585
   Summary: Bad interaction of -fsanitize=undefined and
-Wvla-parameters
   Product: gcc
   Version: 11.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: jahns at dkrz dot de
  Target Milestone: ---

The following source causes an incorrect warning with gcc 11.1.0 (sorry did not
have 11.1.1 available, it's not yet in spack):

void a(long send_size_asize, int (*)[send_size_asize]);
void a(long send_size_asize, int (*)[send_size_asize]) {}

Compiling it with

gcc-11.1 -c -Wall -Werror -fsanitize=undefined mini.c

results in

mini.c:2:30: error: mismatch in bound 1 of argument 2 declared as 'int
(*)[(send_size_asize) - 1]'
[]8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wvla-parameter-Werror=vla-parameter]8;;]
2 | void a(long send_size_asize, int (*)[send_size_asize]) {}
  |  ^~~~
mini.c:1:30: note: previously declared as 'int (*)[(send_size_asize) - 1]'
1 | void a(long send_size_asize, int (*)[send_size_asize]);
  |  ^~~~
cc1: all warnings being treated as errors

[Bug c++/92559] Returning std∷map breaks tail-recursion optimization

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92559

--- Comment #2 from Andrew Pinski  ---
I don't think this can ever be optimized.  Mainly because there are copies
happening due to passing via value and returning by value.

If I change it to foo to MyMap (MyMap ), I get the behavior you want.

[Bug c++/772] Statement expressions issues

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

Andrew Pinski  changed:

   What|Removed |Added

 Blocks||89003
 CC||wilkey at drive dot ai

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


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89003
[Bug 89003] Return inside a statement expression while initializing a static
local variable fails to cleanup cxa_guard

[Bug c++/89003] Return inside a statement expression while initializing a static local variable fails to cleanup cxa_guard

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89003

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Depends on||772
 Status|UNCONFIRMED |RESOLVED

--- Comment #2 from Andrew Pinski  ---
the C++ statement expression issues for jumping out of a statement expression
is PR 772 (C front-end already rejects this).

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


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772
[Bug 772] Statement expressions issues

[Bug c++/772] Statement expressions issues

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

Andrew Pinski  changed:

   What|Removed |Added

 CC||donald.chai at synopsys dot com

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

[Bug c++/70741] segfault when jumping into statement expression in array initializer

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70741

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #1 from Andrew Pinski  ---
the C++ statement expression issues for jumping into a statement expression is
PR 772 (C front-end already rejects this).

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

[Bug c++/772] Statement expressions issues

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

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

[Bug c++/17913] ICE jumping into statement expression

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=17913

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #27 from Andrew Pinski  ---
the C++ statement expression issues for jumping into a statement expression is
PR 772 (C front-end already rejects this).

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

[Bug tree-optimization/90304] -O3 vectorization gets worse when code is inlined

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90304

Andrew Pinski  changed:

   What|Removed |Added

Summary|-O3 vectorization gets  |-O3 vectorization gets
   |worse when code is moved|worse when code is inlined
   |into main() |
   Keywords||alias

--- Comment #3 from Andrew Pinski  ---
Testcase:
int* ptr();

int f()
{
int*__restrict result = ptr();
int* first = ptr();
int* second = ptr();

for (int i = 0; i < 1024; ++i)
result[i] = first[i] * second[i];
}
__attribute__((noinline))
void func(int*__restrict result, int* first, int* second)
{
for (int i = 0; i < 1024; ++i)
result[i] = first[i] * second[i];
}

int g()
{
func(ptr(), ptr(), ptr());
}

Notice func is vectorized while f is not.

[Bug tree-optimization/90304] -O3 vectorization gets worse when code is moved into main()

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90304

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug c++/89897] suggest header for SIGABRT

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89897

Andrew Pinski  changed:

   What|Removed |Added

   Severity|normal  |enhancement

[Bug middle-end/88831] the layout of .data section of a binary is slightly changed when -g option is enabled.

2021-07-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88831

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|1   |0
 Status|WAITING |UNCONFIRMED
  Component|c++ |middle-end

[Bug analyzer/94355] support for C++ new expression

2021-07-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94355

--- Comment #9 from Jonathan Wakely  ---
(In reply to William Navarre from comment #8)
> It seems that `operator new` is generally not supposed to return NULL --
> std::bad_alloc() is supposed to be thrown instead. 

If an operator new overload is declared noexcept, then it can return null on
failure. If it is not noexcept then it throws bad_alloc (or something derived
from it) and must never return null.


> 
> I made that change on my build (see below). I think that treating new's
> result as never-null is probably the correct thing to do most of the time,
> but two considerations: 
> 
> 1) The case of allocating a zero-length array. 

That still can't return null. It must return a valid non-null pointer, that
cannot be derefernced.

> 2) The case that a project has replaced `operator new.` (See "global
> replacements" at https://en.cppreference.com/w/cpp/memory/new/operator_new). 
> 
> Apparently projects can replace `operator new` (see "global replacements" at
> https://en.cppreference.com/w/cpp/memory/new/operator_new). It's not clear 

Exactly the same rules apply. If the operator new function is noexcept it
returns null to indicate allocation failure, otherwise it must throw and cannot
return null, ever.

[Bug tree-optimization/101584] New: missing -Wuninitialized with an allocated object after a built-in call

2021-07-22 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101584

Bug ID: 101584
   Summary: missing -Wuninitialized with an allocated object after
a built-in call
   Product: gcc
   Version: 11.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

The puts() calls below should be diagnosed by -Wuninitialized but aren't
because the alias analysis the warning relies on determines that the argument
and the result returned by malloc() or the VLA might alias each other.

$ cat a.c && gcc -O2 -S -Wall /build/tmp/a.c
void f  (const char *s)
{ 
  char *p = __builtin_malloc (__builtin_strlen (s));

  __builtin_printf ("%s", s);

  __builtin_puts (p);   // missing -Wununitialized
}


void g  (const char *s)
{
  char a[__builtin_strlen (s)];

  __builtin_printf ("%s", s);

  __builtin_puts (a);   // missing -Wununitialized
}

[Bug libstdc++/101034] wrong constraint in std::any's constructor

2021-07-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101034

Jonathan Wakely  changed:

   What|Removed |Added

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

--- Comment #6 from Jonathan Wakely  ---
Fixed for 9.5 and 10.4 and 11.2

[Bug libstdc++/90415] [9 Regression] std::is_copy_constructible> is incomplete

2021-07-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415

Jonathan Wakely  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #18 from Jonathan Wakely  ---
Fixed for 9.5 too.

[Bug libstdc++/92156] Cannot in-place construct std::any with std::any

2021-07-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92156

--- Comment #7 from Jonathan Wakely  ---
Fixed for 9.5 too.

[Bug libstdc++/100982] wrong constraint in std::optional::operator=

2021-07-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100982

Jonathan Wakely  changed:

   What|Removed |Added

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

--- Comment #5 from Jonathan Wakely  ---
Fixed for 9.5 and 10.4 and 11.2

[Bug libstdc++/89322] Use of new and -lsupc++ requires -lstdc++ on architectures without atomics

2021-07-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89322
Bug 89322 depends on bug 96657, which changed state.

Bug 96657 Summary: [9 Regression] libsupc++.a missing required functions from 
src/c++98/atomicity.cc when atomic builtins are not supported
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96657

   What|Removed |Added

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

[Bug libstdc++/96657] [9 Regression] libsupc++.a missing required functions from src/c++98/atomicity.cc when atomic builtins are not supported

2021-07-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96657

Jonathan Wakely  changed:

   What|Removed |Added

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

--- Comment #11 from Jonathan Wakely  ---
And also fixed for 9.5

The GCC 8.x branch is closed, so it can't be fixed there.

[Bug libstdc++/96657] [9 Regression] libsupc++.a missing required functions from src/c++98/atomicity.cc when atomic builtins are not supported

2021-07-22 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96657

--- Comment #10 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Jonathan Wakely
:

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

commit r9-9640-gba5e10a8c84f56bb2838adb6d1cc9b74741ac4f1
Author: Jonathan Wakely 
Date:   Wed Apr 14 20:48:54 2021 +0100

libstdc++: Move atomic functions to libsupc++ [PR 96657]

The changes for PR libstdc++/64735 mean that libsupc++ function might
now depend on the __exchange_and_add and __atomic_add functions defined
in config/cpu/*/atomicity.h which is not compiled into libsupc++. This
causes a link failure for some targets when trying to use libsupc++
without the rest of libstdc++.

This patch simply moves the definitions of those functions into
libsupc++ so that they are available there.

libstdc++-v3/ChangeLog:

PR libstdc++/96657
* libsupc++/Makefile.am: Add atomicity.cc here.
* src/c++98/Makefile.am: Remove it from here.
* libsupc++/Makefile.in: Regenerate.
* src/c++98/Makefile.in: Regenerate.
* testsuite/18_support/exception_ptr/96657.cc: New test.

(cherry picked from commit 6c0c7fc6236470a533675cd3cd1ebb1cc3dd112c)

  1   2   3   >