[Bug c++/113754] New: GCC complains when using a type that depends on lambda

2024-02-04 Thread milasudril at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113754

Bug ID: 113754
   Summary: GCC complains when using a type that depends on lambda
   Product: gcc
   Version: 13.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: milasudril at gmail dot com
  Target Milestone: ---

I tried to use 

template
using unique_ptr_deleter =
  std::unique_ptr;

As described by
https://andreasfertig.blog/2022/08/cpp-insights-lambdas-in-unevaluated-contexts/

It works well as long as I do not try define it in a header file. If gcc
detects a from a header file that uses unique_ptr_deleter, I get the warning 

lib/array_classes/./memory_block.hpp:12:8: error: 'memory_block' has a field
'unique_ptr_deleter terraformer::memory_block::m_pointer' whose
type has internal linkage [-Werror=subobject-linkage]

Clang do generate any warnings.

Stand-alone snippet to reproduce the issue:

#include 
#include 

# 7 "lib/array_classes/./memory_block.hpp"
 template
 using unique_ptr_deleter = std::unique_ptr;

 class memory_block
 {
 public:

 private:
  unique_ptr_deleter m_pointer;
 };

# 4 "lib/array_classes/memory_block.test.cpp"

[Bug c++/113755] New: Class without a viable destructor wrongly accepted

2024-02-04 Thread fchelnokov at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113755

Bug ID: 113755
   Summary: Class without a viable destructor wrongly accepted
   Product: gcc
   Version: 13.2.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fchelnokov at gmail dot com
  Target Milestone: ---

This program

template 
struct A {
  ~A() requires(sizeof(T) < 2);
};

int main() {
new A;
}

is ill formed per
https://timsong-cpp.github.io/cppwp/n4868/class.dtor#4.sentence-2 and rejected
by both Clang and MSVC with the errors:

* no viable destructor found
* error C7653: failed to select a destructor for the class

but GCC accepts it: https://godbolt.org/z/bqcs8WY3P

Related discussion: https://stackoverflow.com/a/77928824/7325599

[Bug middle-end/113750] [14 Regression] ICE in vect building gcc/m2/gm2-libs/NumberIO.mod

2024-02-04 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113750

Gaius Mulley  changed:

   What|Removed |Added

 CC||gaius at gcc dot gnu.org
 Status|UNCONFIRMED |ASSIGNED
 Ever confirmed|0   |1
   Last reconfirmed||2024-02-04

--- Comment #2 from Gaius Mulley  ---
Confirmed seen it fail on aarch64 (non bootstrap)

/bin/bash ../libtool --tag=CC   \
   --mode=compile
/home/gaius/GCC/gcc-read-write/build/./gcc/gm2
-B/home/gaius/GCC/gcc-read-write/build/./gcc/ \
   -c -g -O2 -g -O2 -fm2-pathname=m2pim -I.
-I/home/gaius/GCC/gcc-read-write/gcc/m2/gm2-libs -fm2-pathname=m2iso
-I/home/gaius/GCC/gcc-read-write/gcc/m2/gm2-libs-iso -fm2-g -g -Wcase-enum
-Wreturn-type -fcase -fm2-prefix=m2pim
../../../../libgm2/libm2pim/../../gcc/m2/gm2-libs/NumberIO.mod -o NumberIO.lo
libtool: compile:  /home/gaius/GCC/gcc-read-write/build/./gcc/gm2
-B/home/gaius/GCC/gcc-read-write/build/./gcc/ -c -g -O2 -g -O2
-fm2-pathname=m2pim -I. -I/home/gaius/GCC/gcc-read-write/gcc/m2/gm2-libs
-fm2-pathname=m2iso -I/home/gaius/GCC/gcc-read-write/gcc/m2/gm2-libs-iso -fm2-g
-g -Wcase-enum -Wreturn-type -fcase -fm2-prefix=m2pim
../../../../libgm2/libm2pim/../../gcc/m2/gm2-libs/NumberIO.mod  -fPIC -DPIC -o
.libs/NumberIO.o
../../../../libgm2/libm2pim/../../gcc/m2/gm2-libs/NumberIO.mod: In function
'm2pim_NumberIO_HexToStr':
../../../../libgm2/libm2pim/../../gcc/m2/gm2-libs/NumberIO.mod:237:1: error:
label '.L873' in the middle of basic block 3

