[Bug target/105648] .cfi_startproc in wrong position when -fpatchable-function-entry= is enabled on ppc64le

2022-05-19 Thread linkw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105648

Kewen Lin  changed:

   What|Removed |Added

 CC||linkw at gcc dot gnu.org

--- Comment #2 from Kewen Lin  ---
Dup of PR99888?

[Bug ipa/105600] [12/13 Regression] ICE with LTO when building Mumble since r12-5696-g53caa4723d8de73f

2022-05-19 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105600

--- Comment #11 from Martin Liška  ---
> Please tell me if I am needed to try and squeeze more out, although I'm
> likely to need instructions given aforementioned.

No, I've just sent a patch to mailing list that's going to fix it.

[Bug c++/105652] ICE: in is_base_type, at dwarf2out.cc:13400

2022-05-19 Thread hewillk at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105652

--- Comment #2 from 康桓瑋  ---
More reduced.

template
concept C = [] { return true; } ();

template // <-- ok if not 'T'
struct S {};

template
  requires C
struct S { constexpr static bool value = true; };

static_assert(S::value);

https://godbolt.org/z/7WK8TTaMs

[Bug debug/105627] -fcompare-debug failure at -Og for powerpc64le-unknown-linux-gnu

2022-05-19 Thread linkw at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105627

Kewen Lin  changed:

   What|Removed |Added

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

--- Comment #2 from Kewen Lin  ---
Thanks for reporting and triaging.

Although loops in function rs6000_analyze_swaps only handles NONDEBUG_INSN_P
insns, when doing unionfind_union it's still possible to union with debug insn,
as some def reg of nondebug insn can be used in debug insn, it makes the unions
become different unexpectedly. 

The below patch can fix the issue, I don't think we need the similar handling
in union_defs as I feel it's impossible to have the case that one reg which is
defined by debug insn but used in nondebug insn.

diff --git a/gcc/config/rs6000/rs6000-p8swap.cc
b/gcc/config/rs6000/rs6000-p8swap.cc
index d301bc3fe59..3aa90034c29 100644
--- a/gcc/config/rs6000/rs6000-p8swap.cc
+++ b/gcc/config/rs6000/rs6000-p8swap.cc
@@ -242,8 +242,9 @@ union_uses (swap_web_entry *insn_entry, rtx insn, df_ref
def)
   if (DF_REF_INSN_INFO (link->ref))
 {
   rtx use_insn = DF_REF_INSN (link->ref);
-  (void)unionfind_union (insn_entry + INSN_UID (insn),
- insn_entry + INSN_UID (use_insn));
+  if (NONDEBUG_INSN_P (use_insn))
+(void) unionfind_union (insn_entry + INSN_UID (insn),
+insn_entry + INSN_UID (use_insn));
 }

[Bug c++/102774] Stop showing "error: variable or field ‘f’ declared void" after an earlier error in a declarator

2022-05-19 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102774

--- Comment #3 from Jonathan Wakely  ---
For the first case:

template void f(T...) { }

GCC prints:

f.C:1:18: error: expected nested-name-specifier before ‘.’ token
1 | template void f(T...) { }
  |  ^
f.C:1:18: error: expected ‘>’ before ‘.’ token
f.C:1:29: error: variable or field ‘f’ declared void
1 | template void f(T...) { }
  | ^
f.C:1:31: error: ‘T’ was not declared in this scope
1 | template void f(T...) { }
  | 

Clang says:

f.C:1:18: error: expected a qualified name after 'typename'
template void f(T...) { }
 ^
f.C:1:18: error: expected ',' or '>' in template-parameter-list
f.C:1:31: error: unknown type name 'T'
template void f(T...) { }
  ^
3 errors generated.

This has no "declared void" noise.

[Bug c++/102774] Stop showing "error: variable or field ‘f’ declared void" after an earlier error in a declarator

2022-05-19 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102774

--- Comment #4 from Jonathan Wakely  ---
For Barry's example clang prints:

