[Bug tree-optimization/93845] [10 regression] ICE in verify_sra_access_forest, at tree-sra.c:2358

2020-02-21 Thread jamborm at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93845

Martin Jambor  changed:

   What|Removed |Added

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

--- Comment #4 from Martin Jambor  ---
Fixed with https://gcc.gnu.org/ml/gcc-patches/2020-02/msg01202.html

[Bug tree-optimization/93845] [10 regression] ICE in verify_sra_access_forest, at tree-sra.c:2358

2020-02-21 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93845

--- Comment #3 from CVS Commits  ---
The master branch has been updated by Martin Jambor :

https://gcc.gnu.org/g:4d6bf96b583d77336cf6ca643d92d068a88414fa

commit r10-6779-g4d6bf96b583d77336cf6ca643d92d068a88414fa
Author: Martin Jambor 
Date:   Fri Feb 21 13:38:22 2020 +0100

sra: Only verify sizes of scalar accesses (PR 93845)

the testcase is another example - in addition to recent PR 93516 - where
the SRA access verifier is confused by the fact that get_ref_base_extent
can return different sizes for the same type, depending whether they are
COMPONENT_REF or not.  In the previous bug I decided to keep the
verifier check for aggregate type even though it is not really important
and instead avoid easily detectable type-within-the-same-type situation.
This testcase is however a result of a fairly random looking type cast
and so cannot be handled in the same way.

Because the check is not really important for aggregates, this patch
simply disables it for non-register types.

2020-02-21  Martin Jambor  

PR tree-optimization/93845
* tree-sra.c (verify_sra_access_forest): Only test access size of
scalar types.

testsuite/
* g++.dg/tree-ssa/pr93845.C: New test.

[Bug tree-optimization/93845] [10 regression] ICE in verify_sra_access_forest, at tree-sra.c:2358

2020-02-20 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93845

Martin Liška  changed:

   What|Removed |Added

   Priority|P3  |P1
 Status|UNCONFIRMED |NEW
  Known to work||9.2.0
   Keywords||ice-on-valid-code
   Last reconfirmed||2020-02-20
 CC||jamborm at gcc dot gnu.org,
   ||marxin at gcc dot gnu.org
 Ever confirmed|0   |1
   Target Milestone|--- |10.0
  Known to fail||10.0

--- Comment #2 from Martin Liška  ---
Confirmed, started with r10-6322-g6693911f069b1ada.

[Bug tree-optimization/93845] [10 regression] ICE in verify_sra_access_forest, at tree-sra.c:2358

2020-02-20 Thread dimhen at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93845

--- Comment #1 from Dmitry G. Dyachenko  ---
'-Wall -Wextra -O3' free variant

$ cat x.ii
struct g;
struct h {
  g *operator->();
};
class i {
  void *a;
  int b;

public:
  template  f j() { return *static_cast(this); }
};
struct k : i {};
struct l : k {};
struct m {
  i n();
  i o(l, l, int);
};
struct g {
  void m_fn4(k);
};
h a;
i b;
i m::n() {
  l c, d, e = o(d, c, 0).j();
  a->m_fn4(e);
  return b;
}

$ ~/arch-gcc/r10-6309/bin/g++ -fpreprocessed -fchecking=1 -O3 -Wall -Wextra -c
x.ii

$ $ ~/arch-gcc/r10-6723/bin/g++ -fpreprocessed -fchecking=1 -O -c x.ii
during GIMPLE pass: esra
x.ii: In member function ‘i m::n()’:
x.ii:27:1: internal compiler error: in verify_sra_access_forest, at
tree-sra.c:2358
   27 | }
  | ^
0x817afd verify_sra_access_forest(access*)
/home/dimhen/src/gcc_current/gcc/tree-sra.c:2358
0x1334bca verify_all_sra_access_forests()
/home/dimhen/src/gcc_current/gcc/tree-sra.c:2403
0x1339910 analyze_all_variable_accesses
/home/dimhen/src/gcc_current/gcc/tree-sra.c:3414
0x1339e31 perform_intra_sra
/home/dimhen/src/gcc_current/gcc/tree-sra.c:4468
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.