It passes prior to git commit 64b0130bb6702c67a13caefaae9facef23d6ac60

[Bug c++/113754] GCC complains when using a type that depends on lambda

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113754

Andrew Pinski  changed:

   What|Removed |Added

 Blocks||107430
   Keywords||c++-lambda

--- Comment #1 from Andrew Pinski  ---
lambda inside a decltype has many known issues, maybe this is a dup of one of
those.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107430
[Bug 107430] [meta-bug] lambda in decltype

[Bug target/113742] ICE: RTL check: expected elt 1 type 'i' or 'n', have 'e' (rtx set) in riscv_macro_fusion_pair_p, at config/riscv/riscv.cc:8416 with -O2 -finstrument-functions -mtune=sifive-p600-se

2024-02-04 Thread kito at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113742

--- Comment #1 from Kito Cheng  ---
Thanks, forward and assigned this to our (SiFive) engineer :)

[Bug tree-optimization/113756] New: Wrong code at -O2 on x86_64-linux-gnu since r14-2780-g39f117d6c87

2024-02-04 Thread shaohua.li at inf dot ethz.ch via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113756

Bug ID: 113756
   Summary: Wrong code at -O2 on x86_64-linux-gnu since
r14-2780-g39f117d6c87
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: shaohua.li at inf dot ethz.ch
CC: aldyh at redhat dot com
  Target Milestone: ---

gcc at -O2 produced the wrong code.

Bisected to r14-2780-g39f117d6c87

Compiler explorer: https://godbolt.org/z/qWd4196h6

% cat reduced.c
int printf(const char *, ...);
int d, e, i, k, l = -8;
char h, j;
int m(int n, int o, int p3) {
  int a = o - p3, b = n - p3, c = a + b, f = -b, g = c < 0 ? -c : c;
  return a <= f && a <= g ? o : p3;
}
void q(int *n, unsigned short o) {
  unsigned p = 8896;
  for (; e >= 0; e--)
p = 5377;
  for (; h <= 0; h++)
for (; j <= 0; j++) {
  *n = 1611581749;
  i = m(34, p - 5294, *n - 1611581687);
  k = i + p + 65535 + o + *n - 1611718251;
  printf("%d\n", k);
}
}
int main() {
  q(&l, l);
}
%
% gcc -O0 reduced.c &&./a.out
0
% gcc -O2 reduced.c &&./a.out
21
%

[Bug middle-end/113750] [14 Regression] ICE in vect building gcc/m2/gm2-libs/NumberIO.mod

2024-02-04 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113750

--- Comment #3 from Iain Sandoe  ---
Created attachment 57317
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57317&action=edit
gimple for 179t.ifcvt

the label seems OK here.

[Bug middle-end/113750] [14 Regression] ICE in vect building gcc/m2/gm2-libs/NumberIO.mod

2024-02-04 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113750

--- Comment #4 from Iain Sandoe  ---
Created attachment 57318
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57318&action=edit
gimple for 179t.vect

now there's a mem at the start of bb3 with the label following

[Bug tree-optimization/113756] Wrong code at -O2 on x86_64-linux-gnu since r14-2780-g39f117d6c87

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113756

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |14.0
 CC||pinskia at gcc dot gnu.org

[Bug tree-optimization/113756] Wrong code at -O2 on x86_64-linux-gnu since r14-2780-g39f117d6c87

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113756

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-02-04
 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

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

[Bug c/113727] [14 Regression] csmith: differences from nothing to -O1

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113727

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |14.0
   Keywords||needs-reduction, wrong-code
Summary|csmith: differences from|[14 Regression] csmith:
   |nothing to -O1  |differences from nothing to
   ||-O1