g.C:5:8: error: use of undeclared identifier 'B'; did you mean 'A::B'?
void f(B::X x, int j) {
   ^
   A::B
g.C:1:14: note: 'A::B' declared here
namespace A::B {
 ^
1 error generated.


This is much better. Ideal even.

[Bug ipa/105600] [12/13 Regression] ICE with LTO when building Mumble since r12-5696-g53caa4723d8de73f

2022-05-19 Thread acoplan at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105600

Alex Coplan  changed:

   What|Removed |Added

  Attachment #52988|0   |1
is obsolete||

--- Comment #12 from Alex Coplan  ---
Created attachment 52994
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52994&action=edit
better reproducer (crashes GCC 9 through trunk)

Attaching a better reduced testcase that affects GCC versions all the way back
to GCC 9.

[Bug c++/105655] New: [12/13 Regression] ICE on invalid deduction

2022-05-19 Thread egor.pugin at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105655

Bug ID: 105655
   Summary: [12/13 Regression] ICE on invalid deduction
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: egor.pugin at gmail dot com
  Target Milestone: ---

Works on 11.3, does not work on 12 and trunk.
https://godbolt.org/z/YrEbn3K6f

template 
struct A
{
template 
struct B
{
B(const L & left, const R & right)
{}
};

template 
B(const L &, const R &) -> B;
};

template 
using C = A::B;

int main()
{
C x{0, 0};
}

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

2022-05-19 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105617

--- Comment #13 from Hongtao.liu  ---

> so for the situation at hand I don't see any reasonable way out that
> doesn't have the chance of regressing things in other places (like
> treat loads from non-indexed auto variables specially or so).  The
> only real solution is to find a GIMPLE representation for
> __builtin_ia32_addcarryx_u64 that doesn't force the alternate output
> to memory.
Do we support parameter with "out" attribute(a parameter will be set by
builtin)? __builtin_ia32_addcarryx_u64 produces 2 outputs, one can be return
another must use by-reference parameter which force memory usage here.

[Bug c++/105656] New: remove BROKEN_VALUE_INITIALIZATION workaround

2022-05-19 Thread aldot at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105656

Bug ID: 105656
   Summary: remove BROKEN_VALUE_INITIALIZATION workaround
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: minor
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: aldot at gcc dot gnu.org
  Target Milestone: ---

BROKEN_VALUE_INITIALIZATION was added for PR89494, a bootstrap failure of
gcc-10 with a gcc-4.2 system compiler.

Since at least gcc-13, maybe gcc-12, we require a stage1 c++ compiler >=
gcc-4.8, hence the BROKEN_VALUE_INITIALIZATION seems to be dead code for it
guards against GCC_VERSION > 0 && GCC_VERSION < 4004

[Bug c++/105652] [12/13 Regression] ICE: in is_base_type, at dwarf2out.cc:13400 since r12-1937-gc28e1d288ab727de

2022-05-19 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105652

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org,
   ||ppalka at gcc dot gnu.org
Summary|ICE: in is_base_type, at|[12/13 Regression] ICE: in
   |dwarf2out.cc:13400  |is_base_type, at
   ||dwarf2out.cc:13400 since
   ||r12-1937-gc28e1d288ab727de

--- Comment #3 from Martin Liška  ---
Started with r12-1937-gc28e1d288ab727de.

[Bug c++/105655] [12/13 Regression] ICE on invalid deduction

2022-05-19 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105655

Martin Liška  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 CC||jason at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2022-05-19

--- Comment #1 from Martin Liška  ---
Started with r10-5020-g1a291106384cabc7.

[Bug c++/105656] remove BROKEN_VALUE_INITIALIZATION workaround

2022-05-19 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105656

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška  ---
I was suggesting a similar change, but it's more complicated.
Please read the following thread:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/594102.html

[Bug tree-optimization/105643] [13 Regression] Code-Size regression for specrate 538.imagick_r

2022-05-19 Thread admin at levyhsu dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105643

--- Comment #4 from Levy Hsu  ---
Created attachment 52995
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52995&action=edit
-fopt-info-vec before that commit

[Bug tree-optimization/105643] [13 Regression] Code-Size regression for specrate 538.imagick_r

2022-05-19 Thread admin at levyhsu dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105643

--- Comment #5 from Levy Hsu  ---
Created attachment 52996
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52996&action=edit
-fopt-info-vec after this commit

[Bug tree-optimization/105650] [13 Regression] Possibly wrong code on fontforge -fvect-cost-model=unlimited

2022-05-19 Thread slyfox at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105650

Sergei Trofimovich  changed:

   What|Removed |Added

 CC||jakub at redhat dot com

--- Comment #6 from Sergei Trofimovich  ---
r13-552 "i386: Fix up V2DI and V1TI inequality comparisons [PR105613]" did fix
it for me. Looks plausible? Or just a side-effect? I think you can revert it
locally to get the crash.

r13-550 has no effect on this crash.

[Bug tree-optimization/105643] [13 Regression] Code-Size regression for specrate 538.imagick_r

2022-05-19 Thread admin at levyhsu dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105643

--- Comment #6 from Levy Hsu  ---
Created attachment 52997
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52997&action=edit
Vec different seems to related SetPixelPacket

[Bug tree-optimization/105650] [13 Regression] Possibly wrong code on fontforge -fvect-cost-model=unlimited

2022-05-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105650

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek  ---
(In reply to Sergei Trofimovich from comment #6)
> r13-552 "i386: Fix up V2DI and V1TI inequality comparisons [PR105613]" did
> fix it for me. Looks plausible? Or just a side-effect? I think you can
> revert it locally to get the crash.
> 
> r13-550 has no effect on this crash.

The code contains various comparisons of pointers in loops which might be
vectorized into V2DImode non-equality comparisons, so r13-552 is most likely
the fix you're looking for.  Especially if the problem doesn't exist before
r13-458.

[Bug c++/105657] New: Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS

2022-05-19 Thread zarniwhoop at ntlworld dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105657

Bug ID: 105657
   Summary: Build failure in firefox libxul.so if
-DGLIBCXX_ASSERTIONS is in my CXXFLAGS
   Product: gcc
   Version: 12.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zarniwhoop at ntlworld dot com
  Target Milestone: ---

With gcc-12 (12.1.0 up to the 20220514 snapshot) I am unable to build
firefox-101.0 (beta) if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS.

The same problem was reported to mozilla a while back from fedora,
 https://bugzilla.mozilla.org/show_bug.cgi?id=1758005
and after analysis regarded as a gcc issue.

Searching has found no follow-ups, maybe I'm looking in the wrong places.

This is a regression, with gcc-11.2.0 it builds fine.

Output:

62:00.38 toolkit/library/build/libxul.so
62:00.38 rm -f libxul.so
62:00.38 /opt/gcc/bin/g++ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
-fstack-protector-strong -Wall -Wempty-body -Wignored-qualifiers
-Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code
-Wno-invalid-offsetof -Wc++2a-compat -Wduplicated-cond -Wimplicit-fallthrough
-Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations
-Wno-error=array-bounds -Wno-error=coverage-mismatch
-Wno-error=free-nonheap-object -Wno-multistatement-macros
-Wno-error=class-memaccess -Wno-error=deprecated-copy -Wformat
-Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -O2
-march=native -fstack-clash-protection -D_FORTIFY_SOURCE=2
-fstack-protector-strong -D_GLIBCXX_ASSERTIONS -fno-exceptions -fPIC -fno-rtti
-ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread
-pipe -freorder-blocks -O2 -fomit-frame-pointer -funwind-tables  -shared
-Wl,-z,defs -Wl,--gc-sections -Wl,-h,libxul.so -o libxul.so
/scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build/libxul_so.list
  -lpthread -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc
-Wl,-Bsymbolic-functions -Wl,--build-id=sha1 -fstack-protector-strong
-Wl,-rpath-link,/scratch/working/firefox-101.0/firefox-build-dir/dist/bin
-Wl,-rpath-link,/opt/firefox/lib  ../../../js/src/build/libjs_static.a
/scratch/working/firefox-101.0/firefox-build-dir/x86_64-unknown-linux-gnu/release/libgkrust.a
../../../security/sandbox/linux/libmozsandbox.so
../../../config/external/lgpllibs/liblgpllibs.so
../../../config/external/sqlite/libmozsqlite3.so
../../../widget/gtk/mozgtk/libmozgtk.so
../../../widget/gtk/mozwayland/libmozwayland.so
-Wl,--version-script,symverscript  -licui18n -licuuc -licudata -lasound -lrt
-lm -ldl -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrandr -lXrender -lXtst
-lpthread -lc -L/usr/lib/../lib -lffi -lplds4 -lplc4 -lnspr4 -lz -lnss3
-lnssutil3 -lsmime3 -lssl3 -lsoftokn3 -lfreetype -lfontconfig -lgtk-3 -lgdk-3
-lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo
-lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lpng16 -lwebpdemux -lwebp
-levent -lvpx -lpixman-1 -ldbus-glib-1 -ldbus-1 -lxcb-shm -lX11-xcb -lxcb
-lXcursor -lXi
62:00.38 /usr/bin/ld:
/scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build/../../../security/sandbox/linux/broker/Unified_cpp_linux_broker0.o:
in function `mozilla::SandboxBrokerPolicyFactory::InitContentPolicy()':
62:00.38
Unified_cpp_linux_broker0.cpp:(.text._ZN7mozilla26SandboxBrokerPolicyFactory17InitContentPolicyEv+0x1dc5):
undefined reference to `std::__glibcxx_assert_fail(char const*, int, char
const*, char const*)'
62:00.38 /usr/bin/ld:
/scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build/../../../security/sandbox/linux/launch/Unified_cpp_linux_launch0.o:
in function `std::__cxx11::to_string(int)':
62:00.38
Unified_cpp_linux_launch0.cpp:(.text._ZNSt7__cxx119to_stringEi[_ZNSt7__cxx119to_stringEi]+0x23a):
undefined reference to `std::__glibcxx_assert_fail(char const*, int, char
const*, char const*)'
62:00.38
Unified_cpp_linux_launch0.cpp:(.text._ZNSt6vectorISt4pairIiiESaIS1_EE12emplace_backIJS1_EEERS1_DpOT_.isra.0+0x6b):
undefined reference to `std::__glibcxx_assert_fail(char const*, int, char
const*, char const*)'
62:00.38 /usr/bin/ld:
/scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build/../../../xpcom/base/Unified_cpp_xpcom_base0.o:
in function
`mozilla::CycleCollectedJSContext::PerformDebuggerMicroTaskCheckpoint()':
62:00.38
Unified_cpp_xpcom_base0.cpp:(.text._ZN7mozilla23CycleCollectedJSContext34PerformDebuggerMicroTaskCheckpointEv+0x1fb):
undefined reference to `std::__glibcxx_assert_fail(char const*, int, char
const*, char const*)'
62:00.38 /usr/bin/ld:
/scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build/../../../xpcom/base/Unified_cpp_xpcom_base0.o:
in function `RefPtr&
std::deque,
std::allocator >
>::emplace_back
>(RefPtr&&) [clone .isra.0]':
62:00.38
Unified_cpp_xpcom_base0.cpp:(.text._ZNSt5dequeI6RefPtrIN7

[Bug fortran/105658] New: Passing array component to unlimited polymorphic routine passes wrong slice

2022-05-19 Thread zed.three at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105658

Bug ID: 105658
   Summary: Passing array component to unlimited polymorphic
routine passes wrong slice
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zed.three at gmail dot com
  Target Milestone: ---

The following program:

program f
implicit none

type :: foo
integer :: member1
integer :: member2
end type foo

type(foo), dimension(3) :: thing = [foo(1, 2), foo(3, 4), foo(5, 6)]

call print_poly(thing%member1)
call print_int(thing%member1)

contains
subroutine print_poly(array)
class(*), dimension(:), intent(in) :: array

select type(array)
type is (integer)
print*, array
end select
end subroutine

subroutine print_int(array)
integer, dimension(:), intent(in) :: array

print*, array
end subroutine
end program f

prints:

   1   2   3
   1   3   5

when we would expect:

   1   3   5
   1   3   5

Adding `-fcheck=all`, we get the warning "Fortran runtime warning: An array
temporary was created" _only_ for the call to `print_int`.

Adding an extra set of parentheses to the `print_poly` call (`call
print_poly((thing%member1))` gives the expected behaviour, I guess because it's
forcing an array temporary?

This behaviour is present in 4.9.4 through to the trunk currently available on
Compiler Explorer
((Compiler-Explorer-Build-gcc-7da9a089608b0ca09683332ce014fb6184842724-binutils-2.38)
13.0.0 20220518 (experimental))

[Bug c++/105657] Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS

2022-05-19 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105657

--- Comment #1 from Jonathan Wakely  ---
That symbol is in libstdc++.so.6.0.30 so I assume you're linking to the wrong
libstdc++.so, which is probably caused by -L/usr/lib/../lib

Try adding -Wl,--trace to the g++ linker command and see which libstdc++.so is
being used.

[Bug libstdc++/105657] Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS

2022-05-19 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105657

Jonathan Wakely  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Keywords||link-failure
 Status|UNCONFIRMED |WAITING
  Component|c++ |libstdc++
   Last reconfirmed||2022-05-19

[Bug ada/105507] Ada build fails for 32bit Windows

2022-05-19 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105507

--- Comment #8 from Eric Botcazou  ---
> We currently link:
> 
> shared: gmp, winpthread, zlib, zstd
> static: mpc, mpfr, isl
> 
> Not for any particular gcc related reason I think, some dependent packages
> have static/shared builds, some don't.

Why didn't I think of that for PR ada/100486?  So the fix should have been to
add -shared-libgcc to GCC_LINKERFLAGS in gcc/ada/gcc-interface/Make-lang.in:

# Strip -Werror during linking for the LTO bootstrap
GCC_LINKERFLAGS = $(filter-out -Werror, $(ALL_LINKERFLAGS)) -shared-libgcc

in your setup since you link gnat1 with shared libraries. This should override
the -static-libgcc in ALL_LINKERFLAGS inherited from toplevel.

So you need to to it 1) for GCC 11: rebuild it and reinstall it 2) for GCC 12:
build it with the patched GCC 11.  Note that this means that GCC 11 is
currently not fully functional anyway.

[Bug c/105635] [12/13 Regression] ICE in gimple_parm_array_size, at pointer-query.cc:592 since r12-6606-g9d6a0f388eb048f8

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105635

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:3b4daa0b3c3d8eb2ac3b40ad6898f314ed4d7919

commit r13-630-g3b4daa0b3c3d8eb2ac3b40ad6898f314ed4d7919
Author: Jakub Jelinek 
Date:   Thu May 19 11:56:21 2022 +0200

pointer-query: Fix ICE with non-pointer param [PR105635]

The gimple_parm_array_size function comment talks about pointe parameters
but doesn't actually verify it, it checks whether an attribute is present
on the function and then just uses TREE_TYPE (TREE_TYPE (var)) which
assumes a pointer type (or in theory could work for ARRAY_TYPE but
c-family languages which only have that attribute will never have
ARRAY_TYPE
parameters; and for VECTOR_TYPE/COMPLEX_TYPE it would mean something quite
different).

So, this patch punts early if var doesn't have pointer/reference type.

2022-05-19  Jakub Jelinek  

PR c/105635
* pointer-query.cc (gimple_parm_array_size): Return NULL if var
doesn't have pointer or reference type.

* gcc.dg/pr105635.c: New test.

[Bug debug/105630] [10/11/12/13 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105630

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:213cfa8d0a9d0bb28bd973323ee2055ee6699d86

commit r13-631-g213cfa8d0a9d0bb28bd973323ee2055ee6699d86
Author: Jakub Jelinek 
Date:   Thu May 19 11:58:15 2022 +0200

cfgexpand: Yet another spot with debug insns references to global vars
without varpool nodes [PR105630]

This is similar to the earlier patch to avoid having MEM_EXPRs
referencing global vars without varpool nodes, but this time
the difference is that during gimplification some hashing
actually created DECL_RTLs for the n VAR_DECL and the previous
change was in the if above this when DECL_RTL is NULL and we are
considering creating it.

The following patch drops on the floor references to vars where
we've optimized away the varpool node even when it has DECL_RTL.

Bootstrapped/regtested on x86_64-linux and i686-linux, plus
bootstrapped on those without the cfgexpand.cc change, reapplied
it and rebuilt stage3 cc1/cc1plus, the resulting cc1/cc1plus
binaries on both targets were identical except for the 16-byte
executable_checksum (I've done the second bootstraps in the same
directory as the first one after moving the previous one elsewhere,
so pathnames were the same, just checksum hasn't been regenerated).
So, at least on those binaries this patch doesn't affect debug info
at all.

2022-05-19  Jakub Jelinek  

PR debug/105630
* cfgexpand.cc (expand_debug_expr): For VAR_DECL, punt for
global vars without symtab node even when they have DECL_RTL
set.

* gcc.dg/pr105630.c: New test.

[Bug c/105635] [12 Regression] ICE in gimple_parm_array_size, at pointer-query.cc:592 since r12-6606-g9d6a0f388eb048f8

2022-05-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105635

Jakub Jelinek  changed:

   What|Removed |Added

Summary|[12/13 Regression] ICE in   |[12 Regression] ICE in
   |gimple_parm_array_size, at  |gimple_parm_array_size, at
   |pointer-query.cc:592 since  |pointer-query.cc:592 since
   |r12-6606-g9d6a0f388eb048f8  |r12-6606-g9d6a0f388eb048f8

--- Comment #4 from Jakub Jelinek  ---
Fixed on the trunk so far.

[Bug debug/105630] [10/11/12 Regression] '-fcompare-debug' failure w/ -O1 -ftree-parallelize-loops=2

2022-05-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105630

Jakub Jelinek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2022-05-19
 Status|UNCONFIRMED |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
Summary|[10/11/12/13 Regression]|[10/11/12 Regression]
   |'-fcompare-debug' failure   |'-fcompare-debug' failure
   |w/ -O1  |w/ -O1
   |-ftree-parallelize-loops=2  |-ftree-parallelize-loops=2

--- Comment #3 from Jakub Jelinek  ---
Fixed on the trunk so far.  Like the other PR, most likely not going to be
backported.

[Bug c++/105656] remove BROKEN_VALUE_INITIALIZATION workaround

2022-05-19 Thread aldot at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105656

--- Comment #2 from Bernhard Reutner-Fischer  ---
Yes, i've seen your bigger patch to remove all of these version conditionals.

But please note that this BROKEN_VALUE_INITIALIZATION was explicitly taylored
to catch aforementioned GCC versions, and really GCC itself. It even explicitly
excluded clang as that announces itself as 4.2.

/* GCC older than 4.4 have broken C++ value initialization handling, see
   PR11309, PR30111, PR33916, PR82939 and PR84405 for more details.  */
#if GCC_VERSION > 0 && GCC_VERSION < 4004 && !defined(__clang__)
# define BROKEN_VALUE_INITIALIZATION
#endif

Your big patch could maybe be refined a bit. For example, i think newer GCC do
recognize popcount patterns, so i assume that the conditions in
bitmap_count_bits_in_word should no longer be needed; Also, i assume that any
compiler that is used to build gcc will have to implement builtins like
__builtin_popcount{,l,ll} anyway. Same should hold true for ctz, clz, ffs.
I'm not sure what the standard has to say about unknown pragmas, but i'd assume
that a compiler should silently ignore "#pragma GCC whatever" if it doesn't
feel responsible for that identifier. If so, then using the GCC pragmas
unconditionally should be fine.
Maybe we should have an ATTRIBUTE_FORMAT macro to handle all of these
occurrences.
All in all, i think now that we require c++, and c++11 even, most of these
guards should probably key off plain __GNUC__, as Richard said.

[Bug tree-optimization/105643] [13 Regression] Code-Size regression for specrate 538.imagick_r

2022-05-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105643

--- Comment #7 from Richard Biener  ---
It seems there are a lot of loops like the following in FrameImage

for (x=0; x < (ssize_t) width; x++)
{
  SetPixelPacket(frame_image,&matte,q,frame_indexes);
  q++;
  frame_indexes++;
}

and they are now vectorized with an alias runtime check and a vectorized
epilogue.  I'd say that's good.  The "bad" is that we are unswitching
all those loops twice:

magick/decorate.c:605:25: optimized: Unswitching loop on condition: _1874 <=
0.0
magick/decorate.c:605:25: optimized: Unswitching loop on condition: _1874 >=
6.5535e+4

which means we have three copies to vectorize at least.  Doesn't really
explain your opt-info reports reporting :605 16 times.

In fact, I don't see any vectorization with -march=skylake-avx512 here
(but I didn't use -funroll-loops which will only make a difference on RTL
so generally I'd avoid that).  Maybe I need to check with a compiler
that doesn't have some unswitching improvements queued (but the old should get
those opportunities as well I think).

[Bug c++/105655] [12/13 Regression] ICE on invalid deduction

2022-05-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105655

Richard Biener  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
   Priority|P3  |P2
Version|unknown |12.1.0
   Target Milestone|--- |12.2

[Bug tree-optimization/105650] [13 Regression] Possibly wrong code on fontforge -fvect-cost-model=unlimited

2022-05-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105650

Richard Biener  changed:

   What|Removed |Added

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

--- Comment #8 from Richard Biener  ---
So fixed.

[Bug middle-end/105654] transparent_union, function pointer and different types arguments causes null pointer to be passed

2022-05-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105654

Richard Biener  changed:

   What|Removed |Added

 CC||hubicka at gcc dot gnu.org,
   ||jsm28 at gcc dot gnu.org

--- Comment #1 from Richard Biener  ---
-fno-ipa-modref fixes this, the issue is we remove the initialization of the
out argument:

--- t.i.113t.mergephi2  2022-05-19 13:06:52.209819846 +0200
+++ t.i.116t.dse2   2022-05-19 13:06:52.209819846 +0200
@@ -45,7 +45,6 @@

[local count: 912787929]:
   _2 = MEM[(char * *)argv_10(D) + 8B];
-  D.2620.x = &val;
   _cb_parse (D.2620, _2);
   val.1_3 = val;
   _4 = (int) val.1_3;

note there's a mismatch between the prototype and the actual _cb_parse
declaration:

static _Bool _cb_parse(union { void* x; _Bool * out; }
__attribute((transparent_union)), char* in);
static typeof(_cb_parse)* parse = _cb_parse;

and

static _Bool _cb_parse( _Bool * out, char* in) {
*out = !strcmp("yes", in);
return;
}

with the call being indirect:

parse(&val, argv[1]);

The docs say

'Second, the argument is passed to the function using the calling
conventions of the first member of the transparent union, not the calling
conventions of the union itself.  All members of the union must have the
same machine representation; this is necessary for this argument passing
to work properly.'

so possibly the alias set of the union needs to be that of the first member
but then the _cb_parse implementation uses _Bool * to access the argument
which then breaks.

But I suppose the issue with modref is more subtle due to the pointer
SSA name in the implementation and the aggregate argument in the caller.

Honza?

Joseph - is the above well-defined use of the extension?

[Bug middle-end/105654] transparent_union, function pointer and different types arguments causes null pointer to be passed

2022-05-19 Thread schwab--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105654

--- Comment #2 from Andreas Schwab  ---
FWIW, glibc has removed the use of transparent_union from its wait
implementation long ago.

[Bug ipa/100413] [11/12/13 Regression] ICE: failed to reclaim unneeded function with custom flags since r11-4267-g0e590b68fa374365

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100413

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

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

commit r11-10011-ga03b46b78c82666b39ccada3df533f819e13dcb7
Author: Martin Jambor 
Date:   Thu May 19 14:06:08 2022 +0200

ipa: Release body of clone_of when removing its last clone (PR 100413)

In the PR, the verifier complains that we did not manage to remove the
body of a node and it is right.  The node is kept for materialization
of two clones but after one is materialized, the other one is removed
as unneeded (as a part of delete_unreachable_blocks_update_callgraph).
The problem is that the node removal does not check for this situation
and can leave the clone_of node there with a body attached to it even
though there is no use for it any more.  This patch does checks for it
and handles the situation in a simlar way that
cgraph_node::materialize_clone does it, except that it also has to be
careful that the removed node itself does not have any clones, which
would still need the clone_of's body.  Failing to do that results in a
bootstrap failure.

gcc/ChangeLog:

2022-04-27  Martin Jambor  

PR ipa/100413
* cgraph.c (cgraph_node::remove): Release body of the node this
is clone_of if appropriate.

gcc/testsuite/ChangeLog:

2022-04-27  Martin Jambor  

PR ipa/100413
* g++.dg/ipa/pr100413.C: New test.

(cherry picked from commit 27ee75dbe81bb781214c66a9e6a759c08b7deb60)

[Bug ipa/100413] [11/12/13 Regression] ICE: failed to reclaim unneeded function with custom flags since r11-4267-g0e590b68fa374365

2022-05-19 Thread jamborm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100413

Martin Jambor  changed:

   What|Removed |Added

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

--- Comment #12 from Martin Jambor  ---
Fixed, thanks for reporting and sorry that it took so long to address.

[Bug d/105659] New: error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported

2022-05-19 Thread ibuclaw at gdcproject dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105659

Bug ID: 105659
   Summary: error: #error You must define PREFERRED_DEBUGGING_TYPE
if DWARF is not supported
   Product: gcc
   Version: 12.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: d
  Assignee: ibuclaw at gdcproject dot org
  Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

This was discussed in gcc-patches a while back, creating an issue for
tracking/fixing it.
---
g++  -fno-PIE -c  -DIN_GCC_FRONTEND -g -O2   -DIN_GCC 
-DCROSS_DIRECTORY_STRUCTURE   -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common 
-DHAVE_CONFIG_H -I. -I. -I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/.
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../include
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../libcpp/include
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../libcody 
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../libdecnumber
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../libdecnumber/dpd
-I../libdecnumber
-I/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/../libbacktrace   -o default-d.o
-MT default-d.o -MMD -MP -MF ./.deps/default-d.TPo
/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/config/default-d.cc
In file included from ./tm_d.h:9,
 from
/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/config/default-d.cc:22:
/home/ibuclaw/src/gcc/crossbuilds/../gcc/gcc/defaults.h:908:2: error: #error
You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported
  908 | #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not
supported
  |  ^
make[1]: *** [Makefile:2329: default-d.o] Error 1
make[1]: *** Waiting for unfinished jobs
make[1]: Leaving directory
'/home/ibuclaw/src/gcc/crossbuilds/aarch64-rtems/gcc'
make: *** [Makefile:4594: all-gcc] Error 2

[Bug middle-end/105654] transparent_union, function pointer and different types arguments causes null pointer to be passed

2022-05-19 Thread schwab--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105654

--- Comment #3 from Andreas Schwab  ---
The declaration with the transparent union allows redeclarations with either of
the contained types.

[Bug c/105660] New: ICE on aarch64 in warn_parm_array_mismatch

2022-05-19 Thread julie.gaspar at sipearl dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105660

Bug ID: 105660
   Summary: ICE on aarch64 in warn_parm_array_mismatch
   Product: gcc
   Version: 12.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: julie.gaspar at sipearl dot com
  Target Milestone: ---

Created attachment 52998
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52998&action=edit
preprocessed file of conservar.c

//--Description--//

While testing the Hydro benchmark on Arm architecture, building the version in
Hydro/HydroC/HydroC99_2DMpi from: https://github.com/HydroBench/Hydro.git with
gcc 12.1.0, the compilation generates an ICE. Gcc version 11.2.0 can compile
this without issue.

//--Environnement information--//

Target: aarch64-unknown-linux-gnu
Configured with: ../gcc-12.1.0/configure
--prefix=/opt/local/gcc-12.1.0-full+isl+binutils
--with-gmp=/opt/local/gcc-12.1.0-full+isl+binutils
--with-mpfr=/opt/local/gcc-12.1.0-full+isl+binutils
--with-mpc=/opt/local/gcc-12.1.0-full+isl+binutils
--with-isl=/opt/local/gcc-12.1.0-full+isl+binutils --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.1.0 (GCC)
GNU C17 (GCC) version 12.1.0 (aarch64-unknown-linux-gnu)
compiled by GNU C version 12.1.0, GMP version 6.2.1, MPFR version
4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C17 (GCC) version 12.1.0 (aarch64-unknown-linux-gnu)
compiled by GNU C version 12.1.0, GMP version 6.2.1, MPFR version
4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 42e82fd3c52b7c6fb0e0f63d24249e6a

//--Compiler options--//

COLLECT_GCC_OPTIONS='-O3' '-fopenmp' '-g' '-c' '-mlittle-endian' '-mabi=lp64'
'-pthread'

//--Error output--//

$ make hydro

/opt/local/gcc-12.1.0-full+isl+binutils/bin/gcc -O3 -save-temps -freport-bug  
-fopenmp -g  -c SplitSurface.c
/opt/local/gcc-12.1.0-full+isl+binutils/bin/gcc -O3 -save-temps -freport-bug  
-fopenmp -g  -c cmpflx.c
/opt/local/gcc-12.1.0-full+isl+binutils/bin/gcc -O3 -save-temps -freport-bug  
-fopenmp -g  -c compute_deltat.c
/opt/local/gcc-12.1.0-full+isl+binutils/bin/gcc -O3 -save-temps -freport-bug  
-fopenmp -g  -c conservar.c
conservar.c:65:24: internal compiler error: Segmentation fault
   65 |) {
  |^
0xbeee33 crash_signal
../../gcc-12.1.0/gcc/toplev.cc:322
0x7849bc warn_parm_array_mismatch(unsigned int, tree_node*, tree_node*)
../../gcc-12.1.0/gcc/c-family/c-warn.cc:3607
0x6be303 start_function(c_declspecs*, c_declarator*, tree_node*)
../../gcc-12.1.0/gcc/c/c-decl.cc:9699
0x70ad67 c_parser_declaration_or_fndef
../../gcc-12.1.0/gcc/c/c-parser.cc:2445
0x71212f c_parser_external_declaration
../../gcc-12.1.0/gcc/c/c-parser.cc:1779
0x712c5f c_parser_translation_unit
../../gcc-12.1.0/gcc/c/c-parser.cc:1652
0x712c5f c_parse_file()
../../gcc-12.1.0/gcc/c/c-parser.cc:23357
0x75f5af c_common_parse_file()
../../gcc-12.1.0/gcc/c-family/c-opts.cc:1240
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
Makefile:53: recipe for target 'conservar.o' failed
make: *** [conservar.o] Error 1

//--Steps to reproduce--//

$ git clone https://github.com/HydroBench/Hydro.git
$ cd Hydro/
$ git checkout 7934330edc7f464298bbc25e58e69d1dcfe4d82c
$ ln Arch/make_gcc_nompi HydroC/HydroC99_2DMpi/Src/make.inc
$ cd HydroC/HydroC99_2DMpi/Src/

#removing unwanted options specific to intel

$ sed -i -e 's/-march=corei7-avx//g' make.inc
$ sed -i -e 's/CFLAGS += -vec-report3/#CFLAGS += -vec-report3/g' Makefile

#making sure of the version of gcc
#you can use the following command if needed and replace with the path to your
gcc version 12.1.0
# $ sed -i -e 's/= gcc/= path\/to\/wanted\/gcc/g' make.inc

$ make hydro

[Bug debug/105586] [11/12/13 Regression] -fcompare-debug failure (length) with -O2 -fno-if-conversion -mtune=power4 -fno-guess-branch-probability

2022-05-19 Thread jskumari at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105586

Surya Kumari Jangala  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |jskumari at gcc dot 
gnu.org

--- Comment #4 from Surya Kumari Jangala  ---
I will look into the issue.

[Bug tree-optimization/105431] ICE: SIGSEGV in powi_as_mults_1 (tree-ssa-math-opts.cc:1512) with -Ofast and __builtin_pow()

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105431

--- Comment #7 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:1e43783b3f3570f59bbe80fe38ba65049fa77a0a

commit r12-8396-g1e43783b3f3570f59bbe80fe38ba65049fa77a0a
Author: Richard Biener 
Date:   Fri Apr 29 08:45:48 2022 +0200

tree-optimization/105431 - another overflow in powi handling

This avoids undefined signed overflow when calling powi_as_mults_1.

2022-04-29  Richard Biener  

PR tree-optimization/105431
* tree-ssa-math-opts.cc (powi_as_mults_1): Make n unsigned.
(powi_as_mults): Use absu_hwi.
(gimple_expand_builtin_powi): Remove now pointless n != -n
check.

(cherry picked from commit 44b09adb9bad99dd7e3017c5ecefed7f7c9a1590)

[Bug tree-optimization/105537] [12 Regression] ICE: cannot update SSA form (error: statement uses released SSA name)

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105537

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

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

commit r12-8398-ga53eff4ad05f234a509dd2995d5a7612d5baa4e8
Author: Richard Biener 
Date:   Tue May 10 11:44:40 2022 +0200

middle-end/105537 - debug processing

The following makes sure to have a consistent state of
flag_var_tracking_assignments with the distributed handling
in process_options and finish_options by moving everything to
finish_options which also restores diagnostics for
-g0 -fvar-tracking which was lost with previous changes.

2022-05-10  Richard Biener  

PR middle-end/105537
* toplev.cc (process_options): Move flag_var_tracking
handling ...
* opts.cc (finish_options): ... here.

* gcc.dg/torture/pr105537.c: New testcase.

(cherry picked from commit 76db543db88727789a6c117608a23edc2eace713)

[Bug rtl-optimization/105559] [9/10/11/12 Regression] -g and -O3 cause timeout since r12-156-g8d4c374c4419a875

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105559

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

https://gcc.gnu.org/g:2a040e982945a5795081e81be35094b604d596d3

commit r12-8399-g2a040e982945a5795081e81be35094b604d596d3
Author: Richard Biener 
Date:   Wed May 11 13:34:37 2022 +0200

rtl-optimization/105559 - avoid quadratic behavior in delete_insn_and_edges

When the insn to delete is a debug insn there's no point in figuring
out whether it might be the last real insn and thus we have to purge
dead edges.

2022-05-11  Richard Biener  

PR rtl-optimization/105559
* cfgrtl.cc (delete_insn_and_edges): Only perform search to BB_END
for non-debug insns.

(cherry picked from commit 37a8220fa9188470c677abfef50c1b120c0b6c76)

[Bug libstdc++/105562] [12 Regression] std::function::_M_invoker may be used uninitialized in std::regex move with -fno-strict-aliasing

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105562

--- Comment #15 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:844a5c8ca768dc0cc90c1a943756610832d686a8

commit r12-8400-g844a5c8ca768dc0cc90c1a943756610832d686a8
Author: Richard Biener 
Date:   Thu May 12 12:13:29 2022 +0200

tree-optimization/105562 - avoid uninit diagnostic with better FRE

We can avoid some uninit diagnostics by making FRE disambiguate
against CLOBBERs since any aliasing there would invoke undefined
behavior for a read we are looking up.

2022-05-12  Richard Biener  

PR tree-optimization/105562
* tree-ssa-sccvn.cc (vn_reference_lookup_3): Disambiguate
against all CLOBBER defs if there's not an obvious must-alias
and we are not doing redundant store elimination.
(vn_walk_cb_data::redundant_store_removal_p): New field.
(vn_reference_lookup_pieces): Initialize it.
(vn_reference_lookup): Add argument to specify if we are
doing redundant store removal.
(eliminate_dom_walker::eliminate_stmt): Specify we do.
* tree-ssa-sccvn.h (vn_reference_lookup): Adjust.

* g++.dg/warn/uninit-pr105562.C: New testcase.

(cherry picked from commit 94b8a37fa16f7638cc1965718f4ec71719506743)

[Bug rtl-optimization/105577] [12 Regression] ICE in delete_unmarked_insns, at dce.cc:653 since r12-248-gb58dc0b803057c0e

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105577

--- Comment #14 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Richard Biener
:

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

commit r12-8401-gb251f8be6b018966edad5daeb45c42fd193b24b4
Author: Richard Biener 
Date:   Thu May 12 14:03:32 2022 +0200

rtl-optimization/105577 - RTL DSE and non-call EH

When one of the first two stages of DSE removes a throwing stmt
we have to purge dead EH edges before the DF re-analyze fires off
a fast DCE since that cannot cope with the situation.

2022-05-12  Richard Biener  

PR rtl-optimization/105577
* dse.cc (rest_of_handle_dse): Make sure to purge dead EH
edges before running fast DCE via df_analyze.

(cherry picked from commit dfda40f8147412328f699628a54b0aaa584776e7)

[Bug c++/2022] Internal compiler error when c function has same name as mangled C++ name

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

--- Comment #6 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:25d7a7381099b46b6554c5e20b00b19d460c2123

commit r12-8402-g25d7a7381099b46b6554c5e20b00b19d460c2123
Author: Richard Biener 
Date:   Mon May 16 12:07:31 2022 +0200

rtl-optimization/105577 - testcase for the PR

2022-05-16  Richard Biener  

PR rtl-optimization/105577
* g++.dg/torture/pr105577.C: New testcase.

(cherry picked from commit ef7b8976b9143aa78dd9cf5cfdaa02552d6e18a0)

[Bug rtl-optimization/105577] [12 Regression] ICE in delete_unmarked_insns, at dce.cc:653 since r12-248-gb58dc0b803057c0e

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105577

--- Comment #15 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:25d7a7381099b46b6554c5e20b00b19d460c2123

commit r12-8402-g25d7a7381099b46b6554c5e20b00b19d460c2123
Author: Richard Biener 
Date:   Mon May 16 12:07:31 2022 +0200

rtl-optimization/105577 - testcase for the PR

2022-05-16  Richard Biener  

PR rtl-optimization/105577
* g++.dg/torture/pr105577.C: New testcase.

(cherry picked from commit ef7b8976b9143aa78dd9cf5cfdaa02552d6e18a0)

[Bug tree-optimization/105618] [11/12 Regression] Missed loop body simplification by -O3 (trunk v.s. 10.3)

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105618

--- Comment #7 from CVS Commits  ---
The releases/gcc-12 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:374cee99d01fceb89d0929da8b38051e6c9768f0

commit r12-8403-g374cee99d01fceb89d0929da8b38051e6c9768f0
Author: Richard Biener 
Date:   Tue May 17 09:45:02 2022 +0200

tree-optimization/105618 - restore load sinking

The PR97330 fix caused some missed sinking of loads out of loops
the following patch re-instantiates.

2022-05-17  Richard Biener  

PR tree-optimization/105618
* tree-ssa-sink.cc (statement_sink_location): For virtual
PHI uses ignore those defining the used virtual operand.

* gcc.dg/tree-ssa/ssa-sink-19.c: New testcase.

(cherry picked from commit ebce0e9bd8d714a8607ae24331a3d842b0d11859)

[Bug rtl-optimization/105577] [12 Regression] ICE in delete_unmarked_insns, at dce.cc:653 since r12-248-gb58dc0b803057c0e

2022-05-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105577

Richard Biener  changed:

   What|Removed |Added

  Known to work||12.1.1
 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

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

[Bug libstdc++/105562] [12 Regression] std::function::_M_invoker may be used uninitialized in std::regex move with -fno-strict-aliasing

2022-05-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105562

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||12.1.1
 Resolution|--- |FIXED

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

[Bug tree-optimization/105537] [12 Regression] ICE: cannot update SSA form (error: statement uses released SSA name)

2022-05-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105537

Richard Biener  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED
  Known to work||12.1.1
  Known to fail||12.1.0

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

[Bug target/105661] New: Comparisons to atomic variables generates less efficient code

2022-05-19 Thread redbeard0531 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105661

Bug ID: 105661
   Summary: Comparisons to atomic variables generates less
efficient code
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: redbeard0531 at gmail dot com
  Target Milestone: ---

With normal variables, gcc will generate a nice cmp/js pair when checking if
the high bit is null. When using an atomic, gcc generates a movzx/test/js
triple, even though it could use the same codegen as for a non-atomic.

https://godbolt.org/z/GorvWfrsh

#include 
#include 

[[gnu::noinline]] void f();
uint8_t plain;
std::atomic atomic;

void plain_test() {
if (plain & 0x80) f();
}

void atomic_test() {
if (atomic.load(std::memory_order_relaxed) & 0x80) f();
}

With both -O2 and -O3 this generates:

plain_test():
cmp BYTE PTR plain[rip], 0
js  .L4
ret
.L4:
jmp f()
atomic_test():
movzx   eax, BYTE PTR atomic[rip]
testal, al
js  .L7
ret
.L7:
jmp f()

ARM64 seems to be hit even harder, but I don't know that platform well enough
to know if the non-atomic codegen is valid there
https://godbolt.org/z/c3h8Y1dan. It seems likely though, at least for a relaxed
load.

[Bug target/105647] New test g++.dg/modules/pr105169 from r13-566-g7a3f38a966a528 fails with assembler error

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105647

--- Comment #3 from CVS Commits  ---
The trunk branch has been updated by Giuliano Belinassi
:

https://gcc.gnu.org/g:16e02662c092c6e3087628ef0030e7daa2f71485

commit r13-633-g16e02662c092c6e3087628ef0030e7daa2f71485
Author: Giuliano Belinassi 
Date:   Wed May 18 16:16:48 2022 -0300

PR105647 Update pr105169* so it does not fail on powerpc64le

On powerpc64le, the tests related to pr105169 failed because the
.localentry was not on a power of two address due to the extra nop
instruction taking one byte and thus moving its position one byte
further. Generating two nops instead moves .localentry to a valid
position.

gcc/testsuite/ChangeLog
2022-05-18  Giuliano Belinassi  

PR target/105647
* g++.dg/modules/pr105169_a.C: Change -fpatchable-function-entry to
2.
* g++.dg/modules/pr105169_b.C: Likewise.

[Bug libstdc++/105657] Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS

2022-05-19 Thread zarniwhoop at ntlworld dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105657

--- Comment #2 from Ken Moffat  ---
Jonathan,

many thinks for your time and and explanation. It seems that when the desired
version of gcc is in /opt/gcc, the mach build system used by firefox needs
LDFLAGS=" -L/opt/gcc/lib" - that allowed it to build.

I'm not sure how to close this as 'invalid' or 'user error' - I could mark it
as 'resolved' but that would be misleading.

[Bug target/105648] .cfi_startproc in wrong position when -fpatchable-function-entry= is enabled on ppc64le

2022-05-19 Thread giuliano.belinassi at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105648

--- Comment #3 from Giuliano Belinassi  ---
Not sure if duplicate, but it certainly is related to PR99888 and PR98125.

[Bug target/105649] Wrong .localentry address on powerpc64le with -fpatchable-function-entry=1

2022-05-19 Thread giuliano.belinassi at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105649

--- Comment #2 from Giuliano Belinassi  ---
This issue is related to PR98125.

[Bug libstdc++/105657] Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS

2022-05-19 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105657

Jonathan Wakely  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|WAITING |RESOLVED

--- Comment #3 from Jonathan Wakely  ---
Thanks for confirming the solution. Closing as invalid then :-)

[Bug ipa/105140] [10/11 Regression] ICE: SIGSEGV in fold_convertible_p with conflicting function redeclaration since r10-5112-gfddcfa5b84bf8a06

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105140

--- Comment #4 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:740d64815c6c8afff5e92fff0f5e9e600361ff75

commit r11-10012-g740d64815c6c8afff5e92fff0f5e9e600361ff75
Author: Richard Biener 
Date:   Mon Apr 4 10:20:05 2022 +0200

middle-end/105140 - fix bogus recursion in fold_convertible_p

fold_convertible_p expects an operand and a type to convert to
but recurses with two vector component types.  Fixed by allowing
types instead of an operand as well.

2022-04-04  Richard Biener  

PR middle-end/105140
* fold-const.c (fold_convertible_p): Allow a TYPE_P arg.

* gcc.dg/pr105140.c: New testcase.

(cherry picked from commit eaaf77dd85c333b116111bb1ae6c080154a4e411)

[Bug ipa/105250] ICE: in fold_convert_loc, at fold-const.cc:2581 with conflicting function redeclaration

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105250

--- Comment #4 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:0be87cc23d0b0e07656e94137978971555bebbb3

commit r11-10013-g0be87cc23d0b0e07656e94137978971555bebbb3
Author: Richard Biener 
Date:   Wed Apr 13 08:52:57 2022 +0200

tree-optimization/105250 - adjust fold_convertible_p PR105140 fix

The following reverts the original PR105140 fix and goes for instead
applying the additional fold_convert constraint for VECTOR_TYPE
conversions also to fold_convertible_p.  I did not try sanitizing
all of this at this point.

2022-04-13  Richard Biener  

PR tree-optimization/105250
* fold-const.c (fold_convertible_p): Revert
r12-7979-geaaf77dd85c333, instead check for size equality
of the vector types involved.

* gcc.dg/pr105250.c: New testcase.

(cherry picked from commit 4e892de6774f86540d36385701aa7b0a2bba5155)

[Bug c/105148] [11 Regression] ICE in verify_use, at tree-ssa.cc:881

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105148

--- Comment #7 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:64b3a86d33e08072ea78f2a87c8a275bd15f07cb

commit r11-10014-g64b3a86d33e08072ea78f2a87c8a275bd15f07cb
Author: Richard Biener 
Date:   Tue Apr 5 16:06:10 2022 +0200

tree-optimization/105148 - fix IVOPTs recording uses

The following fixes recording uses in ARRAY_REFs with non-constant
element size or low bound.

2022-04-05  Richard Biener  

PR tree-optimization/105148
* tree-ssa-loop-ivopts.c (idx_record_use): Walk raw operands
2 and 3 of ARRAY_REFs.

* gcc.dg/torture/pr105148.c: New testcase.

(cherry picked from commit 86242eb1bd03eba82d8e22b01b16925d43bcc539)

[Bug tree-optimization/105163] [9/10/11 Regression] ICE: SSA corruption since r0-122928

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105163

--- Comment #5 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:132c3bb06a90887f5c173e00b7f2c5163e054ac1

commit r11-10015-g132c3bb06a90887f5c173e00b7f2c5163e054ac1
Author: Richard Biener 
Date:   Wed Apr 6 09:36:38 2022 +0200

tree-optimization/105163 - abnormal SSA coalescing and reassoc

The negate propagation optimizations in reassoc did not look out for
abnormal SSA coalescing issues.  The following fixes that.

2022-04-06  Richard Biener  

PR tree-optimization/105163
* tree-ssa-reassoc.c (repropagate_negates): Avoid propagating
negated abnormals.

* gcc.dg/torture/pr105163.c: New testcase.

(cherry picked from commit 44fe49401725055a740ce47e80561b6932b8cd01)

[Bug tree-optimization/105173] [10/11 Regression] ICE: during GIMPLE pass: reassoc: verify_ssa failed (definition in block 2 follows the use) at -Ofast with decimals since r7-950-g8a85cee26eabf5cf

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105173

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

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

commit r11-10016-gf4f2bd4edea8beabcf9caea98f951dcac612b126
Author: Richard Biener 
Date:   Wed Apr 6 11:43:01 2022 +0200

tree-optimization/105173 - fix insertion logic in reassoc

The find_insert_point logic around deciding whether to insert
before or after the found insertion point does not handle
the case of _12 = ..;, _12, 1.0 well.  The following puts the
logic into find_insert_point itself instead.

2022-04-06  Richard Biener  

PR tree-optimization/105173
* tree-ssa-reassoc.c (find_insert_point): Get extra
insert_before output argument and compute it.
(insert_stmt_before_use): Adjust.
(rewrite_expr_tree): Likewise.

* gcc.dg/pr105173.c: New testcase.

(cherry picked from commit e1a5e7562d53a8d2256f754714b06595bea72196)

[Bug middle-end/105263] [9/10/11 Regression] ICE: gimple check: expected gimple_assign(error_mark), have gimple_nop() in gimple_assign_rhs1, at gimple.h:2655 with _Decimal64 -ffast-math since r7-950-g

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105263

--- Comment #5 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Richard Biener
:

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

commit r11-10017-gb2557f9081e5bf440abe3fc184cbdaea0447ec64
Author: Richard Biener 
Date:   Wed Apr 13 14:53:40 2022 +0200

tree-optimization/105263 - reassoc and DFP

reassoc has certain tricks which in the end depend on the ability
to undo them.  For DFP creating a -1. constant is easy but
re-identifying is appearantly not - real_minus_onep rejects those
outright for DFP.  So we have to disable (at least) this one trick.

2022-04-13  Richard Biener  

PR tree-optimization/105263
* tree-ssa-reassoc.c (try_special_add_to_ops): Do not consume
negates in multiplication chains with DFP.

* gcc.dg/pr105263.c: New testcase.

(cherry picked from commit ca145c6306f19272ac8756d88c4eba0bfdf01dfb)

[Bug tree-optimization/105312] [11 Regression] ICE in gimple_expand_vec_cond_expr on arm-linux since r12-834-ga6eacbf1055520

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105312

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

https://gcc.gnu.org/g:33914983cf3734c2f8079963ba49fcc117499ef3

commit r11-10018-g33914983cf3734c2f8079963ba49fcc117499ef3
Author: Richard Biener 
Date:   Wed Apr 20 10:17:24 2022 +0200

tree-optimization/105312 - fix ISEL VCOND expansion

The following aligns ISEL VEC_COND_EXPR expansion using VCOND
with the optab query done by vector lowering.  Instead of only
allowing the signed optab to provide EQ/NE compares we allow both
here though since there seems to be no documented canonicalization.

2022-04-20  Richard Biener  

PR tree-optimization/105312
* gimple-isel.cc (gimple_expand_vec_cond_expr): Query both
VCOND and VCONDU for EQ and NE.

* gcc.target/arm/pr105312.c: New testcase.

(cherry picked from commit 36f1de95a61132f63c0c07ef154abd9f435721ac)

[Bug tree-optimization/105368] [10/11 Regression] ICE: SIGSEGV in powi_lookup_cost (tree-ssa-math-opts.cc:1441) with -Ofast and __builtin_powf()

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105368

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

https://gcc.gnu.org/g:3e6ae76385c60ad1ef63270ba969729a40ca1245

commit r11-10019-g3e6ae76385c60ad1ef63270ba969729a40ca1245
Author: Richard Biener 
Date:   Mon Apr 25 10:55:21 2022 +0200

tree-optimization/105368 - avoid overflow in powi_cost

The following avoids undefined signed overflow when computing
the absolute of the exponent in powi_cost.

2022-04-25  Richard Biener  

PR tree-optimization/105368
* tree-ssa-math-opts.c (powi_cost): Use absu_hwi.

(cherry picked from commit f0e170f72f8bfaa2a64e1d09ebdfd48f917420f1)

[Bug tree-optimization/105431] ICE: SIGSEGV in powi_as_mults_1 (tree-ssa-math-opts.cc:1512) with -Ofast and __builtin_pow()

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105431

--- Comment #8 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:16a2fcfe247364088ca9d6d058d870bdfa28b345

commit r11-10020-g16a2fcfe247364088ca9d6d058d870bdfa28b345
Author: Richard Biener 
Date:   Fri Apr 29 08:45:48 2022 +0200

tree-optimization/105431 - another overflow in powi handling

This avoids undefined signed overflow when calling powi_as_mults_1.

2022-04-29  Richard Biener  

PR tree-optimization/105431
* tree-ssa-math-opts.c (powi_as_mults_1): Make n unsigned.
(powi_as_mults): Use absu_hwi.
(gimple_expand_builtin_powi): Remove now pointless n != -n
check.

(cherry picked from commit 44b09adb9bad99dd7e3017c5ecefed7f7c9a1590)

[Bug rtl-optimization/105559] [9/10/11 Regression] -g and -O3 cause timeout since r12-156-g8d4c374c4419a875

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105559

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

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

commit r11-10021-gd293946d5c318549af88f96c4c2175dcbb8f4cf1
Author: Richard Biener 
Date:   Wed May 11 13:34:37 2022 +0200

rtl-optimization/105559 - avoid quadratic behavior in delete_insn_and_edges

When the insn to delete is a debug insn there's no point in figuring
out whether it might be the last real insn and thus we have to purge
dead edges.

2022-05-11  Richard Biener  

PR rtl-optimization/105559
* cfgrtl.c (delete_insn_and_edges): Only perform search to BB_END
for non-debug insns.

(cherry picked from commit 37a8220fa9188470c677abfef50c1b120c0b6c76)

[Bug c/105148] [11 Regression] ICE in verify_use, at tree-ssa.cc:881

2022-05-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105148

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED
  Known to fail|11.2.1  |11.3.0
  Known to work||11.3.1

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

[Bug tree-optimization/105312] [11 Regression] ICE in gimple_expand_vec_cond_expr on arm-linux since r12-834-ga6eacbf1055520

2022-05-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105312

Richard Biener  changed:

   What|Removed |Added

  Known to fail|12.0|11.3.0, 12.1.0
 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED
  Known to work||11.3.1, 12.1.1

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

[Bug target/105573] ICE when building numpy on SPARC64

2022-05-19 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105573
Bug 105573 depends on bug 105312, which changed state.

Bug 105312 Summary: [11 Regression] ICE in gimple_expand_vec_cond_expr on 
arm-linux since r12-834-ga6eacbf1055520
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105312

   What|Removed |Added

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

[Bug libcc1/105632] Canadian Cross build failure - error: attempt to use poisoned "malloc"

2022-05-19 Thread lancethepants at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105632

--- Comment #1 from Lance Fredrickson  ---
Created attachment 52999
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52999&action=edit
Avoids using poisoned malloc in libcc1

Adds to libcc1plugin.cc and libcp1plugin.cc
#define INCLUDE_MEMORY
to avoid using poisoned malloc

[Bug c/105660] ICE on aarch64 in warn_parm_array_mismatch

2022-05-19 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105660

Martin Liška  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2022-05-19
 Status|UNCONFIRMED |NEW
 CC||marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška  ---
Confirmed, reducing and bisecting right now..

[Bug c/105660] [12/13 Regression] ICE in warn_parm_array_mismatch since r12-1218-gc6503fa93b5565c9

2022-05-19 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105660

Martin Liška  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org
Summary|ICE on aarch64 in   |[12/13 Regression] ICE in
   |warn_parm_array_mismatch|warn_parm_array_mismatch
   ||since
   ||r12-1218-gc6503fa93b5565c9

--- Comment #2 from Martin Liška  ---
Reduced test-case:

$ cat conservar.i
void gatherConservativeVars(int, int, int, int, int, int, int Hnvar, int,
int Hnyt, int Hnxyt, int, int Hstep, double[Hnyt],
double[Hnvar][Hstep][Hnxyt]);
void gatherConservativeVars(int, int, int, int, int, int, int Hnvar, int, int,
int Hnxyt, int, int Hstep, double[],
double[Hnvar][Hstep][Hnxyt]);

$ gcc conservar.i -c
conservar.i:6:29: internal compiler error: Segmentation fault
6 | double[Hnvar][Hstep][Hnxyt]);
  | ^~
0xf4e44a crash_signal
/home/marxin/Programming/gcc/gcc/toplev.cc:322
0x778b57bf ???
   
/usr/src/debug/glibc-2.35-2.4.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0x9f8d7b tree_check(tree_node*, char const*, int, char const*, tree_code)
/home/marxin/Programming/gcc/gcc/tree.h:3506
0x9f8d7b warn_parm_array_mismatch(unsigned int, tree_node*, tree_node*)
/home/marxin/Programming/gcc/gcc/c-family/c-warn.cc:3620
0x95cfdd c_parser_declaration_or_fndef
/home/marxin/Programming/gcc/gcc/c/c-parser.cc:2355
0x96500b c_parser_external_declaration
/home/marxin/Programming/gcc/gcc/c/c-parser.cc:1787
0x965873 c_parser_translation_unit
/home/marxin/Programming/gcc/gcc/c/c-parser.cc:1660
0x965873 c_parse_file()
/home/marxin/Programming/gcc/gcc/c/c-parser.cc:23388
0x9ca445 c_common_parse_file()
/home/marxin/Programming/gcc/gcc/c-family/c-opts.cc:1235
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.

Started with r12-1218-gc6503fa93b5565c9.

[Bug c/105660] [12/13 Regression] ICE in warn_parm_array_mismatch since r12-1218-gc6503fa93b5565c9

2022-05-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105660

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.2

[Bug d/105659] error: #error You must define PREFERRED_DEBUGGING_TYPE if DWARF is not supported

2022-05-19 Thread ibuclaw at gdcproject dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105659

--- Comment #1 from Iain Buclaw  ---
If I recall the conversation correctly, either the CPU-specific D language
hooks should be moved to macros - equivalent to TARGET_CPU_CPP_BUILTINS and
others.  Or the tm_d file should be packed with a lot more headers within -
possibly tricky as it would mean handling it in every possible path in
config.gcc.

[Bug middle-end/105662] New: [RFC][OpenMP][OpenMP] - permit disabling host-fallback mode?

2022-05-19 Thread burnus at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105662

Bug ID: 105662
   Summary: [RFC][OpenMP][OpenMP] - permit disabling host-fallback
mode?
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Keywords: openacc, openmp
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: burnus at gcc dot gnu.org
CC: jakub at gcc dot gnu.org, tschwinge at gcc dot gnu.org
  Target Milestone: ---

The following issue came up / was mentioned elsewhere:

   It can be useful do disable host fallback
   and generate only device/nonhost versions
   for (OpenMP) target / (OpenACC) compute regions.

Some other closed-source compilers have this feature and Clang recently got
that
feature.

Some users seem to interested in this to avoid creating separate functions –
and
then using 'omp declare variant' / OpenACC's 'bind' clause for them.

Additionally, some might prefer it to effectively force mandatory on-device
calculation and to save some bytes from the generated binary.


However, I note that the (main) reason that Clang got it was a different one
according to the reasoning given in the commit:

https://github.com/llvm/llvm-project/commit/47d66255701a5cfeab6c05e3642a2cccf7a4c09f
Date:   Thu Apr 21 20:13:33 2022 -0400

[OpenMP] Add options to only compile the host or device when offloading

OpenMP recently moved to the new offloading driver, this had the effect
of making it more difficult to inspect intermediate code for the device.
This patch adds `-foffload-host-only` and `-foffload-device-only` to
control which sides get compiled. This will allow users to more easily
inspect output without needing the temp files.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D124220

It uses:

def offload_device_only : Flag<["--"], "offload-device-only">,
  HelpText<"Only compile for the offloading device.">;

def offload_host_only : Flag<["--"], "offload-host-only">,
  HelpText<"Only compile for the offloading host.">;

def offload_host_device : Flag<["--"], "offload-host-device">,
  HelpText<"Only compile for the offloading host.">;

[Bug c/105663] New: Segmentation Fault on optimization level O2/O3

2022-05-19 Thread r.j.dejong at student dot utwente.nl via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105663

Bug ID: 105663
   Summary: Segmentation Fault on optimization level O2/O3
   Product: gcc
   Version: 12.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: r.j.dejong at student dot utwente.nl
  Target Milestone: ---

Created attachment 53000
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53000&action=edit
source.c

Source file of STM32U5 HAL library fails to compile on arm-none-eabi-gcc 12.1.0
with optimization levels O2 or O3. Command used to reproduce: arm-none-eabi-gcc
-O2 -c source.c -o foo .

The error also occurs for x86-64 GCC. Using godbolt.org compiler explorer, I
found that the minimum GCC version is 11.1 for this segfault to occur.

Preprocessed source code is attached (file source.c). The backtrace is:

> arm-none-eabi-gcc -O2 -c source.c -o foo
during GIMPLE pass: evrp
./stm32u5xx_hal_dma_ex.c: In function 'HAL_DMAEx_List_ReplaceNode_Head':
./stm32u5xx_hal_dma_ex.c:4689:1: internal compiler error: Segmentation fault
 4689 | }
  | ^
0x165320d internal_error(char const*, ...)
???:0
0x158bc83 operator_bitwise_not::fold_range(irange&, tree_node*, irange const&,
irange const&, tree_code) const
???:0
0x149a439 fold_using_range::range_of_range_op(irange&, gimple*, fur_source&)
???:0
0x149bfcb fold_using_range::fold_stmt(irange&, gimple*, fur_source&,
tree_node*)
???:0
0x1490448 gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*)
???:0
0x1490d43 gimple_ranger::range_of_expr(irange&, tree_node*, gimple*)
???:0
0xe3f061 range_query::value_of_expr(tree_node*, gimple*)
???:0
0xe1f5d6 rvrp_folder::value_of_expr(tree_node*, gimple*)
???:0
0xd30f2e substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
???:0
0x1462b37 dom_walker::walk(basic_block_def*)
???:0
0xd301fd substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
???:0
0xe15b7a execute_ranger_vrp(function*, bool)
???:0

