public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/94598] New: ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher
@ 2020-04-14 17:50 delia.burduv at arm dot com
  2020-04-15  5:27 ` [Bug tree-optimization/94598] [10 Regression] ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher since r10-6321-g636e80eea24b780f marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: delia.burduv at arm dot com @ 2020-04-14 17:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94598

            Bug ID: 94598
           Summary: ICE in verify_sra_access_forest, at tree-sra.c:2360
                    with -O1 or higher
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: delia.burduv at arm dot com
  Target Milestone: ---

$ cat test.c
struct a {
  int b;
  short c;
};
int d;
void e() {
  struct a f[1];
  f[d] = f[d];
}

$ ./aarch64-none-elf-gcc -O1 -c test.c
during GIMPLE pass: esra
test.c: In function 'e':
test.c:9:1: internal compiler error: in verify_sra_access_forest, at
tree-sra.c:2360
    9 | }
      | ^
0xea37a2 verify_sra_access_forest(access*)
        /home/delbur01/gnu-work/src/gcc/gcc/tree-sra.c:2359
0xea609b verify_all_sra_access_forests()
        /home/delbur01/gnu-work/src/gcc/gcc/tree-sra.c:2407
0xea9b7a analyze_all_variable_accesses
        /home/delbur01/gnu-work/src/gcc/gcc/tree-sra.c:3448
0xeaaa44 perform_intra_sra
        /home/delbur01/gnu-work/src/gcc/gcc/tree-sra.c:4502
0xeac2c2 early_intra_sra
        /home/delbur01/gnu-work/src/gcc/gcc/tree-sra.c:4532
0xeac2c2 execute
        /home/delbur01/gnu-work/src/gcc/gcc/tree-sra.c:4575
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/94598] [10 Regression] ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher since r10-6321-g636e80eea24b780f
  2020-04-14 17:50 [Bug tree-optimization/94598] New: ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher delia.burduv at arm dot com
@ 2020-04-15  5:27 ` marxin at gcc dot gnu.org
  2020-04-15  7:33 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-04-15  5:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94598

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |9.3.0
   Target Milestone|---                         |10.0
                 CC|                            |jamborm at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|                            |2020-04-15
           Priority|P3                          |P1
      Known to fail|                            |10.0
             Target|aarch64-none-elf            |aarch64-none-elf,
                   |                            |x86_64-linux-gnu
            Summary|ICE in                      |[10 Regression] ICE in
                   |verify_sra_access_forest,   |verify_sra_access_forest,
                   |at tree-sra.c:2360 with -O1 |at tree-sra.c:2360 with -O1
                   |or higher                   |or higher since
                   |                            |r10-6321-g636e80eea24b780f
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed on x86_64-linux-gnu, started with r10-6321-g636e80eea24b780f.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/94598] [10 Regression] ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher since r10-6321-g636e80eea24b780f
  2020-04-14 17:50 [Bug tree-optimization/94598] New: ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher delia.burduv at arm dot com
  2020-04-15  5:27 ` [Bug tree-optimization/94598] [10 Regression] ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher since r10-6321-g636e80eea24b780f marxin at gcc dot gnu.org
@ 2020-04-15  7:33 ` marxin at gcc dot gnu.org
  2020-04-15 10:02 ` jamborm at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-04-15  7:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94598

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jamborm at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/94598] [10 Regression] ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher since r10-6321-g636e80eea24b780f
  2020-04-14 17:50 [Bug tree-optimization/94598] New: ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher delia.burduv at arm dot com
  2020-04-15  5:27 ` [Bug tree-optimization/94598] [10 Regression] ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher since r10-6321-g636e80eea24b780f marxin at gcc dot gnu.org
  2020-04-15  7:33 ` marxin at gcc dot gnu.org
@ 2020-04-15 10:02 ` jamborm at gcc dot gnu.org
  2020-04-15 13:38 ` jamborm at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2020-04-15 10:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94598

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
For arrays of size 1, get_ref_base_and_extent knows that the expression can
only access the one element even if the index is a variable.  It seems it does
not happen if the ARRAY_REF is within a COMPONENT_REF, an expression created by
new total scalarization.  I'll adjust the assert for GCC 10 but will also have
a look at why get_ref_base_and_extent does that.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/94598] [10 Regression] ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher since r10-6321-g636e80eea24b780f
  2020-04-14 17:50 [Bug tree-optimization/94598] New: ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher delia.burduv at arm dot com
                   ` (2 preceding siblings ...)
  2020-04-15 10:02 ` jamborm at gcc dot gnu.org
@ 2020-04-15 13:38 ` jamborm at gcc dot gnu.org
  2020-04-15 15:34 ` jamborm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2020-04-15 13:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94598

--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I'm going to test the following:

--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -2357,9 +2357,11 @@ verify_sra_access_forest (struct access *root)
       gcc_assert (base == first_base);
       gcc_assert (offset == access->offset);
       gcc_assert (access->grp_unscalarizable_region
+                 || access->grp_total_scalarization
                  || size == max_size);
-      gcc_assert (!is_gimple_reg_type (access->type)
-                 || max_size == access->size);
+      gcc_assert (!access->grp_unscalarizable_region
+                 || !is_gimple_reg_type (access->type)
+                 || size == access->size);
       gcc_assert (reverse == access->reverse);

       if (access->first_child)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/94598] [10 Regression] ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher since r10-6321-g636e80eea24b780f
  2020-04-14 17:50 [Bug tree-optimization/94598] New: ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher delia.burduv at arm dot com
                   ` (3 preceding siblings ...)
  2020-04-15 13:38 ` jamborm at gcc dot gnu.org
@ 2020-04-15 15:34 ` jamborm at gcc dot gnu.org
  2020-04-16  9:07 ` cvs-commit at gcc dot gnu.org
  2020-04-16  9:40 ` jamborm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2020-04-15 15:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94598

