[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-08 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

Martin Liška  changed:

   What|Removed |Added

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

--- Comment #13 from Martin Liška  ---
Yes, it should be fixed.

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-08 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

--- Comment #12 from Jakub Jelinek  ---
So fixed now?  clang_delta bugs should be tracked elsewhere.

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-07 Thread doko at debian dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

--- Comment #11 from Matthias Klose  ---
$ valgrind /usr/lib/arm-linux-gnueabihf/clang_delta
--query-instances=replace-function-def-with-decl wxe_funcs.ii
==48917== Memcheck, a memory error detector
==48917== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==48917== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==48917== Command: /usr/lib/arm-linux-gnueabihf/clang_delta
--query-instances=replace-function-def-with-decl wxe_funcs.ii
==48917== 
clang_delta: /usr/lib/llvm-11/include/llvm/ADT/PointerIntPair.h:178: static
intptr_t llvm::PointerIntPairInfo::updatePointer(intptr_t, PointerT) [with PointerT = clang::Stmt*;
unsigned int IntBits = 1; PtrTraits =
llvm::PointerLikeTypeTraits; intptr_t = int]: Assertion `(PtrWord
& ~PointerBitMask) == 0 && "Pointer is not sufficiently aligned"' failed.
==48917== 
==48917== Process terminating with default action of signal 6 (SIGABRT)
==48917==at 0xB442216: __libc_do_syscall (libc-do-syscall.S:47)
==48917==by 0xB451427: __libc_signal_restore_set (internal-signals.h:104)
==48917==by 0xB451427: raise (raise.c:47)
==48917==by 0xB441D55: abort (abort.c:79)
==48917==by 0xB44C647: __assert_fail_base (assert.c:92)
==48917==by 0xB44C6D1: __assert_fail (assert.c:101)
==48917==by 0x969EAF: llvm::PointerIntPairInfo >::updatePointer(int, clang::Stmt*)
[clone .part.0] (PointerIntPair.h:178)
==48917==by 0x972259: updatePointer (SmallVector.h:345)
==48917==by 0x972259: setPointerAndInt (PointerIntPair.h:76)
==48917==by 0x972259: PointerIntPair (PointerIntPair.h:54)
==48917==by 0x972259:
clang::RecursiveASTVisitor::TraverseStmt(clang::Stmt*,
llvm::SmallVectorImpl,
llvm::PointerIntPairInfo > > >*) (RecursiveASTVisitor.h:576)
==48917==by 0x97F703: TraverseVarDecl (RecursiveASTVisitor.h:2106)
==48917==by 0x97F703:
clang::RecursiveASTVisitor::TraverseVarDecl(clang::VarDecl*)
(RecursiveASTVisitor.h:2106)
==48917==by 0x96B6EB:
clang::RecursiveASTVisitor::TraverseDeclContextHelper(clang::DeclContext*)
[clone .part.0] (RecursiveASTVisitor.h:1383)
==48917==by 0x96F179: TraverseDeclContextHelper
(RecursiveASTVisitor.h:1377)
==48917==by 0x96F179: TraverseTranslationUnitDecl
(RecursiveASTVisitor.h:1484)
==48917==by 0x96F179:
clang::RecursiveASTVisitor::TraverseDecl(clang::Decl*)
(DeclNodes.inc:595)
==48917==by 0x96B661:
ReplaceFunctionDefWithDecl::HandleTranslationUnit(clang::ASTContext&)
(ReplaceFunctionDefWithDecl.cpp:71)
==48917==by 0x4E58C47: clang::ParseAST(clang::Sema&, bool, bool)
(clang/lib/Parse/ParseAST.cpp:171)
==48917== 
==48917== HEAP SUMMARY:
==48917== in use at exit: 875,117 bytes in 3,394 blocks
==48917==   total heap usage: 3,646 allocs, 252 frees, 989,805 bytes allocated
==48917== 
==48917== LEAK SUMMARY:
==48917==definitely lost: 0 bytes in 0 blocks
==48917==indirectly lost: 0 bytes in 0 blocks
==48917==  possibly lost: 0 bytes in 0 blocks
==48917==still reachable: 875,117 bytes in 3,394 blocks
==48917== suppressed: 0 bytes in 0 blocks
==48917== Rerun with --leak-check=full to see details of leaked memory
==48917== 
==48917== For lists of detected and suppressed errors, rerun with: -s
==48917== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Aborted (core dumped)

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-07 Thread doko at debian dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

--- Comment #10 from Matthias Klose  ---
to reproduce the clang_delta segfault:

$ cat wxe_funcs.ii
static __typeof() a __attribute__((__weakref__("pthread_mutex_destroy")))

$ /usr/lib/arm-linux-gnueabihf/clang_delta
--query-instances=replace-function-def-with-decl wxe_funcs.ii
clang_delta: /usr/lib/llvm-11/include/llvm/ADT/PointerIntPair.h:178: static
intptr_t llvm::PointerIntPairInfo::updatePointer(intptr_t, PointerT) [with PointerT = clang::Stmt*;
unsigned int IntBits = 1; PtrTraits =
llvm::PointerLikeTypeTraits; intptr_t = int]: Assertion `(PtrWord
& ~PointerBitMask) == 0 && "Pointer is not sufficiently aligned"' failed.
Aborted (core dumped)

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-07 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

--- Comment #9 from Jakub Jelinek  ---
It doesn't surprise me that creduce/cvise is uneasy about it, because that
testcase really can't be reduced.
You'd need to reduce by hand, e.g. to:
#define A(n) if (a[n]) a[n]++;
#define B(n) A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) A(n##5) A(n##6) A(n##7)
A(n##8) A(n##9)
#define C(n) B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) B(n##5) B(n##6) B(n##7)
B(n##8) B(n##9)
#define D(n) C(n##0) C(n##1) C(n##2) C(n##3) C(n##4) C(n##5) C(n##6) C(n##7)
C(n##8) C(n##9)
#define E(n) D(n##0) D(n##1) D(n##2) D(n##3) D(n##4) D(n##5) D(n##6) D(n##7)
D(n##8) D(n##9)

unsigned
foo (int n, int m, int *a)
{
  unsigned int b, c, d, e, f, g, h, i;
  b = a[m] ? a[m + 4] : a[m + 5];
  c = a[m + 1];
  d = a[m + 2];
  e = a[m + 3];
  f = c * b;
  g = d * b * b;
  h = e * b * b * b;
  i = f + g + h;
  E(1) E(2)
  b = a[m] ? a[m + 4] : a[m + 5];
  c = a[m + 1];
  d = a[m + 2];
  e = a[m + 3];
  f = c * b;
  g = d * b * b;
  h = e * b * b * b;
  return (f + g + h) * i;
}
which indeed ICEs with unfixed gcc on 32-bit hosts at -O2, as this testcase has
more than 4 basic blocks and uses phi_rank/bb_rank of the bbs with negative
ranks.
during GIMPLE pass: reassoc
pr98557.c: In function ‘foo’:
pr98557.c:8:1: internal compiler error: in insert_operand_rank, at
tree-ssa-reassoc.c:367
8 | foo (int n, int m, int *a)
  | ^~~
0x8380d90 insert_operand_rank
../../gcc/tree-ssa-reassoc.c:367
0x8380d90 insert_operand_rank
../../gcc/tree-ssa-reassoc.c:365
0x8d3ea02 get_rank
../../gcc/tree-ssa-reassoc.c:455
0x8d3eb14 get_rank
../../gcc/tree-ssa-reassoc.c:322
0x8d3eb14 propagate_rank
../../gcc/tree-ssa-reassoc.c:348
0x8d3eb14 get_rank
../../gcc/tree-ssa-reassoc.c:442
0x8d3eb14 get_rank
../../gcc/tree-ssa-reassoc.c:322
0x8d3eb14 propagate_rank
../../gcc/tree-ssa-reassoc.c:348
0x8d3eb14 get_rank
../../gcc/tree-ssa-reassoc.c:442
0x8d3eb14 get_rank
../../gcc/tree-ssa-reassoc.c:322
0x8d3eb14 propagate_rank
../../gcc/tree-ssa-reassoc.c:348
0x8d3eb14 get_rank
../../gcc/tree-ssa-reassoc.c:442
0x8d3ecb6 get_rank
../../gcc/vec.h:290
0x8d3ecb6 add_to_ops_vec
../../gcc/tree-ssa-reassoc.c:569
0x8d3f58e linearize_expr_tree
../../gcc/tree-ssa-reassoc.c:5711
0x8d3f443 linearize_expr_tree
../../gcc/tree-ssa-reassoc.c:5753
0x8d3f443 linearize_expr_tree
../../gcc/tree-ssa-reassoc.c:5753
0x8d45f2c reassociate_bb
../../gcc/tree-ssa-reassoc.c:6492
0x8d461f2 reassociate_bb
../../gcc/tree-ssa-reassoc.c:6656
0x8d484b5 do_reassoc
../../gcc/tree-ssa-reassoc.c:6768
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

But I'm not sure the testcase is desirable for the testsuite, because it takes
to compile 105 seconds on a fast machine.

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

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

--- Comment #8 from Martin Liška  ---
Note that C-Vise now reports similarly to C-Reduce.

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

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

Martin Liška  changed:

   What|Removed |Added

 Status|WAITING |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |marxin at gcc dot 
gnu.org

--- Comment #7 from Martin Liška  ---
I bet it's fixed (as PR98514 is fixed), I'll verify that later this week.

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-07 Thread doko at debian dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

--- Comment #6 from Matthias Klose  ---
Created attachment 49907
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49907=edit
preprocessed source

attaching the 50% reduced file, still showing the clang_delta issue.

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-07 Thread doko at debian dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

--- Comment #5 from Matthias Klose  ---
fyi, creduce segfaults on arm-linux-gnueabihf trying to reduce this:

$ creduce ./cr2.sh wxe_funcs.ii
===< 26689 >===
running 4 interestingness tests in parallel
===< pass_unifdef :: 0 >===
===< pass_comments :: 0 >===
(0.1 %, 5992612 bytes)
(0.1 %, 5989171 bytes)
===< pass_ifs :: 0 >===
===< pass_includes :: 0 >===
===< pass_line_markers :: 0 >===
(5.2 %, 5683057 bytes)
===< pass_blank :: 0 >===
(6.0 %, 5637660 bytes)
===< pass_clang_binsrch :: replace-function-def-with-decl >===
clang_delta: /usr/lib/llvm-11/include/llvm/ADT/PointerIntPair.h:178: static
intptr_t llvm::PointerIntPairInfo::updatePointer(intptr_t, PointerT) [with PointerT = clang::Stmt*;
unsigned int IntBits = 1; PtrTraits =
llvm::PointerLikeTypeTraits; intptr_t = int]: Assertion `(PtrWord
& ~PointerBitMask) == 0 && "Pointer is not sufficiently aligned"' failed.
Aborted (core dumped)
Use of uninitialized value $line in pattern match (m//) at
/usr/share/creduce/perl/pass_clang_binsrch.pm line 36.
===< pass_clang_binsrch :: remove-unused-function >===
clang_delta: /usr/lib/llvm-11/include/llvm/ADT/PointerIntPair.h:178: static
intptr_t llvm::PointerIntPairInfo::updatePointer(intptr_t, PointerT) [with PointerT = clang::Stmt*;
unsigned int IntBits = 1; PtrTraits =
llvm::PointerLikeTypeTraits; intptr_t = int]: Assertion `(PtrWord
& ~PointerBitMask) == 0 && "Pointer is not sufficiently aligned"' failed.
Aborted (core dumped)
Use of uninitialized value $line in pattern match (m//) at
/usr/share/creduce/perl/pass_clang_binsrch.pm line 36.
===< pass_lines :: 0 >===
(5.9 %, 5642847 bytes)
[...]

cvise doesn't show any segfaults, but is skipping these two passes as well:

00:04:32 INFO ===< BlankPass >===
00:05:52 INFO (5.9%, 5645707 bytes, 113225 lines)
00:07:15 DEBUG Creating pass root folder: /tmp/cvise-6w2dcu0a
00:07:15 INFO ===< ClangBinarySearchPass::replace-function-def-with-decl >===
00:07:23 DEBUG available transformation opportunities for c++98: 0, took: 8.22
s
00:07:33 DEBUG available transformation opportunities for c++11: 0, took: 9.38
s
00:07:41 DEBUG available transformation opportunities for c++14: 0, took: 7.99
s
00:07:50 DEBUG available transformation opportunities for c++17: 0, took: 9.73
s
00:08:02 DEBUG available transformation opportunities for c++20: 0, took: 11.24
s
00:08:02 INFO using C++ standard: c++98 with 0 transformation opportunities
00:08:12 DEBUG Creating pass root folder: /tmp/cvise-zq6tn5o2
00:08:12 INFO ===< ClangBinarySearchPass::remove-unused-function >===
00:08:20 DEBUG available transformation opportunities for c++98: 0, took: 8.21
s
00:08:31 DEBUG available transformation opportunities for c++11: 0, took: 10.69
s
00:08:46 DEBUG available transformation opportunities for c++14: 0, took: 15.39
s
00:08:57 DEBUG available transformation opportunities for c++17: 0, took: 10.66
s
00:09:05 DEBUG available transformation opportunities for c++20: 0, took: 7.99
s
00:09:05 INFO using C++ standard: c++98 with 0 transformation opportunities
00:09:13 DEBUG Creating pass root folder: /tmp/cvise-ftvo6ifx
00:09:13 INFO ===< LinesPass::0 >===

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-07 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |11.0
 Status|UNCONFIRMED |WAITING
 Ever confirmed|0   |1
   Last reconfirmed||2021-01-07

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-06 Thread doko at debian dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

--- Comment #4 from Matthias Klose  ---
I'll recheck with an updated build from trunk

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

--- Comment #3 from Jakub Jelinek  ---
(In reply to Martin Liška from comment #1)
> Can't reproduce with a cross compiler :/

If it is a dup, you wouldn't reproduce that with a cross, unless it was a cross
from 32-bit host.

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek  ---
Dup of PR98514 ?

[Bug target/98557] [11 Regression] ICE in insert_operand_rank, at tree-ssa-reassoc.c:367 on arm-linux-gnueabihf

2021-01-06 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98557

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška  ---
Can't reproduce with a cross compiler :/