Version information:
> arm-none-eabi-gcc --version
arm-none-eabi-gcc (Arch Repository) 12.1.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

> gcc --version
gcc (GCC) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

OS information:
> lsb_release -a
LSB Version:n/a
Distributor ID: ManjaroLinux
Description:Manjaro Linux
Release:21.2.6
Codename:   Qonos

--

My attempts to localize the offending source code were not very successful.
Although the error suggests something is wrong with
HAL_DMAEx_List_InsertNode_Head, if that function is removed the segfault jumps
to another function (with varying backtraces). By some trial and error I was
able to minimize the LOC to be removed to the function
DMA_List_CheckNodesBaseAddresses, lines 11827 till 11844. When these are
commented out, the segfault disappears. However, solely that function does not
seem to be responsible for the error, so I am unsure how useful this
information is for chasing a moving target, so therefore I included the
complete file.

[Bug tree-optimization/105663] [12/13 Regression] ICE (segfault) in operator_bitwise_not::fold_range with O2/O3

2022-05-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105663

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.2
  Component|c   |tree-optimization
Summary|Segmentation Fault on   |[12/13 Regression] ICE
   |optimization level O2/O3|(segfault) in
   ||operator_bitwise_not::fold_
   ||range with O2/O3
   Keywords||ice-on-valid-code