[Bug c++/113755] an implicit deconstructor is (incorrectly) added when the requires of the deconstructor fails

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113755

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
Summary|Class without a viable  |an implicit deconstructor
   |destructor wrongly accepted |is (incorrectly) added when
   ||the requires of the
   ||deconstructor fails
   Last reconfirmed||2024-02-04
 Status|UNCONFIRMED |NEW

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

[Bug c++/113755] an implicit deconstructor is (incorrectly) added when the requires of the deconstructor fails

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113755

--- Comment #2 from Andrew Pinski  ---
I wonder if the wording changed between the time concepts was originally added
to GCC to the finalization of the C++20 standard; which would describe GCC's
behavior.

[Bug c++/113757] New: [14 regression] ICE when building legion-23.03.0

2024-02-04 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113757

Bug ID: 113757
   Summary: [14 regression] ICE when building legion-23.03.0
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Created attachment 57319
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57319&action=edit
legion_tasks.cc.ii.xz

Originally reported downstream in Gentoo at https://bugs.gentoo.org/923797 by 
Toralf Förster.

```
$
/var/tmp/portage/sys-cluster/legion-23.03.0/temp/clang-wrappers/x86_64-pc-linux-gnu-g++
-DLegionRuntime_EXPORTS
-I/var/tmp/portage/sys-cluster/legion-23.03.0/work/legion-legion-23.03.0/runtime
-I/var/tmp/portage/sys-cluster/legion-23.03.0/work/legion-legion-23.03.0_build/runtime
 -O2 -march=znver2 -march=native -O2 -g -fPIC -fdiagnostics-color=always -MD
-MT runtime/CMakeFiles/LegionRuntime.dir/legion/legion_tasks.cc.o -MF
runtime/CMakeFiles/LegionRuntime.dir/legion/legion_tasks.cc.o.d -o
runtime/CMakeFiles/LegionRuntime.dir/legion/legion_tasks.cc.o -c
/var/tmp/portage/sys-cluster/legion-23.03.0/work/legion-legion-23.03.0/runtime/legion/legion_tasks.cc
during IPA pass: inline
/var/tmp/portage/sys-cluster/legion-23.03.0/work/legion-legion-23.03.0/runtime/legion/legion_tasks.cc:
In member function ‘virtual const Legion::Internal::VersionInfo&
Legion::Internal::PointTask::get_version_info(unsigned int) const’:
/var/tmp/portage/sys-cluster/legion-23.03.0/work/legion-legion-23.03.0/runtime/legion/legion_tasks.cc:7033:24:
internal compiler error: tree check: expected class ‘type’, have ‘exceptional’
(error_mark) in useless_type_conversion_p, at gimple-expr.cc:85
 7033 | const VersionInfo& PointTask::get_version_info(unsigned idx) const
  |^


0x5611c9270657 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/tree.cc:9002
0x5611c81c7150 tree_class_check(tree_node*, tree_code_class, char const*, int,
char const*)
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/tree.h:3767
0x5611c81c7150 useless_type_conversion_p(tree_node*, tree_node*)
   
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/gimple-expr.cc:85
0x5611c9dc377f may_propagate_copy(tree_node*, tree_node*, bool)
   
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/tree-ssa-propagate.cc:1068
0x5611c9ceafbc gimple_merge_blocks
   
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/tree-cfg.cc:2130
0x5611c9ce61dd merge_blocks(basic_block_def*, basic_block_def*)
   
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/cfghooks.cc:820
0x5611c9c46209 cleanup_tree_cfg_bb
   
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/tree-cfgcleanup.cc:791
0x5611c9c46209 cleanup_tree_cfg_noloop
   
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/tree-cfgcleanup.cc:1141
0x5611c9c46209 cleanup_tree_cfg(unsigned int)
   
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/tree-cfgcleanup.cc:1205
0x5611c9ae1bf4 execute_function_todo
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/passes.cc:2057
0x5611c9ae1bf4 do_per_function
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/passes.cc:1687
0x5611c9ae1bf4 execute_todo
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/passes.cc:2142
0x5611c9cbcfca execute_one_ipa_transform_pass
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/passes.cc:2336
0x5611c9cbcfca execute_all_ipa_transforms(bool)
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/passes.cc:2396
0x5611c9b20cb3 cgraph_node::expand()
   
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/cgraphunit.cc:1836
0x5611c9adacd0 expand_all_functions
   
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/cgraphunit.cc:2026
0x5611c9adacd0 symbol_table::compile()
   
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/cgraphunit.cc:2400
0x5611ca40f9c8 symbol_table::finalize_compilation_unit()
   
/usr/src/debug/sys-devel/gcc-14.0./gcc-14.0./gcc/cgraphunit.cc:2585
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.
```

