[Bug target/106438] powerpc: ICE when building libgfortran with -flto: in insert_value_copy_on_edge, at tree-outof-ssa.cc:334

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106438

Richard Biener  changed:

   What|Removed |Added

 Target||powerpc64le
  Component|tree-optimization   |target

--- Comment #4 from Richard Biener  ---
Quite probably a target issue, since -flto investigation is difficult without
native access lets see if target folks can get a handle on this (hint: reduce
the testcase to a few input files)

[Bug target/106442] Build time error "vadd.i32 q3, q3, q0'" in case of -mcpu=cortex-m55+nofp+nomve.fp

2022-07-26 Thread sherry.zhang2 at arm dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106442

--- Comment #3 from sherry.zhang2 at arm dot com ---
Created attachment 53355
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53355&action=edit
C Source code

[Bug target/106442] Build time error "vadd.i32 q3, q3, q0'" in case of -mcpu=cortex-m55+nofp+nomve.fp

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

--- Comment #4 from Andrew Pinski  ---
A picture is not the source.
But this looks more like a bug in either your inline-asm or how you invoke gcc.

[Bug target/106442] Build time error "vadd.i32 q3, q3, q0'" in case of -mcpu=cortex-m55+nofp+nomve.fp

2022-07-26 Thread sherry.zhang2 at arm dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106442