[Bug tree-optimization/105663] [12/13 Regression] ICE (segfault) in operator_bitwise_not::fold_range with O2/O3

2022-05-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105663

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2022-05-19
 Status|UNCONFIRMED |NEW

--- Comment #1 from Andrew Pinski  ---
Reduced testcase:

typedef __SIZE_TYPE__ size_t;

static 
int (void  * pNode1, void  * pNode2,  void  * pNode3)
{
  size_t temp = (((size_t)pNode1 | (size_t)pNode2 | (size_t)pNode3) & (0xUL
<< (16U)));
  size_t ref = 0U;


  if ((size_t)pNode1 != 0U)
  {
ref = (size_t)pNode1;
  }
  else if ((size_t)pNode2 != 0U)
  {
ref = (size_t)pNode2;
  }
  else if ((size_t)pNode3 != 0U)
  {
ref = (size_t)pNode3;
  }
  return temp != ((size_t)ref & (0xUL << (16U)));
}
int hhh(void*  pQList, void * pNewNode)
{
  if (pQList == 0)
  {
return 1;
  }
  if ((pQList, pNewNode, ((void *)0)) != 0U)
return 1;
  return 0;
}

 CUT ---
On the trunk we get:
: In function 'hhh':
:34:1: error: invalid types for 'bit_not_expr'
   34 | }
  | ^