```
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/14/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-14.0./work/gcc-14.0./configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/14
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/14/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/14
--mandir

[Bug c++/113757] [14 regression] ICE when building legion-23.03.0

2024-02-04 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113757

--- Comment #1 from Sam James  ---
I will try reduce it but my track record with C++ isn't good ;)

[Bug c++/113757] [14 regression] ICE when building legion-23.03.0

2024-02-04 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113757

--- Comment #2 from Sam James  ---
needs -O2 -march=znver2 -fPIC (the znver2 is just an artefact of how I built it
though, didn't bother trying it without w/o preprocessed)

[Bug fortran/110987] Segmentation fault after finalization of a temporary variable

2024-02-04 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110987

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 CC||anlauf at gcc dot gnu.org,
   ||pault at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2024-02-04

--- Comment #4 from anlauf at gcc dot gnu.org ---
Confirmed.

Adding Paul so that he gets attention of this issue.

(The suggested change in comment#3 does indeed fix the crash,
but he should know the surrounding code better than anybody else.)

[Bug d/113758] New: d: Callee destructor call invalidates the live object, not the temporary

2024-02-04 Thread ibuclaw at gdcproject dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113758

Bug ID: 113758
   Summary: d: Callee destructor call invalidates the live object,
not the temporary
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: d
  Assignee: ibuclaw at gdcproject dot org
  Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

D ABI does callee destruction of arguments, which depends on the argument
already being copied to a temporary before passing by ref.

At some point, the front-end stopped explicitly generating this temporary, so
now the code generator must take care of it.
---
struct Sdtor
{
int field;
~this() { field = 0; }
}

void main()
{
auto var = Sdtor(1);
callee(var);
assert(var.field == 1); // fails.
}

void callee(Sdtor param) { }

[Bug tree-optimization/113757] [14 regression] ICE when building legion-23.03.0

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113757

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |14.0

[Bug tree-optimization/113757] [14 regression] ICE when building legion-23.03.0

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113757

--- Comment #3 from Andrew Pinski  ---
(In reply to Sam James from comment #1)
> I will try reduce it but my track record with C++ isn't good ;)

I am reducing it too.

[Bug tree-optimization/113757] [14 regression] ICE when building legion-23.03.0 since r14-8398

2024-02-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113757

Jakub Jelinek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2024-02-04
Summary|[14 regression] ICE when|[14 regression] ICE when
   |building legion-23.03.0 |building legion-23.03.0
   ||since r14-8398
 CC||jakub at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
   Priority|P3  |P1

--- Comment #4 from Jakub Jelinek  ---
Started with r14-8398-ga9a8426e534760b8d3a250e9bd3cff4db131a2be

[Bug middle-end/113759] New: [14 regression] ICE when building fdk-aac-2.0.3

2024-02-04 Thread sjames at gcc dot gnu.org via Gcc-bugs
df20753cdc35d710'
--with-gcc-major-version-only --enable-libstdcxx-time --enable-lto
--disable-libstdcxx-pch --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --disable-multilib
--disable-fixed-point --enable-libgomp --disable-libssp --disable-libada
--disable-cet --disable-systemtap --disable-valgrind-annotations
--disable-vtable-verify --disable-libvtv --with-zstd --without-isl
--enable-default-pie --enable-host-pie --enable-host-bind-now
--enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240204 (experimental)
2ada8bc53e1924b805d5a623d7ce79b20c2a9feb (Gentoo Hardened 14.0.1 p, commit
3ab6b70bf9ee185da7e092e1df20753cdc35d710)
```