--- Comment #5 from sherry.zhang2 at arm dot com ---
(In reply to Andrew Pinski from comment #4)
> A picture is not the source.
> But this looks more like a bug in either your inline-asm or how you invoke
> GCC.

Logs after adding -v to GCC:
COLLECT_GCC_OPTIONS= '-mcpu=cortex-m55+nomve.fp' '-v' '-O3' '-D' 'NDEBUG'
'-specs=nano.specs' '-Wall' '-Wformat=0' '-Wno-return-type'
'-Wno-unused-but-set-variable' '-c' '-fdata-sections' '-ffunction-sections'
'-fno-builtin' '-fshort-enums' '-funsigned-char' '-mthumb' '-nostdlib'
'-std=c99' '-g' '-mfloat-abi=soft' '-mcmse' '-Wno-unused-value' '-o'
'CMakeFiles/tfm_spm.dir/cmsis_psa/arch/tfm_arch_v8m_main.o' '-c'
'-mlibarch=armv8.1-m.main+mve' '-march=armv8.1-m.main+mve' 

The same source code can build without error if I enable FP
with
COLLECT_GCC_OPTIONS='-mcpu=cortex-m55' '-v' '-O3' '-D' 'NDEBUG'
'-specs=nano.specs' '-Wall' '-Wformat=0' '-Wno-return-type'
'-Wno-unused-but-set-variable' '-c' '-fdata-sections' '-ffunction-sections'
'-fno-builtin' '-fshort-enums' '-funsigned-char' '-mthumb' '-nostdlib'
'-std=c99' '-g' '-mfloat-abi=hard' '-mfpu=fpv5-d16' '-mcmse'
'-Wno-unused-value' '-o'
'CMakeFiles/tfm_spm.dir/cmsis_psa/arch/tfm_arch_v8m_main.o' '-c'
'-mlibarch=armv8.1-m.main+fp.dp+mve' '-march=armv8.1-m.main+fp.dp+mve'

[Bug modula2/106443] New: Many 32-bit tests FAIL to link on Solaris/sparcv9

2022-07-26 Thread ro at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106443

Bug ID: 106443
   Summary: Many 32-bit tests FAIL to link on Solaris/sparcv9
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: modula2
  Assignee: gaius at gcc dot gnu.org
  Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
  Host: sparcv9-sun-solaris2.11
Target: sparcv9-sun-solaris2.11
 Build: sparcv9-sun-solaris2.11

As of 20220726, 2000+ 32-bit gm2 tests FAIL on Solaris/sparcv9, while the
64-bit
tests are ok.  The failure mode seems always to be the same:

spawn -ignore SIGHUP /var/gcc/modula-2/11.4-gcc-64-modula-2/gcc/gm2
-B/var/gcc/modula-2/11.4-gcc-64-modula-2/gcc
-I/var/gcc/modula-2/11.4-gcc-64-modula-2/sparcv9-sun-solaris2.11/sparcv8plus/libgm2/libm2pim:/vol/gcc/src/hg/master/modula-2/gcc/testsuite/../m2/gm2-libs
-I/var/gcc/modula-2/11.4-gcc-64-modula-2/sparcv9-sun-solaris2.11/sparcv8plus/libgm2/libm2iso:/vol/gcc/src/hg/master/modula-2/gcc/testsuite/../m2/gm2-libs-iso
-I/vol/gcc/src/hg/master/modula-2/gcc/testsuite/gm2/calling-c/datatypes/unbounded/run/pass
-fpim
-L/var/gcc/modula-2/11.4-gcc-64-modula-2/sparcv9-sun-solaris2.11/sparcv8plus/libgm2/libm2pim/.libs
-L/var/gcc/modula-2/11.4-gcc-64-modula-2/sparcv9-sun-solaris2.11/sparcv8plus/libgm2/libm2iso/.libs
-fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers
-fdiagnostics-color=never
/vol/gcc/src/hg/master/modula-2/gcc/testsuite/gm2/calling-c/datatypes/unbounded/run/pass/m.mod
-m32 -fdiagnostics-plain-output c.o -fno-libs=-
-L/var/gcc/modula-2/11.4-gcc-64-modula-2/sparcv9-sun-solaris2.11/sparcv8plus/libstdc++-v3/src/.libs
-L/var/gcc/modula-2/11.4-gcc-64-modula-2/sparcv9-sun-solaris2.11/sparcv8plus/libstdc++-v3/src/.libs
-lm -o /var/gcc/modula-2/11.4-gcc-64-modula-2/gcc/testsuite/gm2/m.x0
Undefined   first referenced
 symbol in file
_M2_termios_ctor/var/tmp//cc1CQWRd.o
M2RTS_DeconstructModules/var/tmp//cc1CQWRd.o
_M2_M2EXCEPTION_ctor/var/tmp//cc1CQWRd.o
_M2_SysStorage_ctor /var/tmp//cc1CQWRd.o
M2RTS_ConstructModules  /var/tmp//cc1CQWRd.o
_M2_SysStorage_ctor /var/tmp//cc1CQWRd.o
M2RTS_ConstructModules  /var/tmp//cc1CQWRd.o
_M2_SYSTEM_ctor /var/tmp//cc1CQWRd.o
_M2_RTExceptions_ctor   /var/tmp//cc1CQWRd.o
_M2_Indexing_ctor   /var/tmp//cc1CQWRd.o
M2RTS_RequestDependant  /var/tmp//cc1CQWRd.o
_M2_errno_ctor  /var/tmp//cc1CQWRd.o
_M2_StrLib_ctor /var/tmp//cc1CQWRd.o
_M2_SysExceptions_ctor  /var/tmp//cc1CQWRd.o
_M2_M2RTS_ctor  /var/tmp//cc1CQWRd.o
_M2_Storage_ctor/var/tmp//cc1CQWRd.o
_M2_M2Dependent_ctor/var/tmp//cc1CQWRd.o
M2RTS_HALT  /var/tmp//cc1CQWRd.o
_M2_NumberIO_ctor   /var/tmp//cc1CQWRd.o
_M2_Debug_ctor  /var/tmp//cc1CQWRd.o
M2RTS_RegisterModule/var/tmp//cc1CQWRd.o
_M2_FIO_ctor/var/tmp//cc1CQWRd.o
_M2_ASCII_ctor  /var/tmp//cc1CQWRd.o
_M2_IO_ctor /var/tmp//cc1CQWRd.o
_M2_StdIO_ctor  /var/tmp//cc1CQWRd.o
_M2_StrIO_ctor  /var/tmp//cc1CQWRd.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
compiler exited with status 1
FAIL: gm2/calling-c/datatypes/unbounded/run/pass/m.mod compilation,  -g
unsuccessful link

[Bug tree-optimization/106444] New: vrange_printer::visit ICEs

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106444

Bug ID: 106444
   Summary: vrange_printer::visit ICEs
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

For the testcase in PR105651 I see with -fdump-tree-all:

t.C: In function ‘std::string f()’:
t.C:3:13: internal compiler error: tree check: expected integer_cst, have
addr_expr in to_wide, at tree.h:6205
3 | bool test(std::array& a, std::array& b)
  | ^
0x1cd3d8d tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/space/rguenther/src/gcc/gcc/tree.cc:8817
0xbb7be1 tree_check(tree_node const*, char const*, int, char const*, tree_code)
/space/rguenther/src/gcc/gcc/tree.h:3764
0xc5235a wi::to_wide(tree_node const*)
/space/rguenther/src/gcc/gcc/tree.h:6205
0x1d0ab22 irange::legacy_upper_bound(unsigned int) const
/space/rguenther/src/gcc/gcc/value-range.cc:875
0x112a26d irange::upper_bound(unsigned int) const
/space/rguenther/src/gcc/gcc/value-range.h:935
0x1d1bd9d vrange_printer::visit(irange const&) const
/space/rguenther/src/gcc/gcc/value-range-pretty-print.cc:69
0x1d08349 irange::accept(vrange_visitor const&) const
/space/rguenther/src/gcc/gcc/value-range.cc:37
0x1d088d0 vrange::dump(_IO_FILE*) const
/space/rguenther/src/gcc/gcc/value-range.cc:227
0x1d1b730 value_range_equiv::dump(_IO_FILE*) const
/space/rguenther/src/gcc/gcc/value-range-equiv.cc:287
0x1d1b8b1 dump_value_range(_IO_FILE*, value_range_equiv const*)
/space/rguenther/src/gcc/gcc/value-range-equiv.cc:317
0x1d7ec2a vr_values::dump(_IO_FILE*)
/space/rguenther/src/gcc/gcc/vr-values.cc:1861
0x1cafed6 vrp_prop::finalize()
/space/rguenther/src/gcc/gcc/tree-vrp.cc:4005
0x1cb0618 execute_vrp
/space/rguenther/src/gcc/gcc/tree-vrp.cc:4218
0x1cb0aef execute
/space/rguenther/src/gcc/gcc/tree-vrp.cc:4433
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.

that's because vrange_printer::visit doesn't handle symbolic ranges.

[Bug tree-optimization/106444] vrange_printer::visit ICEs

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106444

Richard Biener  changed:

   What|Removed |Added

 CC||aldyh at gcc dot gnu.org

--- Comment #1 from Richard Biener  ---
Btw,

  tree lb = wide_int_to_tree (r.type (), r.lower_bound (i));
  tree ub = wide_int_to_tree (r.type (), r.upper_bound (i));

is totally ugly - we have wide_int pp_, and for ranges with tree storage
we can print the tree directly (also avoiding the ICE).

[Bug tree-optimization/106444] vrange_printer::visit ICEs

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106444

--- Comment #2 from Richard Biener  ---
hmm, but r.symbolic_p returns false.  Ah, because it's "wrong" in the way
of treating &MEM  [(void *)&D.42061 + 16B] as not symbolic
(it's an address constant).  It's still not an irange though?

[Bug c++/106435] constructor of thread_local static member is not called

2022-07-26 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106435

Iain Sandoe  changed:

   What|Removed |Added

  Component|middle-end  |c++
  Known to fail||10.4.0
 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |iains at gcc dot gnu.org

--- Comment #9 from Iain Sandoe  ---
actually, since this is unimplemented for emuTLS - it fails everywhere for
emuTLS targets and C++11+.

[Bug rtl-optimization/106419] ICE in lra_assign, at lra-assigns.cc:1649

2022-07-26 Thread linkw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106419

Kewen Lin  changed:

   What|Removed |Added

 Status|WAITING |NEW

--- Comment #5 from Kewen Lin  ---
Thanks for the configuration command and dump. By looking into them, I found
the difference is "--enable-secureplt", with one rebuilt cross binutils with
--enable-secureplt, I am able to reproduce this now.

[Bug tree-optimization/106444] vrange_printer::visit ICEs

2022-07-26 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106444

Aldy Hernandez  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |aldyh at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2022-07-26
 Ever confirmed|0   |1

--- Comment #3 from Aldy Hernandez  ---
(In reply to Richard Biener from comment #2)
> hmm, but r.symbolic_p returns false.  Ah, because it's "wrong" in the way
> of treating &MEM  [(void *)&D.42061 + 16B] as not symbolic
> (it's an address constant).  It's still not an irange though?

Ughh, that looks totally broken, and probably seeped in because only legacy VRP
saw these ranges.  I'm hesitant to fix any of this, as it's all slated for
removal shortly.

The pretty printer for irange incorrectly assumes irange's are free from all
this symbolic stuff.  Perhaps we could special case the !r.constant_p() case
and just print the trees.  I'd like to keep the loop going over wide_ints, as
we're eventually going to wide ints later this cycle.

I didn't know about pp_wide_integer.  If it works the same as going through the
tree, I'll gladly change the code.

Thanks for looking into this.

[Bug target/106445] New: nvptx offloading: C++ constructor symbol alias getting lost

2022-07-26 Thread tschwinge at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106445

Bug ID: 106445
   Summary: nvptx offloading: C++ constructor symbol alias getting
lost
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Keywords: openmp, wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tschwinge at gcc dot gnu.org
CC: vries at gcc dot gnu.org
  Target Milestone: ---
Target: nvptx

I found this during my "GPU support for minimal C++ library" investigations,
PR101544.  You're not currently able to reproduce this, as it depends on a
number of WIP patches, but I'm filing it for later reference.  (Or, I suppose
could maybe come up with a non-C++ reproducer.)  I've not yet looked through
the existing nvptx symbol alias issues in detail.  I've also not yet tried
reproducing the issue without offloading, with a nvptx target toolchain.


Simple 'std::vector v;' in OpenMP 'target', '-O0', host-side
'-fno-exceptions', '-foffload-options=nvptx-none=-malias\ -mptx=6.3' works for
GCN, but fails to compile for nvptx:

ptxas ./a.xnvptx-none.mkoffload.o, line 243; error   : Label expected for
argument 0 of instruction 'call'
ptxas ./a.xnvptx-none.mkoffload.o, line 243; error   : Function
'_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev' not declared in this scope

$ c++filt _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev
std::_Vector_base >::_Vector_impl::_Vector_impl()

Looking for '_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev':

For all host/device '-fdump-tree-all-raw-asmname', we only ever see:

gimple_call <_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev, NULL, _1>

Correspondingly, for all device '-fdump-rtl-all-raw-asmname':

(call (mem:QI (symbol_ref:DI
("_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev") [flags 0x3]  ) [0 _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev S1
A8])

In 'a.xnvptx-none.mkoffload.s' only ever:

call _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev, (%out_arg1);

In 'a.xamdgcn-amdhsa.mkoffload.1.s' however:

s_add_u32   s2, s2,
_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev@rel32@lo+4
s_addc_u32  s3, s3,
_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev@rel32@hi+4

..., but also:

.set   
_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev,_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev

..., that is, a symbol alias (C++ constructors) -- that's missing for nvptx.

Looking for '_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev':

There is no (relevant) difference in device '-fdump-tree-all-raw-asmname'
'*.094t.fixup_cfg3' and still not '*.253t.optimized'.

There is no (relevant) difference in device '-fdump-rtl-all-raw-asmname'
'*.254r.expand' and still not (approximately) '*.333r.final'.

That is, '_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev' is still present in
nvptx '*.333r.final'.

In 'a.xamdgcn-amdhsa.mkoffload.1.s':

.type   _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev,@function
_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev:
[...]
.size   _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev,
.-_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev
.set   
_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev,_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev

In 'a.xnvptx-none.mkoffload.s':

// BEGIN FUNCTION DECL: _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev
.func _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev (.param.u64 %in_ar0);

// BEGIN FUNCTION DEF: _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev
.func _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev (.param.u64 %in_ar0)
{
[...]
}

..., but not followed by a '.alias'.


In case that's relevant (... for nvptx...): the difference for a very similar
'_ZNSt6vectorIiSaIiEEC1Ev' -> '_ZNSt6vectorIiSaIiEEC2Ev' symbol alias (which
does get defined for both GCN and nvptx) is that the use of
'_ZNSt6vectorIiSaIiEEC1Ev' appears after definition of
'_ZNSt6vectorIiSaIiEEC2Ev' and its '_ZNSt6vectorIiSaIiEEC1Ev' alias, but for
the '_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev' reported above, the use
appears before the '_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev' function and
'_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev' ->
'_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev' symbol alias definitions (the
latter missing for nvptx).

---

Similar issue (but different constructor) for 'std::vector v(100);'.

[Bug rtl-optimization/106419] ICE in lra_assign, at lra-assigns.cc:1649

2022-07-26 Thread linkw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106419

Kewen Lin  changed:

   What|Removed |Added

 CC||bergner at gcc dot gnu.org,
   ||segher at gcc dot gnu.org,
   ||vmakarov at gcc dot gnu.org

--- Comment #6 from Kewen Lin  ---
>From the ICE point:

  if (! lra_hard_reg_split_p && ! lra_asm_error_p && flag_checking)
/* Check correctness of allocation but only when there are no hard reg
   splits and asm errors as in the case of errors explicit insns involving
   hard regs are added or the asm is removed and this can result in
   incorrect allocation.  */
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
  if (lra_reg_info[i].nrefs != 0
  && reg_renumber[i] >= 0
  && overlaps_hard_reg_set_p (lra_reg_info[i].conflict_hard_regs,
  PSEUDO_REGNO_MODE (i), reg_renumber[i]))
gcc_unreachable ();

this is similar to PR97978. I commented out the line gcc_unreachable(), the
resulted assembly looks fine to me. It's able to spill the value into one stack
slot, it's reloaded after the second indirect call (though the code is very
poor but it's at -Og).

mr 3,14  // ctr doesn't conflict with r3
mfctr 9
mtctr 9
stw 9,36(1)  // saved
crxor 6,6,6
bctrl
mr 5,18
lwz 7,160(1)
mr 4,7
lwz 6,152(1)
mr 3,6
lwz 12,28(1)
mtctr 12
crxor 6,6,6
bctrl
lfs 0,.LC2@l(31)
lfs 12,0(24)
fcmpu 0,12,0
lwz 12,28(1)
lwz 6,152(1)
lwz 7,160(1)
lwz 9,36(1)  // reload
mtctr 9  // make it live in ctr

IMHO, this is very likely a LRA issue, maybe the assert condition is too
strict.

[Bug c++/106369] [12/13 Regression] ICE in output_constructor_regular_field, at varasm.cc:5515 since r12-2975-g32c3a75390623a

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

--- Comment #10 from Jakub Jelinek  ---
Slightly further reduced:

struct A {
  int a[256];
  constexpr int &operator[] (int n) noexcept { return a[n]; }
  constexpr const int &operator[] (int n) const noexcept { return a[n]; }
};
struct B {};
template 
struct C {
  constexpr T &foo (const char x) noexcept { c = T::d[x]; return static_cast(*this); }
  int c;
};
struct D : public C, public B
{
  constexpr D () noexcept = default;
  static constexpr char e[9] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I' };
  static constexpr A d = [] () constexpr {
A f {};
for (int i = 0; i < 9; ++i)
  f[e[i]] = 1;
return f;
  } ();
};
constexpr auto g = D{}.foo ('E');

[Bug c++/106369] [12/13 Regression] ICE in output_constructor_regular_field, at varasm.cc:5515 since r12-2975-g32c3a75390623a

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

--- Comment #11 from Jakub Jelinek  ---
And that testcase has been rejected before r10-5194-g7906797ebec6881d and ICEs
since that revision.

[Bug tree-optimization/106249] [13 Regression] ICE in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:645 since r13-1450-gd2a898666609452e

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

--- Comment #9 from Jakub Jelinek  ---
Related to PR106099

[Bug tree-optimization/106444] vrange_printer::visit ICEs

2022-07-26 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106444

--- Comment #4 from Aldy Hernandez  ---
Created attachment 53356
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53356&action=edit
patch in testing

[Bug target/106442] Build time error "vadd.i32 q3, q3, q0'" in case of -mcpu=cortex-m55+nofp+nomve.fp

2022-07-26 Thread rearnsha at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106442

--- Comment #6 from Richard Earnshaw  ---
possibly a dup of pr101723.  Please try gcc-11.3

[Bug c++/98735] ICE with -std=c++20 -fmodules-ts -fsanitize=undefined

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

Jonathan Wakely  changed:

   What|Removed |Added

   Last reconfirmed|2021-01-18 00:00:00 |2022-7-26

--- Comment #1 from Jonathan Wakely  ---
mod.C:1:8: internal compiler error: in tree_node, at cp/module.cc:9192
1 | export module X;
  |^~
0x6e1d98 trees_out::tree_node(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:9192
0xa93753 trees_out::core_vals(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:6028
0xa96e14 trees_out::tree_node_vals(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:7176
0xa96e14 trees_out::tree_value(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:9014
0xa92c41 trees_out::tree_node(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:9212
0xa93753 trees_out::core_vals(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:6028
0xa96e14 trees_out::tree_node_vals(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:7176
0xa96e14 trees_out::tree_value(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:9014
0xa92c41 trees_out::tree_node(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:9212
0xa93889 trees_out::core_vals(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:6219
0xa96e14 trees_out::tree_node_vals(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:7176
0xa96e14 trees_out::tree_value(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:9014
0xa92c41 trees_out::tree_node(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:9212
0xa96f52 trees_out::write_function_def(tree_node*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:11472
0xa991d4 depset::hash::find_dependencies(module_state*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:13250
0xa99670 module_state::write_begin(elf_out*, cpp_reader*, module_state_config&,
unsigned int&)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:17816
0xa9aa94 finish_module_processing(cpp_reader*)
/home/jwakely/src/gcc/gcc/gcc/cp/module.cc:20150
0xa2849f c_parse_final_cleanups()
/home/jwakely/src/gcc/gcc/gcc/cp/decl2.cc:5156
0xc4dbd0 c_common_parse_file()
/home/jwakely/src/gcc/gcc/gcc/c-family/c-opts.cc:1253
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/106442] Build time error "vadd.i32 q3, q3, q0'" in case of -mcpu=cortex-m55+nofp+nomve.fp

2022-07-26 Thread sherry.zhang2 at arm dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106442

--- Comment #7 from sherry.zhang2 at arm dot com ---
(In reply to Richard Earnshaw from comment #6)
> possibly a dup of pr101723.  Please try gcc-11.3

The latest version I can get is 11.2
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/downloads.
Has GCC 11.3 been published?

[Bug tree-optimization/105651] [12/13 Regression] bogus "may overlap" memcpy warning with std::string and operator+ at -O3

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651

Richard Biener  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Status|NEW |ASSIGNED
 CC||jakub at gcc dot gnu.org,
   ||jwakely at redhat dot com

--- Comment #10 from Richard Biener  ---
ISTR seeing this before.  We are quite confused by the standard library code
comparing the address of a string literal with the local buffer:

MEM[(char_type &)&D.42061 + 17] = 32;
if (&D.42061.D.33506._M_local_buf >= &MEM  [(void *)"_" + 1B])
  goto ; [50.00%]
else
  goto ; [50.00%]

if (&D.42061.D.33506._M_local_buf <= "_")
  goto ; [50.00%]
else
  goto ; [50.00%]

 [local count: 21728216]:
_97 = &D.42061.D.33506._M_local_buf - "_";
if (_97 == 1)
  goto ; [34.00%]
else
  goto ; [66.00%]

and we are afraid of optimizing relational compares of distinct objects
(well, that's simply undefined and good QOI is to DWIM, simply leave the
broken code around if there's no good way to choose true or false).

This is all preceeded by an "overlap condition" working on integers
(so not undefined), so what might work is to aggressively simplify
relational compares of known distinct objects to __builtin_unreachable ()
(aka isolate the errorneous path).

 [local count: 1073741824]:
MEM[(struct basic_string *)&D.42061] ={v} {CLOBBER};
MEM[(struct _Alloc_hider *)&D.42061] ={v} {CLOBBER};
MEM[(struct _Alloc_hider *)&D.42061]._M_p = &D.42061.D.33506._M_local_buf;
MEM[(char_type &)&D.42061 + 16] = 32;
D.42061._M_string_length = 1;
__x.25_69 = (long unsigned int) "_";
__y.26_70 = (long unsigned int) &D.42061.D.33506._M_local_buf;
if (__x.25_69 < __y.26_70)
  goto ; [50.00%]
else
  goto ; [50.00%]

 [local count: 347651448]:
__x.25_72 = (long unsigned int) &MEM  [(void *)&D.42061 + 17B];
if (__x.25_69 > __x.25_72)
  goto ; [50.00%]
else
  goto ; [50.00%]

Alternatively somehow re-combine the above overlap test and simplify
it statically.  We are getting into

Breakpoint 5, maybe_fold_and_comparisons (type=, code1=GE_EXPR, op1a=, op1b=, code2=GE_EXPR, op2a=,
op2b=, outer_cond_bb=)

we do have a patterns optimizing an overlap test (but not statically folding)
with

/* For pointers @0 and @2 and nonnegative constant offset @1, look for
   expressions like:

   A: (@0 + @1 < @2) | (@2 + @1 < @0)
   B: (@0 + @1 <= @2) | (@2 + @1 <= @0)
...

unfortunately simple matching in match.pd falls foul of the PR105142 fix
given _72 is computed in the inner block and thus
maybe_fold_comparisons_from_match_pd is not going to pick that up.
Without that fix

(for cmp1 (lt le le lt)
 cmp2 (lt le lt le)
(simplify
 (bit_and (cmp1:c (convert@4 @0) (convert @1)) (cmp2:c (convert@5 @2) (convert
@3)))
 (if (TREE_CODE (@0) == ADDR_EXPR
  && TREE_CODE (@1) == ADDR_EXPR
  && TREE_CODE (@2) == ADDR_EXPR
  && TREE_CODE (@3) == ADDR_EXPR
  && INTEGRAL_TYPE_P (TREE_TYPE (@4))
  && types_match (TREE_TYPE (@4), TREE_TYPE (@5)))
  (with { poly_int64 diff0, diff1; }
   (if (ptr_difference_const (@0, @3, &diff0)
&& ptr_difference_const (@1, @2, &diff1)
&& !ptr_derefs_may_alias_p (@0, @1))
{ constant_boolean_node (false, type); })

works to detect this for the case of invariant addresses which have the
offset included.  It would need to be extended for cases where the
increments are variable or the base address is not invariant (but common).

I'm going to improve the PR105142 fix.

[Bug c++/106304] [modules] ICE compiling dynamic_cast in constexpr function (in tree_node, at cp/module.cc:9183)

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

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2022-07-26
   See Also||https://gcc.gnu.org/bugzill
   ||a/show_bug.cgi?id=99769
   Keywords|rejects-valid   |ice-on-valid-code

--- Comment #1 from Jonathan Wakely  ---
Please provide the compiler commands, not just a link to a cmake project on
godbolt, which is a pain to see what it's doing.

Only one file and one command is needed to reproduce this:

export module mod;

template struct A : T {
  constexpr A(T v) : T{v} { }
  ~A() = default; // Fixes GCC.
};

struct B {
  virtual ~B() = default;
};

export inline constexpr auto x = A{B{}};

export constexpr const A* y(const B& b) {
  return dynamic_cast*>(&b);
}


$ g++ -std=c++20 mod.cpp -fmodules-ts -c
mod.cpp:1:8: internal compiler error: in tree_node, at cp/module.cc:9078
1 | export module mod;
  |^~
Please submit a full bug report, with preprocessed source.
See  for instructions.
Preprocessed source stored into /tmp/ccYLb5i0.out file, please attach this to
your bugreport.


Maybe a dup of PR 99769 which fails at the same place in a typeid expression.

[Bug c++/99769] [modules] internal compiler error: in tree_node, at cp/module.cc:9105 when compile module partitions

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

Jonathan Wakely  changed:

   What|Removed |Added

   Last reconfirmed|2021-03-30 00:00:00 |2022-7-26
   Keywords||ice-on-valid-code

--- Comment #3 from Jonathan Wakely  ---
PR 106304 has a much simpler single-file reproducer that ICEs at the same line.

[Bug target/106442] Build time error "vadd.i32 q3, q3, q0'" in case of -mcpu=cortex-m55+nofp+nomve.fp

2022-07-26 Thread rearnsha at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106442

--- Comment #8 from Richard Earnshaw  ---
(In reply to sherry.zhang2 from comment #7)
> (In reply to Richard Earnshaw from comment #6)
> > possibly a dup of pr101723.  Please try gcc-11.3
> 
> The latest version I can get is 11.2
> https://developer.arm.com/tools-and-software/open-source-software/developer-
> tools/gnu-toolchain/downloads. Has GCC 11.3 been published?

https://gcc.gnu.org/pipermail/gcc-announce/2022/000170.html

[Bug tree-optimization/105651] [12/13 Regression] bogus "may overlap" memcpy warning with std::string and operator+ at -O3

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

Jonathan Wakely  changed:

   What|Removed |Added

 CC|jwakely at redhat dot com  |redi at gcc dot gnu.org

--- Comment #11 from Jonathan Wakely  ---
(In reply to Richard Biener from comment #10)
> ISTR seeing this before.

PR 105329 maybe?

[Bug tree-optimization/105651] [12/13 Regression] bogus "may overlap" memcpy warning with std::string and operator+ at -O3

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

--- Comment #12 from Jakub Jelinek  ---
My preference would be still to make the overlap case out-of-line as mentioned
in PR105329, but I don't have statistics on whether the overlap case is really
cold in real-world.  If yes, it would make non-overlap case smaller and the
overlap case tiny bit slower.

[Bug tree-optimization/106099] [13 Regression] ICE in execute_todo, at passes.cc:2134 since r13-1204-gd68d366425369649

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

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #8 from Jakub Jelinek  ---
Created attachment 53357
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53357&action=edit
gcc13-pr106099.patch

Untested fix.

[Bug tree-optimization/105651] [12/13 Regression] bogus "may overlap" memcpy warning with std::string and operator+ at -O3

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

--- Comment #13 from Jonathan Wakely  ---
I think the vast majority of string mutations involve
inserting/appending/substituting an unrelated string, so non-overlapping. We
can make your change on trunk.

[Bug tree-optimization/105651] [12/13 Regression] bogus "may overlap" memcpy warning with std::string and operator+ at -O3

2022-07-26 Thread rguenther at suse dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651

--- Comment #14 from rguenther at suse dot de  ---
On Tue, 26 Jul 2022, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651
> 
> --- Comment #12 from Jakub Jelinek  ---
> My preference would be still to make the overlap case out-of-line as mentioned
> in PR105329, but I don't have statistics on whether the overlap case is really
> cold in real-world.  If yes, it would make non-overlap case smaller and the
> overlap case tiny bit slower.

I would say so.  It's of course still beneficial to optimize the
overlap test if possible.  I'm now testing a series of changes required.

[Bug tree-optimization/106444] vrange_printer::visit ICEs

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

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Aldy Hernandez :

https://gcc.gnu.org/g:2615502971ca11c15f1949c03d93ccfe1ce54f55

commit r13-1840-g2615502971ca11c15f1949c03d93ccfe1ce54f55
Author: Aldy Hernandez 
Date:   Tue Jul 26 11:03:17 2022 +0200

Handle non constant ranges in irange pretty printer.

Technically iranges only exist in constant form, but we allow symbolic
ones before arriving in the ranger, so legacy VRP can work.  This fixes the
ICE when attempting to print symbolic iranges in the pretty printer.

For consistency's sake, I have made sure irange::get_nonzero_bits does
not similarly ICE on a symbolic range, even though no one should be
querying nonzero bits on such a range.  This should all melt away
when legacy disappears, because all these methods are slated for
removal (min, max, kind, symbolic_p, constant_p, etc).

Finally, Richi suggested using pp_wide_int in the pretty printer
instead of going through trees.  I've adapted a test, since
dump_generic_node seems to work slightly different.

PR tree-optimization/106444

gcc/ChangeLog:

* value-range-pretty-print.cc (vrange_printer::visit): Handle
legacy ranges.
(vrange_printer::print_irange_bound): Work on wide_int's.
* value-range-pretty-print.h (print_irange_bound): Same.
* value-range.cc (irange::get_nonzero_bits): Handle legacy ranges.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/evrp4.c: Adjust.

[Bug tree-optimization/106444] vrange_printer::visit ICEs

2022-07-26 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106444

Aldy Hernandez  changed:

   What|Removed |Added

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

--- Comment #6 from Aldy Hernandez  ---
fixed

[Bug tree-optimization/106446] New: -Warray-bounds false positive on downcast under condition

2022-07-26 Thread coillol at yandex dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106446

Bug ID: 106446
   Summary: -Warray-bounds false positive on downcast under
condition
   Product: gcc
   Version: 10.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: coillol at yandex dot ru
  Target Milestone: ---

Minimized example:

---
struct B { int x = 1; };

struct D1 : B {};

struct Data {
  int val = 666;
};

struct D2 : Data, B {
  static bool is_me(const B &b);
};

static int bar(const B &b) {
  if (D2::is_me(b))
return static_cast(b).val;
  return 777;
};

int foo() {
  return bar(D1{});
}
---

Compiling using `g++
(Compiler-Explorer-Build-gcc-789c4b9bb015c361bc1a6adfcd0abadce555e562-binutils-2.38)
13.0.0 20220725 (experimental)` with `-O2 -Wall` there is a warning:

--
In function 'int bar(const B&)',
inlined from 'int foo()' at :20:13:
:15:39: warning: array subscript 0 is outside array bounds of 'D1 [1]'
[-Warray-bounds]
   15 | return static_cast(b).val;
  |   ^~~
: In function 'int foo()':
:20:17: note: at offset -4 into object '' of size 4
   20 |   return bar(D1{});
  |
--

Such behavior is observed with from gcc >= 10.1. Less minimized example --
https://godbolt.org/z/vb786jhfn -- can be reproduced only with gcc >= 12.1.

[Bug target/105617] [12/13 Regression] Slp is maybe too aggressive in some/many cases

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105617

--- Comment #14 from Richard Biener  ---
(In reply to Michael_S from comment #12)
> On related note...
> One of the historical good features of gcc relatively to other popular
> compilers was absence of auto-vectorization at -O2.
> When did you decide to change it and why?

Well, people requested it ... so GCC 12 is now having it (with an extra
eye on code size but this all doesn't work for scalar code vectorization
which OTOH is thought to almost always benefit code size ...).

[Bug target/105617] [12/13 Regression] Slp is maybe too aggressive in some/many cases

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105617

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug libstdc++/105580] [12/13 Regression] warning "potential null pointer dereference" raised when using istreambuf_iterator and any "-O" flag

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105580

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug target/105554] [10/11/12/13 Regression] ICE: in emit_block_move_hints, at expr.cc:1829 since r9-5509-g5928bc2ec06dd4e7

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105554

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug target/105493] [12/13 Regression] x86_64 538.imagick_r 6% regressions and 2% 525.x264_r regressions on Alder Lake after r12-7319-g90d693bdc9d718

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105493

--- Comment #7 from Richard Biener  ---
Can this be considered fixed on trunk?

[Bug target/105463] [11/12 Regression] MVE: Wrong code, incorrect alignment assumption

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105463

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/105458] [12/13 Regression] ICE in set_relation, at value-relation.cc:609 since r12-4790-g4b3a325f07acebf4

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105458

Richard Biener  changed:

   What|Removed |Added

  Known to fail||12.1.0
 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #6 from Richard Biener  ---
Fixed.

[Bug c++/106435] constructor of thread_local static member is not called

2022-07-26 Thread iains at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106435

--- Comment #10 from Iain Sandoe  ---
Created attachment 53358
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53358&action=edit
Patch under test

This works without regression on x86_64 Darwin, now doing wider testing.
The basic approach should be applicable to open (and supported closed)
branches.

[Bug c++/105452] [10/11/12/13 Regression] static_assert inside anonymous union inside a templated struct causes invalid "inaccessible within this context" error

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105452

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug ipa/105438] [11/12/13 Regression] Incorrect array-bounds warning with array size carried over from a previous template instantiation since r11-4987-g602c6cfc79ce4ae6

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105438

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

--- Comment #9 from Richard Biener  ---
Sth should be done about the argument type mismatch though - like changing it
to a "common" type (with open bound?)

[Bug c/105430] [11/12/13 Regression] [DR 413] Change in value for "Partial overriding of constant struct/union initializers with designated initializers"

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105430

Richard Biener  changed:

   What|Removed |Added

 CC||jsm28 at gcc dot gnu.org
   Keywords||needs-bisection

--- Comment #2 from Richard Biener  ---
Not sure if this bug should be better duplicated for tracking - or whether the
actual regression observed here can be fixed independently of the DR413 one.

[Bug testsuite/105427] [12/13 regression] gcc.target/powerpc/pr92398.p9-.c fails after r12-8265-gad56a60f58c1ed

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105427

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Keywords||testsuite-fail

[Bug debug/105415] [10/11/12 Regression] '-fcompare-debug' failure w/ -O2 -ftree-parallelize-loops=2 since r7-4900-g59ec925b1199f9

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105415

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug preprocessor/105412] [10/11/12/13 Regression] Missing phony target with -MP for first include when compiling from stdin

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105412

Richard Biener  changed:

   What|Removed |Added

  Known to work||9.5.0
   Priority|P3  |P2

[Bug testsuite/105267] [12/13 regression] gcc.target/powerpc/pr56605.c fails after r12-8128-g6b7cc7294770ec

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105267

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Keywords||testsuite-fail

[Bug c++/106311] [12/13 Regression] internal compiler error in redeclare_class_template

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

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

https://gcc.gnu.org/g:2333b58c9892667545d0c2c3ecd2d7b947197511

commit r13-1841-g2333b58c9892667545d0c2c3ecd2d7b947197511
Author: Marek Polacek 
Date:   Fri Jul 15 09:51:50 2022 -0400

c++: ICE with erroneous template redeclaration [PR106311]

Here we ICE trying to get DECL_SOURCE_LOCATION of the parm that happens
to be error_mark_node in this ill-formed test.  I kept running into this
while reducing code, so it'd be good to have it fixed.

PR c++/106311

gcc/cp/ChangeLog:

* pt.cc (redeclare_class_template): Check DECL_P before accessing
DECL_SOURCE_LOCATION.

gcc/testsuite/ChangeLog:

* g++.dg/template/redecl5.C: New test.

[Bug tree-optimization/105329] [12/13 Regression] Bogus restrict warning when assigning 1-char string literal to std::string since r12-3347-g8af8abfbbace49e6

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

--- Comment #20 from Jakub Jelinek  ---
Created attachment 53359
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53359&action=edit
gcc13-pr105329.patch

Untested workaround.

[Bug testsuite/106345] Some ppc64le tests fail with -mcpu=power9 -mtune=power9

2022-07-26 Thread linkw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106345

Kewen Lin  changed:

   What|Removed |Added

 CC||seurer at gcc dot gnu.org

--- Comment #4 from Kewen Lin  ---
*** Bug 105427 has been marked as a duplicate of this bug. ***

[Bug testsuite/105427] [12/13 regression] gcc.target/powerpc/pr92398.p9-.c fails after r12-8265-gad56a60f58c1ed

2022-07-26 Thread linkw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105427

Kewen Lin  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE
 CC||linkw at gcc dot gnu.org

--- Comment #4 from Kewen Lin  ---
See comment 1 of PR106345, it's due to incorrect effective target checking.

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

[Bug middle-end/106316] [OpenMP] Auto "declare target" should honor 'declare variant' kind(nohost)

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

--- Comment #1 from Jakub Jelinek  ---
The declare variant directive is just on stub, it doesn't add properties to the
variant function.
I think you need #pragma omp declare target device(host) to (onhost) to make
sure onhost isn't defined for the offloading target.

[Bug tree-optimization/105651] [12/13 Regression] bogus "may overlap" memcpy warning with std::string and operator+ at -O3

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105651

--- Comment #15 from Richard Biener  ---
Note on trunk we get things way less optimized and end up with

   [local count: 695302893]:
  __x.38_144 = (long unsigned int) " ";
  __y.39_145 = (long unsigned int) _137;
  if (__x.38_144 < __y.39_145)
goto ; [50.00%]
  else
goto ; [50.00%]

   [local count: 347651447]:
  _146 = _137 + _128;
  __x.38_147 = (long unsigned int) _146;
  if (__x.38_147 < __x.38_144)
goto ; [50.00%]
  else
goto ; [50.00%]

and ptr_derefs_may_alias_p doesn't work there because to relate _137 and " "
points-to info would need to track STRING_CSTs but it
doesn't do that (we simply drop knowledge here, see find_what_var_points_to
string_id handling).

[Bug lto/91299] LTO inlines a weak definition in presence of a non-weak definition from an ELF file

2022-07-26 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91299

--- Comment #11 from Alexander Monakov  ---
Marxin, you've marked this as WAITING, can you please re-evaluate? The nice
testcase from comment #2 is reproducible on trunk as well.

[Bug tree-optimization/105216] [12/13 regression] 8% regression for m-queens compared to gcc11 O2 on CLX. since r12-3876-g4a960d548b7d7d94

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105216

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug target/105135] [11/12/13 Regression] Optimization regression for handrolled branchless assignment since r11-4717-g3e190757fa332d32

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105135

Richard Biener  changed:

   What|Removed |Added

  Component|middle-end  |target
 Target||x86_64-*-*
   Priority|P3  |P2

[Bug middle-end/104986] [12/13 Regression] bogus writing 1 byte into a region of size 0 with -fwrapv and -O2 -fpeel-loops since r12-4698-gf6d012338bf87f42

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104986

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug middle-end/104965] [11/12/13 Regression] Yet another -Warray-bounds false positive

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104965

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Last reconfirmed||2022-7-26

--- Comment #6 from Richard Biener  ---
Re-confirmed.  Didn't we change libstdc++ to not expect CSE around new?

[Bug middle-end/104965] [11/12/13 Regression] Yet another -Warray-bounds false positive

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104965

Richard Biener  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW

[Bug tree-optimization/104935] [12/13 Regression] 554.roms_r ELF binary increased with r12-7612-g69619acd8d9b5856

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104935

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
 Status|UNCONFIRMED |RESOLVED

--- Comment #5 from Richard Biener  ---
I think it's sufficiently understood and not a bug.

[Bug middle-end/26163] [meta-bug] missed optimization in SPEC (2k17, 2k and 2k6 and 95)

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26163
Bug 26163 depends on bug 104935, which changed state.

Bug 104935 Summary: [12/13 Regression] 554.roms_r ELF binary increased with 
r12-7612-g69619acd8d9b5856
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104935

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WONTFIX

[Bug target/104912] [12/13 Regression] 416.gamess regression after r12-7612-g69619acd8d9b58

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104912

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/104789] [12/13 Regression] -Wstringop-overflow false positive at -O3 for an unrolled loop

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104789

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug middle-end/104787] [12/13 Regression] False positive -Wreturn-type since r12-5638-ga3e75c1491cd2d50

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104787

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
 CC||rguenth at gcc dot gnu.org

--- Comment #5 from Richard Biener  ---
So the case is probably similar - without the early folding we go all the
way, transforming

struct FileAccessRef f;
  try
{
  if (1)
{
  return  = 0;
}
}
  finally
{
  FileAccessRef::~FileAccessRef (&f);
}
  __builtin_trap ();

to

D.2402 = 0;
// predicted unlikely by early return (on trees) predictor.
finally_tmp.0 = 0;
FileAccessRef::~FileAccessRef (&f);
if (finally_tmp.0 == 1)
  goto ; [INV]
else
  goto ; [INV]

since the return-type diagnostic is before any kind of optimization it
probably diagnoses this by design.  Otherwise it would be appropriate
to move the diagnostic to the build_ssa_passes set of diagnostic passes
which could share a common VN run to mark unreachable blocks.

In the end I'm currently not working on the middle-end unreachable code
diagnostic so we can as well revert the frontend change causing all this
fallout ...

[Bug target/104723] [12/13 regression] Redundant usage of stack

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104723

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/104475] [12/13 Regression] Wstringop-overflow + atomics incorrect warning on dynamic object

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104475

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/104368] [12/13 Regression] Failure to vectorise conditional grouped accesses after PR102659

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104368

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug go/104290] [12/13 Regression] trunk 20220214 fails to build libgo on i686-gnu

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104290

--- Comment #29 from Richard Biener  ---
What's the status here on the GCC 12 branch and trunk?

[Bug tree-optimization/104200] [12/13 Regression] FAIL: gcc.target/aarch64/atomic-inst-cas.c (test for excess errors) fails

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104200

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/104165] [12/13 Regression] -Warray-bounds for unreachable code inlined from std::sort()

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104165

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug target/106447] New: nvptx offloading: C++ '__iterator_category' 'return' ICE

2022-07-26 Thread tschwinge at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106447

Bug ID: 106447
   Summary: nvptx offloading: C++ '__iterator_category' 'return'
ICE
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code, openmp
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tschwinge at gcc dot gnu.org
CC: sayle at gcc dot gnu.org, vries at gcc dot gnu.org
  Target Milestone: ---
Target: nvptx

I found this during my "GPU support for minimal C++ library" investigations,
PR101544.  You're not currently able to reproduce this, as it depends on a
number of WIP patches, but I'm filing it for later reference.  (Or, I suppose
could maybe come up with a stand-alone reproducer.)  I've done a quick try
reproducing the issue without offloading, with a nvptx target toolchain, but
didn't succeed to trigger the ICE there.

Simple program (similar to PR106445, but using a constructor with 'count'):

#include 

int main()
{
  #pragma omp target
  {
std::vector v(100);
  }

  return 0;
}

This explodes in nvptx offloading compilation:

during RTL pass: expand
dump file: ./a.xnvptx-none.mkoffload.254r.expand
   
[...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_iterator_base_types.h:
In function ‘__iterator_category’:
   
[...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_iterator_base_types.h:239:65:
internal compiler error: in emit_move_insn, at expr.cc:4039
  239 | { return typename iterator_traits<_Iter>::iterator_category();
}
  | ^

That's, through some layers of C++ templates,
'libstdc++-v3/include/bits/stl_iterator_base_types.h':

235   template
236 inline _GLIBCXX_CONSTEXPR
237 typename iterator_traits<_Iter>::iterator_category
238 __iterator_category(const _Iter&)
239 { return typename iterator_traits<_Iter>::iterator_category(); }

'*.253t.optimized':

;; Function __iterator_category
(_ZSt19__iterator_categoryIPiENSt15iterator_traitsIT_E17iterator_categoryERKS2_,
funcdef_no=39, decl_uid=1570, cgraph_uid=40, symbol_order=223)

__attribute__((omp declare target))
struct iterator_category __iterator_category (int * const & D.1815)
{
  struct iterator_category D.1816;

   :

   :
gimple_label <>
  gimple_return 

}

'*.254r.expand':

;; Function __iterator_category
(_ZSt19__iterator_categoryIPiENSt15iterator_traitsIT_E17iterator_categoryERKS2_,
funcdef_no=39, decl_uid=1570, cgraph_uid=40, symbol_order=223)


;; Generating RTL for gimple basic block 2

;; Generating RTL for gimple basic block 3



EMERGENCY DUMP:

__attribute__((omp declare target))
struct iterator_category __iterator_category (int * const & D.1815)
{ 
  int * const & _2(D);

(note 5 1 2 4 [bb 4] NOTE_INSN_BASIC_BLOCK)
(insn 2 5 3 4 (set (reg:DI 24)
(unspec:DI [
(const_int 0 [0])
] UNSPEC_ARG_REG))
"[...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_iterator_base_types.h":238:5
-1
 (nil))
(insn 3 2 4 4 (set (mem/f/c:DI (reg/f:DI 17 virtual-stack-vars) [23
D.1815+0 S8 A64])
(reg:DI 24))
"[...]/build-gcc/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/stl_iterator_base_types.h":238:5
-1
 (nil))
(note 4 3 6 4 NOTE_INSN_FUNCTION_BEG)

(note 6 4 7 2 [bb 2] NOTE_INSN_BASIC_BLOCK)

(code_label 7 6 8 68 (nil) [0 uses])
(note 8 7 0 [bb 3] NOTE_INSN_BASIC_BLOCK)

}

I'm not attaching a nvptx offloading 'lto1' reproducer, as these are somewhat
old GCC sources with local modifications, so I'm not sure the LTO stream format
would match, etc.  If someone is interested in reproducing this, we shall
coordinate.

(gdb) bt
#0  fancy_abort (file=file@entry=0x1927f68 "[...]/source-gcc/gcc/expr.cc",
line=line@entry=4039, function=function@entry=0x19298d8
 "emit_move_insn") at
[...]/source-gcc/gcc/diagnostic.cc:2012
#1  0x00847b3f in emit_move_insn (x=x@entry=0x77690f60,
y=y@entry=0x77690f30) at [...]/source-gcc/gcc/expr.cc:4038
#2  0x006e8119 in expand_value_return
(val=val@entry=0x77690f30) at [...]/source-gcc/gcc/cfgexpand.cc:3741
#3  0x006e85b1 in expand_return
(retval=retval@entry=0x7768abe0) at [...]/source-gcc/gcc/cfgexpand.cc:3813
#4  0x006e8a1e in expand_gimple_stmt_1
(stmt=stmt@entry=0x776920f0) at [...]/source-gcc/gcc/cfgexpand.cc:3920
#5  0x006e90da in expand_gimple_stmt
(stmt=stmt@entry=0x776920f0) at [...]/source-gcc/gcc/cfgexpand.cc:4046
#6  0x006f3c88 in expand_gimple_basic_block
(bb=bb@entry=0x77687d68, disable_tail_calls=disable_tail_calls@entry=false)
at [...]/source

[Bug tree-optimization/103388] [12/13 Regression] missed optimization for dead code elimination at -O3 (trunk vs 11.2.0)

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103388

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/103195] [12/13 Regression] tfft2 text grows by 70% with -Ofast since r12-5113-gd70ef65692fced7a

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103195

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |WONTFIX

--- Comment #9 from Richard Biener  ---
I think everything works as intended here - nothing to see.

[Bug ipa/102982] [12/13 Regression] Dead Code Elimination Regression at -O3 (trunk vs 11.2.0)

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102982

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug tree-optimization/102892] [12/13 Regression] Dead Code Elimination Regression at -O3 (trunk vs 11.2.0)

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102892

Richard Biener  changed:

   What|Removed |Added

   Keywords||testsuite-fail

--- Comment #16 from Richard Biener  ---
(In reply to palmer from comment #13)
> I just posted a patch
>  that
> removes the undefined behavior from this test case, with that it links on
> RISC-V.

Can you push the patch please?  Keeping open for the testsuite FAIL for now,
please close when fixed.  The DCE regression should be INVALID after that.

[Bug tree-optimization/102879] [12/13 Regression] Dead Code Elimination Regression at -O3

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102879

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/106311] [12/13 Regression] internal compiler error in redeclare_class_template

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

--- Comment #3 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Marek Polacek
:

https://gcc.gnu.org/g:9be0feeadeeac2166fbe3823421bc5712bc59087

commit r12-8619-g9be0feeadeeac2166fbe3823421bc5712bc59087
Author: Marek Polacek 
Date:   Fri Jul 15 09:51:50 2022 -0400

c++: ICE with erroneous template redeclaration [PR106311]

Here we ICE trying to get DECL_SOURCE_LOCATION of the parm that happens
to be error_mark_node in this ill-formed test.  I kept running into this
while reducing code, so it'd be good to have it fixed.

PR c++/106311

gcc/cp/ChangeLog:

* pt.cc (redeclare_class_template): Check DECL_P before accessing
DECL_SOURCE_LOCATION.

gcc/testsuite/ChangeLog:

* g++.dg/template/redecl5.C: New test.

(cherry picked from commit 2333b58c9892667545d0c2c3ecd2d7b947197511)

[Bug tree-optimization/102756] [12/13 Regression] Complete unrolling is too senative to PRE; c-c++-common/torture/vector-compare-2.c

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102756

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/106311] [12/13 Regression] internal compiler error in redeclare_class_template

2022-07-26 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106311

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #4 from Marek Polacek  ---
Fixed.

[Bug middle-end/102697] [12/13 Regression] overflow warning missing after -O2 vectorization

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102697

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug middle-end/102633] [11/12/13 Regression] warning for self-initialization despite -Wno-init-self

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102633

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2022-07-26
   Priority|P3  |P2

--- Comment #4 from Richard Biener  ---
Re-confirmed.  For volatiles whether they are uninitialized ever is a separate
question...

Martin - can you try addressing bugs your changes cause?

[Bug tree-optimization/102540] [12/13 Regression] Dead Code Elimination Regression at -O3 since r12-476-gd846f225c25c5885

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102540

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug target/102473] [12/13 Regression] 521.wrf_r 5% slower at -Ofast and generic x86_64 tuning after r12-3426-g8f323c712ea76c

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102473

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|WAITING |RESOLVED

--- Comment #18 from Richard Biener  ---
Assuming so.

[Bug middle-end/26163] [meta-bug] missed optimization in SPEC (2k17, 2k and 2k6 and 95)

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26163
Bug 26163 depends on bug 102473, which changed state.

Bug 102473 Summary: [12/13 Regression] 521.wrf_r 5% slower at -Ofast and 
generic x86_64 tuning after r12-3426-g8f323c712ea76c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102473

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

[Bug target/102250] [11/12/13 Regression] python is not documented as a Prerequisite for building for riscv

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102250

Richard Biener  changed:

   What|Removed |Added

   Last reconfirmed||2022-07-26
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1

--- Comment #5 from Richard Biener  ---
Docs should still be amended if there's a possible dependence.

[Bug tree-optimization/102058] [12/13 regression] 450.soplex regressed on x86_64 with -Ofast -march=generic (by 8-15%)

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102058

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |SUSPENDED

--- Comment #7 from Richard Biener  ---
See comment#5

[Bug testsuite/101461] [12/13 regression] gcc.target/powerpc/fold-vec-load-builtin_vec_xl test cases fail after r12-2266

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101461

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

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

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100952

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug target/105135] [11/12/13 Regression] Optimization regression for handrolled branchless assignment since r11-4717-g3e190757fa332d32

2022-07-26 Thread amonakov at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105135

Alexander Monakov  changed:

   What|Removed |Added

 CC||amonakov at gcc dot gnu.org

--- Comment #5 from Alexander Monakov  ---
Regarding Clang's code, the key part is not use of 8-bit operations, but setbe
(2 uops) vs. setb (1 uop):

cmpb$25, %cl
setbe   %al

vs

cmpb$26, %al
setb%al

(note comparison against 25 or 26).

---

Regarding cmov being a lottery, unless you mean Pentium4, then not really, it's
just 1 or 2 uops, each latency 1 or 2. uops.info has very nice summaries:

https://uops.info/html-instr/CMOVB_R32_R32.html
https://uops.info/html-instr/CMOVBE_R32_R32.html

[Bug c++/100460] [11/12/13 Regression][modules] mingw build broken due to use of unsupported open() flags

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100460

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Keywords||build
 Ever confirmed|0   |1
   Last reconfirmed||2022-07-26
 CC||jason at gcc dot gnu.org
  Component|target  |c++
 Status|UNCONFIRMED |NEW

--- Comment #3 from Richard Biener  ---
I think the "proper" fix is probably to use 2 argument open() here?  Not sure
what's the intent of the explicit permission bits.

[Bug target/100347] [11/12/13 Regression] GCC 11 does not recognize skylake; translates "march=native" to "x86_64"

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100347

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |WORKSFORME
 Status|WAITING |RESOLVED

--- Comment #21 from Richard Biener  ---
No further response from reporter.

[Bug c++/98662] [10/11/12/13 Regression] checking ICE in friend_accessible_p since r227023

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98662

Richard Biener  changed:

   What|Removed |Added

   Last reconfirmed|2021-01-14 00:00:00 |2022-7-26

--- Comment #6 from Richard Biener  ---
Reconfirmed on trunk.

[Bug tree-optimization/94212] [10/11/12/13 Regression] Incorrect vectorization of loop with FP calculations

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94212

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #16 from Richard Biener  ---
Invalid.

[Bug c++/69410] [10/11/12/13 Regression] friend declarations in local classes

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69410

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2

[Bug c++/89224] [10/11/12 Regression] subscript of const vector has the wrong type

2022-07-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89224

Richard Biener  changed:

   What|Removed |Added

   Last reconfirmed|2022-01-29 00:00:00 |2022-7-26

--- Comment #9 from Richard Biener  ---
Reconfirmed.

[Bug middle-end/104965] [11/12/13 Regression] Yet another -Warray-bounds false positive

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

--- Comment #7 from Jonathan Wakely  ---
(In reply to Richard Biener from comment #6)
> Re-confirmed.  Didn't we change libstdc++ to not expect CSE around new?

I don't think that's valid, is it?

[Bug middle-end/102633] [11/12/13 Regression] warning for self-initialization despite -Wno-init-self

2022-07-26 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102633

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #5 from Marek Polacek  ---
The problem is that since the patch above, we create a NOP_EXPR:

 2172   if (convert_p && !error_operand_p (exp.value)
 2173   && (TREE_CODE (TREE_TYPE (exp.value)) != ARRAY_TYPE))
 2174 exp.value = convert (build_qualified_type (TREE_TYPE (exp.value),
TYPE_UNQUALIFIED), exp.value);

so the DECL_INITIAL is '(int) i' and not 'i' anymore.  Then we don't
suppress_warning here:

711 case DECL_EXPR:
712   /* This is handled mostly by gimplify.cc, but we have to deal with
713  not warning about int x = x; as it is a GCC extension to turn off
714  this warning but only if warn_init_self is zero.  */
715   if (VAR_P (DECL_EXPR_DECL (*expr_p))
716   && !DECL_EXTERNAL (DECL_EXPR_DECL (*expr_p))
717   && !TREE_STATIC (DECL_EXPR_DECL (*expr_p))
718   && (DECL_INITIAL (DECL_EXPR_DECL (*expr_p)) == DECL_EXPR_DECL
(*expr_p))
719   && !warn_init_self)
720 suppress_warning (DECL_EXPR_DECL (*expr_p), OPT_Winit_self);

because of the check on line 718.

[Bug debug/106261] [10/11/12/13 Regression] ICE in output_call_frame_info, at dwarf2out.cc:943

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

Jakub Jelinek  changed:

   What|Removed |Added

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

--- Comment #3 from Jakub Jelinek  ---
Created attachment 53360
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53360&action=edit
gcc13-pr106261.patch

Untested fix.  The problem was emitting asm thunks when not emitting any other
functions (which is what -dx does).

[Bug c++/100460] [11/12/13 Regression][modules] mingw build broken due to use of unsupported open() flags

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

--- Comment #4 from Andreas Schwab  ---
They are needed for O_CREAT.

[Bug middle-end/102633] [11/12/13 Regression] warning for self-initialization despite -Wno-init-self

2022-07-26 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102633

Marek Polacek  changed:

   What|Removed |Added

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

--- Comment #6 from Marek Polacek  ---
Patch:

--- a/gcc/c-family/c-gimplify.cc
+++ b/gcc/c-family/c-gimplify.cc
@@ -712,13 +712,17 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p
ATTRIBUTE_UNUSED,
   /* This is handled mostly by gimplify.cc, but we have to deal with
 not warning about int x = x; as it is a GCC extension to turn off
 this warning but only if warn_init_self is zero.  */
-  if (VAR_P (DECL_EXPR_DECL (*expr_p))
- && !DECL_EXTERNAL (DECL_EXPR_DECL (*expr_p))
- && !TREE_STATIC (DECL_EXPR_DECL (*expr_p))
- && (DECL_INITIAL (DECL_EXPR_DECL (*expr_p)) == DECL_EXPR_DECL (*expr_p))
- && !warn_init_self)
-   suppress_warning (DECL_EXPR_DECL (*expr_p), OPT_Winit_self);
-  break;
+  {
+   tree &decl = DECL_EXPR_DECL (*expr_p);
+   if (VAR_P (decl)
+   && !DECL_EXTERNAL (decl)
+   && !TREE_STATIC (decl)
+   && (DECL_INITIAL (decl)
+   && tree_strip_nop_conversions (DECL_INITIAL (decl)) == decl)
+   && !warn_init_self)
+ suppress_warning (decl, OPT_Winit_self);
+   break;
+  }

 case PREINCREMENT_EXPR:
 case PREDECREMENT_EXPR:

  1   2   >