void *
void *
_16 = ~pQList_4(D);
during GIMPLE pass: evrp

[Bug ada/105507] Ada build fails for 32bit Windows

2022-05-19 Thread reiter.christoph at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105507

--- Comment #9 from Christoph Reiter  ---
(In reply to Eric Botcazou from comment #8)
> > We currently link:
> > 
> > shared: gmp, winpthread, zlib, zstd
> > static: mpc, mpfr, isl
> > 
> > Not for any particular gcc related reason I think, some dependent packages
> > have static/shared builds, some don't.
> 
> Why didn't I think of that for PR ada/100486?

Sorry, I didn't know this was a problem :) I'm not quite sure how I ended up
maintaining this downstream... but here we are.

> So the fix should have been
> to add -shared-libgcc to GCC_LINKERFLAGS in
> gcc/ada/gcc-interface/Make-lang.in:
> 
> # Strip -Werror during linking for the LTO bootstrap
> GCC_LINKERFLAGS = $(filter-out -Werror, $(ALL_LINKERFLAGS)) -shared-libgcc
> 
> in your setup since you link gnat1 with shared libraries. This should
> override the -static-libgcc in ALL_LINKERFLAGS inherited from toplevel.
> 
> So you need to to it 1) for GCC 11: rebuild it and reinstall it 2) for GCC
> 12: build it with the patched GCC 11.  Note that this means that GCC 11 is
> currently not fully functional anyway.