--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I proposed the fix on the mailing list:
https://gcc.gnu.org/pipermail/gcc-patches/2020-April/543909.html

(Note that the one in comment #3 has a small but important typo.)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/94598] [10 Regression] ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher since r10-6321-g636e80eea24b780f
  2020-04-14 17:50 [Bug tree-optimization/94598] New: ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher delia.burduv at arm dot com
                   ` (4 preceding siblings ...)
  2020-04-15 15:34 ` jamborm at gcc dot gnu.org
@ 2020-04-16  9:07 ` cvs-commit at gcc dot gnu.org
  2020-04-16  9:40 ` jamborm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-16  9:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94598

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Jambor <jamborm@gcc.gnu.org>:

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

commit r10-7751-gbd87b1fddbbe7d424671ebf81c96e12d748fafc7
Author: Martin Jambor <mjambor@suse.cz>
Date:   Thu Apr 16 11:04:41 2020 +0200

    sra: Fix access verification (PR 94598)

    get_ref_base_and_extent recognizes ARRAY_REFs with variable index but
    into arrays of length one as constant offset accesses.  However,
    max_size in such cases is extended to span the whole element.  This
    confuses SRA verification when SRA also builds its (total
    scalarization) access structures to describe fields under such array -
    get_ref_base_and_extent returns different size and max_size for them.

    Fixed by not performing the check for total scalarization accesses.
    The subsequent check then had to be changed to use size and not
    max_size too, which meant it has to be skipped when the access
    structure describes a genuine variable array access.

    Bootstrapped and tested on x86_64-linux.

    2020-04-16  Martin Jambor  <mjambor@suse.cz>

            PR tree-optimization/94598
            * tree-sra.c (verify_sra_access_forest): Fix verification of total
            scalarization accesses under access to one-element arrays.

            testsuite/
            * gcc.dg/tree-ssa/pr94598.c: New test.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug tree-optimization/94598] [10 Regression] ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher since r10-6321-g636e80eea24b780f
  2020-04-14 17:50 [Bug tree-optimization/94598] New: ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher delia.burduv at arm dot com
                   ` (5 preceding siblings ...)
  2020-04-16  9:07 ` cvs-commit at gcc dot gnu.org
@ 2020-04-16  9:40 ` jamborm at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jamborm at gcc dot gnu.org @ 2020-04-16  9:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94598

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Fixed, thanks for reporting.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-04-16  9:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 17:50 [Bug tree-optimization/94598] New: ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher delia.burduv at arm dot com
2020-04-15  5:27 ` [Bug tree-optimization/94598] [10 Regression] ICE in verify_sra_access_forest, at tree-sra.c:2360 with -O1 or higher since r10-6321-g636e80eea24b780f marxin at gcc dot gnu.org
2020-04-15  7:33 ` marxin at gcc dot gnu.org
2020-04-15 10:02 ` jamborm at gcc dot gnu.org
2020-04-15 13:38 ` jamborm at gcc dot gnu.org
2020-04-15 15:34 ` jamborm at gcc dot gnu.org
2020-04-16  9:07 ` cvs-commit at gcc dot gnu.org
2020-04-16  9:40 ` jamborm at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).