I can reproduce with just g++ -c rvlcconceal.ii -O2.

[Bug middle-end/113759] [14 regression] ICE when building fdk-aac-2.0.3

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113759

Andrew Pinski  changed:

   What|Removed |Added

 CC||pinskia at gcc dot gnu.org
   Keywords||ice-on-valid-code
   Target Milestone|--- |14.0

[Bug middle-end/113759] [14 regression] ICE when building fdk-aac-2.0.3

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113759

--- Comment #1 from Andrew Pinski  ---
I suspect r14-8680-g2f14c0dbb78985 .

[Bug middle-end/113759] [14 regression] ICE when building fdk-aac-2.0.3 since r14-8680

2024-02-04 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113759

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[14 regression] ICE when|[14 regression] ICE when
   |building fdk-aac-2.0.3  |building fdk-aac-2.0.3
   ||since r14-8680
   Priority|P3  |P1
 Status|UNCONFIRMED |NEW
 CC||jakub at gcc dot gnu.org
   Last reconfirmed||2024-02-04
 Ever confirmed|0   |1

--- Comment #2 from Jakub Jelinek  ---
Your suspection is right.  I'll have a look tomorrow^H^H^H^H^H^H^Hlater today.

[Bug middle-end/113759] [14 regression] ICE when building fdk-aac-2.0.3 since r14-8680

2024-02-04 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113759

--- Comment #3 from Sam James  ---
reduced:
```
typedef struct {
  struct {
struct {
  int erRvlcInfo;
  short aRvlcScfFwd[];
} aac;
  } overlay;
} CAacDecoderCommonData;
int calcRefValFwd_refNrgFwd, calcRefValFwd_conceal_group_min,
calcRefValFwd_bnds, calcRefValFwd_startBand;
CAacDecoderCommonData calcRefValFwd_pAacDecoderChannelInfo_1;
void calcRefValFwd() {
  for (; calcRefValFwd_conceal_group_min >= 0;
   calcRefValFwd_conceal_group_min--) {
for (; calcRefValFwd_startBand >= 0; calcRefValFwd_startBand--) {
  calcRefValFwd_bnds =
  calcRefValFwd_conceal_group_min + calcRefValFwd_startBand;
  calcRefValFwd_refNrgFwd = calcRefValFwd_pAacDecoderChannelInfo_1.overlay
.aac.aRvlcScfFwd[calcRefValFwd_bnds];
  calcRefValFwd_pAacDecoderChannelInfo_1.overlay.aac
  .aRvlcScfFwd[calcRefValFwd_bnds] = 0;
}
calcRefValFwd_startBand = 1;
  }
}
```

[Bug middle-end/113759] [14 regression] ICE when building fdk-aac-2.0.3 since r14-8680

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113759

--- Comment #4 from Andrew Pinski  ---
Reduced slightly further:
```
extern short t[];
int f(int c, int b) {
  if (b < 0)  __builtin_unreachable();
  if (c <= 0)  __builtin_unreachable();
  int d;
  for (; c >= 0; c--) 
{
  int a = b + c;
  d = t[a];
  t[a] = 0;
}
return d;
}
```

Note this requires IV-OPTS to get the IR that fails. It might be best if that
IR is converted into a gimple testcase too.

[Bug middle-end/113759] [14 regression] ICE when building fdk-aac-2.0.3 since r14-8680

2024-02-04 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113759

--- Comment #5 from Sam James  ---
in future, I really need to rename variables too, as it's way easier to see
what's going on then

[Bug middle-end/113750] [14 Regression] ICE in vect building gcc/m2/gm2-libs/NumberIO.mod since r14-8769-g64b0130bb6702c

2024-02-04 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113750

Sam James  changed:

   What|Removed |Added