Thanks for the detailed instructions. I'll give that a try.

I'm wondering if there are any downsides to just removing "-static-libgcc" from
both "--with-stage1-ldflags" and "--with-boot-ldflags". Or is only ada using
exceptions in GCC?

Or should we try linking everything statically to avoid this alltogether?

[Bug tree-optimization/105663] [12/13 Regression] ICE (segfault) in operator_bitwise_not::fold_range with O2/O3

2022-05-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105663

--- Comment #2 from Andrew Pinski  ---
Hmm:
  _13 = pQList_4(D) | pNewNode_6(D);
  _14 = (long unsigned int) _13;

That should be invalid gimple also ...

This might be my bug introduced by r12-5358-g32221357007666 .

[Bug tree-optimization/105663] [12/13 Regression] ICE (segfault) in operator_bitwise_not::fold_range with O2/O3

2022-05-19 Thread amacleod at redhat dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105663

Andrew Macleod  changed:

   What|Removed |Added

 CC||amacleod at redhat dot com

--- Comment #3 from Andrew Macleod  ---
I also seee the trap in operator_bitwise_not::op1_range if i disable:
  -fno-tree-fre -fno-tree-forwprop

Otherwise I get verify_gimple failures from those passes.

I presume its invalid, but it boils down in rangers case to the bitwise_not
operation assuming there is a MINUS_EXPR for the type that it is performing the
NOT on.In the case of pointers, there is no MINUX_EXPR.. 

I'll adjust range-ops so that whenever it invokes another handler, it first
verifies there is such an operation, and if not, it'll give up and the result
will be VARYING

[Bug tree-optimization/105663] [12/13 Regression] ICE (segfault) in operator_bitwise_not::fold_range with O2/O3

2022-05-19 Thread amacleod at redhat dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105663

--- Comment #4 from Andrew Macleod  ---
Or perhaps there shouldnt be 
  set (BIT_NOT_EXPR, op_bitwise_not);
  set (BIT_XOR_EXPR, op_bitwise_xor);

operations on pointer values?  I see also support

  set (BIT_AND_EXPR, op_pointer_and);
  set (BIT_IOR_EXPR, op_pointer_or);

but those are pointer specific versions...

[Bug c/105664] New: Install with suffix creates extra file

2022-05-19 Thread fxcoudert at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105664

Bug ID: 105664
   Summary: Install with suffix creates extra file
   Product: gcc
   Version: 12.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fxcoudert at gcc dot gnu.org
  Target Milestone: ---

Building gcc-11.3.0 from source on darwin with --program-suffix=-11 leads to
the following files being installed in the prefix:

-r-xr-xr-x  3 fx  admin  1397936 May 19 18:25
/opt/homebrew/Cellar/gcc/11.3.0_1/bin/aarch64-apple-darwin21-gcc-11
-r-xr-xr-x  3 fx  admin  1397936 May 19 18:25
/opt/homebrew/Cellar/gcc/11.3.0_1/bin/aarch64-apple-darwin21-gcc-tmp
-r-xr-xr-x  3 fx  admin  1397936 May 19 18:25
/opt/homebrew/Cellar/gcc/11.3.0_1/bin/gcc-11

That's three hard links of the gcc driver: gcc-11 and
aarch64-apple-darwin21-gcc-11 are expected, but aarch64-apple-darwin21-gcc-tmp
should not be present.

The full configure line is:

configure --prefix=/opt/homebrew/opt/gcc
--libdir=/opt/homebrew/opt/gcc/lib/gcc/11 --disable-nls
--enable-checking=release --with-gcc-major-version-only
--enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-11
--build=aarch64-apple-darwin21 --with-system-zlib
--with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk && make
install-strip

[Bug bootstrap/105664] Install with suffix creates extra file

2022-05-19 Thread fxcoudert at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105664

--- Comment #1 from Francois-Xavier Coudert  ---
The bug exists in 11.3.0 and 12.1.0
The part of "make install-strip" that creates the issue is the following:


  if [ "gcc-11" != "aarch64-apple-darwin21-gcc-11" ]; then \
    rm -f
/private/tmp/gcc-20220519-78662-28g74h/gcc-11.3.0/build/../instdir/opt/homebrew/opt/gcc/bin/aarch64-apple-darwin21-gcc-11;
\
( cd
/private/tmp/gcc-20220519-78662-28g74h/gcc-11.3.0/build/../instdir/opt/homebrew/opt/gcc/bin
&& \
  ln gcc-11 aarch64-apple-darwin21-gcc-11 ); \
  fi; \
  if [ ! -f gcc-cross ] \
  && [ "gcc-11" != "aarch64-apple-darwin21-gcc-11" ]; then \
rm -f
/private/tmp/gcc-20220519-78662-28g74h/gcc-11.3.0/build/../instdir/opt/homebrew/opt/gcc/bin/aarch64-apple-darwin21-gcc-tmp;
\
( cd
/private/tmp/gcc-20220519-78662-28g74h/gcc-11.3.0/build/../instdir/opt/homebrew/opt/gcc/bin
&& \
  ln gcc-11 aarch64-apple-darwin21-gcc-tmp && \
  mv -f aarch64-apple-darwin21-gcc-tmp
aarch64-apple-darwin21-gcc-11 ); \
  fi; \
fi

which boils down to:

rm -f aarch64-apple-darwin21-gcc-11
ln gcc-11 aarch64-apple-darwin21-gcc-11
rm -f aarch64-apple-darwin21-gcc-tmp
ln gcc-11 aarch64-apple-darwin21-gcc-tmp
mv -f aarch64-apple-darwin21-gcc-tmp aarch64-apple-darwin21-gcc-11

The final "mv -f" does nothing, since the two files are the same: it does not
remove aarch64-apple-darwin21-gcc-tmp, and this is how we end up with that file
in the prefix.

[Bug bootstrap/105664] Install with suffix creates extra file

2022-05-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105664

--- Comment #2 from Andrew Pinski  ---
install-driver: installdirs xgcc$(exeext)
-rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
-$(INSTALL_PROGRAM) xgcc$(exeext)
$(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
-if test "$(enable_as_accelerator)" != "yes" ; then \
  if [ "$(GCC_INSTALL_NAME)" != "$(target_noncanonical)-gcc-$(version)"
]; then \
rm -f $(DESTDIR)$(bindir)/$(FULL_DRIVER_NAME); \
( cd $(DESTDIR)$(bindir) && \
  $(LN) $(GCC_INSTALL_NAME)$(exeext) $(FULL_DRIVER_NAME) ); \
  fi; \
  if [ ! -f gcc-cross$(exeext) ] \
  && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ];
then \
rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext);
\
( cd $(DESTDIR)$(bindir) && \
  $(LN) $(GCC_INSTALL_NAME)$(exeext)
$(target_noncanonical)-gcc-tmp$(exeext) && \
  mv -f $(target_noncanonical)-gcc-tmp$(exeext)
$(GCC_TARGET_INSTALL_NAME)$(exeext) ); \
  fi; \
fi

The last mv is failing 

[Bug bootstrap/105664] Install with suffix creates extra file

2022-05-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105664

--- Comment #3 from Andrew Pinski  ---
https://pubs.opengroup.org/onlinepubs/009604599/utilities/mv.html

https://pubs.opengroup.org/onlinepubs/009604599/functions/rename.html

[Bug bootstrap/105664] Install with suffix creates extra file

2022-05-19 Thread fxcoudert at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105664

--- Comment #4 from Francois-Xavier Coudert  ---
1. I've reproduced it on x86_64-linux, so it's not a weird macOS mv bug

2. I have reasons to think (no hard proof, though) that it's a new bug: we're
hitting it during Homebrew testing, but it wasn't the case before. Yet, this is
confusing, because the install-driver target in gcc/Makefile.in has not been
changed in years.

[Bug ada/105507] Ada build fails for 32bit Windows

2022-05-19 Thread ebotcazou at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105507

--- Comment #10 from Eric Botcazou  ---
> I'm wondering if there are any downsides to just removing "-static-libgcc"
> from both "--with-stage1-ldflags" and "--with-boot-ldflags".

None presumably, since you already have dependencies on DLLs.

> Or is only ada using exceptions in GCC?

Yes, they are prohibited in the C++ codebase for the time being.

> Or should we try linking everything statically to avoid this alltogether?

It's your call, either should work equally well.

[Bug middle-end/98865] Missed transform of (a >> 63) * b

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98865

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Roger Sayle :

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

commit r13-673-gd863ba23fb16122bb0547b0c678173be0d98f43c
Author: Roger Sayle 
Date:   Thu May 19 17:54:38 2022 +0100

PR middle-end/98865: Expand X*Y as X&-Y when Y is [0,1].

The patch is a revised solution for PR middle-end/98865 incorporating
the feedback/suggestions from Richard Biener's review here:
https://gcc.gnu.org/pipermail/gcc-patches/2022-May/593928.html
Most significantly, this patch now performs the transformation/optimization
during RTL expansion, where the target's rtx_costs can be used to determine
whether the original multiplication (that may potentially be implemented by
a shift or lea) is cheaper than a negation and a bit-wise and.

Previously the expression (x>>63)*y would be compiled with -O2 as
shrq$63, %rdi
movq%rdi, %rax
imulq   %rsi, %rax

but with this patch now produces:
sarq$63, %rdi
movq%rdi, %rax
andq%rsi, %rax

Likewise the expression (x>>63)*135 [that appears in a hot-spot of the
Botan AES-128 benchmark] was previously:

shrq$63, %rdi
leaq(%rdi,%rdi,8), %rdx
movq%rdx, %rax
salq$4, %rax
subq%rdx, %rax

now becomes:
movq%rdi, %rax
sarq$63, %rax
andl$135, %eax

2022-05-19  Roger Sayle  

gcc/ChangeLog
PR middle-end/98865
* expr.cc (expand_expr_real_2) [MULT_EXPR]:  Expand X*Y as X&Y
when both X and Y are [0, 1], X*Y as X&-Y when Y is [0,1] and
likewise X*Y as -X&Y when X is [0,1] using tree_nonzero_bits.

gcc/testsuite/ChangeLog
PR middle-end/98865
* gcc.target/i386/pr98865.c: New test case.

[Bug bootstrap/105664] Install with suffix creates extra file

2022-05-19 Thread fxcoudert at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105664

--- Comment #5 from Francois-Xavier Coudert  ---
I can reproduce it with various combinations of configure options, with and
without bootstrap. It appears that the triggering factor is the combination of
two options:

--with-gcc-major-version-only
--program-suffix=-11

[Bug debug/105636] -gctf causes an ICE on some invalid code

2022-05-19 Thread ibhagat at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105636

--- Comment #1 from Indu Bhagat  ---
Thank you for reporting this.  I can reproduce it, nice and easy :)

[Bug bootstrap/105664] Install with suffix creates extra file

2022-05-19 Thread schwab--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105664

--- Comment #6 from Andreas Schwab  ---
Perhaps the macos mv has recently been upgraded to POSIX.1-2018.  Step 2 of the
mv operation didn't exist in the 2004 edition.

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

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

Bug ID: 105665
   Summary: wrong code at -Os and above on x86_64-linux-gnu
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

This appears to be a regression from 11.3.

[599] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.0 20220519 (experimental) [master r13-673-gd863ba23fb1] (GCC) 
[600] % 
[600] % gcctk -O1 small.c; ./a.out
[601] % 
[601] % gcctk -Os small.c
[602] % ./a.out
Segmentation fault
[603] % 
[603] % cat small.c
int a, b, c[1], d[2], *e = c;
int main() {
  int f = 0;
  for (; b < 2; b++) {
int g;
if (f)
  b = 40;
a = d[b * b];
for (f = 0; f < 3; f++) {
  if (e)
break;
  g--;
  if (a)
a = g;
}
  }
  return 0;
}

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

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

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

[Bug tree-optimization/105663] [12/13 Regression] ICE (segfault) in operator_bitwise_not::fold_range with O2/O3

2022-05-19 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105663

Martin Liška  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org

--- Comment #5 from Martin Liška  ---
Started with r11-35-g496f4f884716ae06.

[Bug tree-optimization/105665] [12/13 Regression] wrong code at -Os and above on x86_64-linux-gnu since r12-397-gda9e6e63d1ae22

2022-05-19 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105665

Martin Liška  changed:

   What|Removed |Added

   Last reconfirmed||2022-05-19
   Target Milestone|--- |12.2
 Status|UNCONFIRMED |NEW
 CC||aoliva at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
 Ever confirmed|0   |1
Summary|wrong code at -Os and above |[12/13 Regression] wrong
   |on x86_64-linux-gnu |code at -Os and above on
   ||x86_64-linux-gnu since
   ||r12-397-gda9e6e63d1ae22

--- Comment #2 from Martin Liška  ---
Likely started with r12-397-gda9e6e63d1ae22.

[Bug tree-optimization/105663] [11/12/13 Regression] ICE (segfault) in operator_bitwise_not::fold_range with O2/O3

2022-05-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105663

Andrew Pinski  changed:

   What|Removed |Added

Summary|[12/13 Regression] ICE  |[11/12/13 Regression] ICE
   |(segfault) in   |(segfault) in
   |operator_bitwise_not::fold_ |operator_bitwise_not::fold_
   |range with O2/O3|range with O2/O3
   Target Milestone|12.2|11.4

[Bug bootstrap/105664] Install with suffix creates extra file

2022-05-19 Thread fxcoudert at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105664

--- Comment #7 from Francois-Xavier Coudert  ---
So, to summarise my understanding:

- the problem is not specific to darwin, I can fully reproduce on
x86_64-linux-gnu

- the problem only arises if you configure with a --program-suffix that is
equal to the version. Then $(target_noncanonical)-gcc-$(version) is equal to
$(GCC_TARGET_INSTALL_NAME) and this triggers the issue.


I am not sure if it is the cleanest way to fix things, but I think we can
safely remove the temporary file after "mv", in all cases, like this:


diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 97e5450ecb5..602c382e86e 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3780,6 +3780,7 @@ install-driver: installdirs xgcc$(exeext)
( cd $(DESTDIR)$(bindir) && \
  $(LN) $(GCC_INSTALL_NAME)$(exeext)
$(target_noncanonical)-gcc-tmp$(exeext) && \
  mv -f $(target_noncanonical)-gcc-tmp$(exeext)
$(GCC_TARGET_INSTALL_NAME)$(exeext) ); \
+   rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext);
\
  fi; \
fi


I can confirm this fixes the issue.

[Bug tree-optimization/105665] [12/13 Regression] wrong code at -Os and above on x86_64-linux-gnu since r12-397-gda9e6e63d1ae22

2022-05-19 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105665

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
Started with r12-398-g5fbe6a8e73b52c6ebc28b9 because r12-397 didn't compile,
but yes, it is r12-397.

[Bug ipa/102059] Incorrect always_inline diagnostic in LTO mode with #pragma GCC target("cpu=power10")

2022-05-19 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102059

--- Comment #41 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Peter Bergner
:

https://gcc.gnu.org/g:3ea6d0ed6860e4f1d8f609c26de9d9a7f7a9ad2d

commit r11-10022-g3ea6d0ed6860e4f1d8f609c26de9d9a7f7a9ad2d
Author: Michael Meissner 
Date:   Fri May 6 11:39:13 2022 -0500

rs6000: Ignore fusion option flags for inlining test [PR102059]

The -mpower8-fusion and -mpower10-fusion options do not modify which
instructions we can generate, so ignore them when deciding whether we
can inline callee into caller.

2022-05-06  Michael Meissner  
Segher Boessenkool  

gcc/
PR target/102059
* config/rs6000/rs6000.c (rs6000_can_inline_p): Ignore
-mpower8-fusion
and -mpower10-fusion options for inlining purposes.

gcc/testsuite/
PR target/102059
* gcc.target/powerpc/pr102059-4.c: New test.

(cherry picked from commit 2fb654f77d5292864ef57040f7bc01d7a975f6d9)

  1   2   >