Summary|[14 Regression] ICE in vect |[14 Regression] ICE in vect
   |building|building
   |gcc/m2/gm2-libs/NumberIO.mo |gcc/m2/gm2-libs/NumberIO.mo
   |d   |d since
   ||r14-8769-g64b0130bb6702c
   Assignee|unassigned at gcc dot gnu.org  |gaius at gcc dot gnu.org

--- Comment #5 from Sam James  ---
(assigning to ga...@gcc.gnu.org as assuming that was the intention, feel free
to fix if not)

[Bug target/106531] -march=rv32iabmc should also enable zba, zbb, zbc, zbs

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106531

Andrew Pinski  changed:

   What|Removed |Added

   Assignee|pinskia at gcc dot gnu.org |unassigned at gcc dot 
gnu.org
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2024-02-05
 Ever confirmed|0   |1

--- Comment #4 from Andrew Pinski  ---
Looks like binutils is going to add b:
https://sourceware.org/pipermail/binutils/2024-February/132302.html

GCC most likely will be updated a little afterwards.

No longer working on this right now.

[Bug target/112896] RISC-V: gcc.dg/pr30957-1.c run failure when rv64gcv_zvl1024b_zvfh_zfh

2024-02-04 Thread pan2.li at intel dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112896

Li Pan  changed:

   What|Removed |Added

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

--- Comment #2 from Li Pan  ---
This testcase is not well designed, removed from upstream and close this
bugzilla.

[Bug tree-optimization/113757] [14 regression] ICE when building legion-23.03.0 since r14-8398

2024-02-04 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113757

--- Comment #5 from Sam James  ---
reduced but with return-type UB:
```
template  struct __alloc_traits {
  typedef typename _Alloc::value_type &const_reference;
};
struct LegionAllocator {
  typedef int value_type;
};
struct vector {
  long size() const;
  __alloc_traits::const_reference operator[](long) const;
};
void __assert_fail();
template  using LegionVector = vector;
struct TaskOp {
  virtual int &get_version_info();
} *slice_owner;
struct PointTask {
  virtual const int &get_version_info() const;
  LegionVector version_infos;
};
int &TaskOp::get_version_info() { __assert_fail(); }
const int &PointTask::get_version_info() const {
  if (version_infos.size())
return version_infos[0];
  return slice_owner->get_version_info();
}
```

[Bug tree-optimization/113757] [14 regression] ICE when building legion-23.03.0 since r14-8398

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113757

Andrew Pinski  changed:

   What|Removed |Added

   Keywords|needs-reduction |

--- Comment #6 from Andrew Pinski  ---
Reduced a little further without the undefinedness but with a noreturn function
in use (which is important for the ICE here):
```
long size();
struct ll {  virtual int hh();  };
ll  *slice_owner;
int ll::hh() { __builtin_exit(0); }
int nn() {
  if (size())
return 0;
  return slice_owner->hh();
}
int (*a)() = nn;
```

Note the decl a is needed to force nn to have its address taken (simulating a
virtual function).

[Bug tree-optimization/113583] Main loop in 519.lbm not vectorized.

2024-02-04 Thread juzhe.zhong at rivai dot ai via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113583

--- Comment #11 from JuzheZhong  ---
Hi, I think this RVV compiler codegen is that optimal codegen we want for RVV:

https://repo.hca.bsc.es/epic/z/P6QXCc

.LBB0_5:# %vector.body
sub a4, t0, a3
vsetvli t1, a4, e64, m1, ta, mu
mul a2, a3, t2
add a5, t3, a2
vlse64.vv8, (a5), t2
add a4, a6, a2
vlse64.vv9, (a4), t2
add a4, a0, a2
vlse64.vv10, (a4), t2
vfadd.vvv8, v8, v9
vfmul.vfv8, v8, fa5
vfadd.vfv9, v10, fa4
vfmadd.vf   v9, fa3, v10
vlse64.vv10, (a5), t2
add a4, a1, a2
vsse64.vv9, (a4), t2
vfadd.vfv8, v8, fa2
vfmadd.vf   v8, fa3, v10
vfadd.vfv8, v8, fa1
add a2, a2, a7
add a3, a3, t1
vsse64.vv8, (a2), t2
bne a3, t0, .LBB0_5

[Bug c++/113760] New: gcc rejects valid empty-declaration in pedantic mode

2024-02-04 Thread tanksherman27 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113760

Bug ID: 113760
   Summary: gcc rejects valid empty-declaration in pedantic mode
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tanksherman27 at gmail dot com
  Target Milestone: ---

In https://github.com/openjdk/jdk/pull/17687#issuecomment-1926154325 we
discovered a possible g++ bug where g++ rejects empty semicolons in pedantic
mode, this is rather evident in code like

#define DEBUG_ONLY(code) code;

DEBUG_ONLY(foo());

which will fire a -Werror warning even in C++11 and above, where such empty
declarations are allowed

[Bug c++/113760] gcc rejects valid empty-declaration in pedantic mode

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113760

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed||2024-02-05
 Status|UNCONFIRMED |WAITING
 Ever confirmed|0   |1

--- Comment #1 from Andrew Pinski  ---
I can't reproduce this at all.
I tried:
```
void foo();
#define DEBUG_ONLY(code) code;

void f() {
DEBUG_ONLY(foo());
}
```

The only time I can reproduce an error is:
```
;
```

And with `-std=c++98 -W -Wall -pedantic-errors`.

Can you provide a full example where you are getting into an issue?

[Bug c++/113760] gcc rejects valid empty-declaration in pedantic mode

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113760

Andrew Pinski  changed:

   What|Removed |Added

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

--- Comment #2 from Andrew Pinski  ---
Or is it just a dup of bug 96068 ? Which was fixed in GCC 11.1.0. GCC 10.5.0
was the last released of the GCC 10 branch. And GCC 9 is also in this mode.

[Bug c++/113760] gcc rejects valid empty-declaration in pedantic mode

2024-02-04 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113760

--- Comment #3 from Andrew Pinski  ---
>From JDK bug report:
> It looks like it only removed
> the warnings for empty declarations at namespace scope. I couldn't find
> anything for other cases, including empty class member declarations.

Yes because the C++ defect report was only for `Spurious semicolons at
namespace scope should be allowed`.  See
https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#569 .


```
struct f
{
  int t;  ;
};
```

Is not allowed by the C++ standard currently and is a GCC extension, maybe it
should have a seperate flag to control that but I am not 100% sure.

[Bug middle-end/113750] [14 Regression] ICE in vect building gcc/m2/gm2-libs/NumberIO.mod since r14-8769-g64b0130bb6702c

2024-02-04 Thread tnfchris at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113750

Tamar Christina  changed:

   What|Removed |Added

   Assignee|gaius at gcc dot gnu.org   |tnfchris at gcc dot 
gnu.org

--- Comment #6 from Tamar Christina  ---
I assumed that labels could only still be present at this point of the CFG only
to deal with control flow from e.g. switch statements which we reject earlier.

It seems that these labels are an artifact of the front-end and are dead by the
time they reach vect but still there in the IL.

I'll add a quick check for if they are and can set the stores before the last
non-debug statement.

Testing a patch.

[Bug target/113255] [11/12/13 Regression] wrong code with -O2 -mtune=k8

2024-02-04 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113255

--- Comment #17 from GCC Commits  ---
The master branch has been updated by Richard Biener :

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

commit r14-8796-g5b281946c4b51132caf5e5b64c730fef92dd6123
Author: Richard Biener 
Date:   Thu Feb 1 13:54:11 2024 +0100

target/113255 - avoid REG_POINTER on a pointer difference

The following avoids re-using a register holding a pointer (and
thus might be REG_POINTER) for the result of a pointer difference
computation.  That might confuse heuristics in (broken) RTL alias
analysis which relies on REG_POINTER indicating that we're
dealing with one.

This alone doesn't fix anything.

PR target/113255
* config/i386/i386-expand.cc
(expand_set_or_cpymem_prologue_epilogue_by_misaligned_moves):
Use a new pseudo for the skipped number of bytes.