public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/99596] New: arm: internal error in single_pred_edge
@ 2021-03-15 11:46 arnd at linaro dot org
  2021-03-15 11:57 ` [Bug target/99596] [11 Regression] " acoplan at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: arnd at linaro dot org @ 2021-03-15 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99596
           Summary: arm: internal error in single_pred_edge
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arnd at linaro dot org
  Target Milestone: ---

I ran into this internal compiler error while building the Linux kernel in
random configurations, made a reduced test case:

$ arm-linux-gnueabihf-gcc-11 -Os -mtune=xscale -c cfi_cmdset_0002.c 
during RTL pass: fwprop2
cfi_cmdset_0002.c: In function ‘i’:
cfi_cmdset_0002.c:16:1: internal compiler error: in single_pred_edge, at
basic-block.h:350
   16 | }
      | ^
0x7bf679 single_pred_edge
        ../../src/gcc/basic-block.h:350
0x7bf679 single_pred
        ../../src/gcc/basic-block.h:369
0x7bf679 rtl_ssa::function_info::create_degenerate_phi(rtl_ssa::ebb_info*,
rtl_ssa::set_info*)
        ../../src/gcc/rtl-ssa/blocks.cc:535
0x1860f6d rtl_ssa::function_info::finalize_new_accesses(rtl_ssa::insn_change&)
        ../../src/gcc/rtl-ssa/changes.cc:508
0x18617c3
rtl_ssa::function_info::change_insns(array_slice<rtl_ssa::insn_change*>)
        ../../src/gcc/rtl-ssa/changes.cc:659
0x1862078 rtl_ssa::function_info::change_insn(rtl_ssa::insn_change&)
        ../../src/gcc/rtl-ssa/changes.cc:717
0x172f1cd try_fwprop_subst_pattern
        ../../src/gcc/fwprop.c:552
0x172f1cd try_fwprop_subst
        ../../src/gcc/fwprop.c:625
0x172f73e forward_propagate_and_simplify
        ../../src/gcc/fwprop.c:823
0x172f73e forward_propagate_into
        ../../src/gcc/fwprop.c:883
0x172fb8a forward_propagate_into
        ../../src/gcc/fwprop.c:835
0x172fb8a fwprop_insn
        ../../src/gcc/fwprop.c:954
0x172fc49 fwprop
        ../../src/gcc/fwprop.c:992
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions.


$ cat cfi_cmdset_0002.c
register int a asm("sp");
extern int b;
typedef struct {
  long c[16 * 8 / 32];
} d;
int e;
int f;
int g;
d h;
int j(int, int, int, d);
int i(void) {
  for (;;) {
    b &&j(e, f, g, h);
    j(e, f, g, h);
  }
}

$ arm-linux-gnueabihf-gcc-11 --version
arm-linux-gnueabihf-gcc-11 (Ubuntu 11-20210310-1ubuntu1) 11.0.1 20210310
(experimental) [master revision
8dc225d311e:2453ef06221:5987d8a79cda1069c774e5c302d5597310270026]

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

* [Bug target/99596] [11 Regression] arm: internal error in single_pred_edge
  2021-03-15 11:46 [Bug target/99596] New: arm: internal error in single_pred_edge arnd at linaro dot org
@ 2021-03-15 11:57 ` acoplan at gcc dot gnu.org
  2021-03-15 12:27 ` rsandifo at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: acoplan at gcc dot gnu.org @ 2021-03-15 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

Alex Coplan <acoplan at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0
             Target|                            |arm
                 CC|                            |acoplan at gcc dot gnu.org,
                   |                            |rsandifo at gcc dot gnu.org
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
      Known to fail|                            |11.0
   Last reconfirmed|                            |2021-03-15
      Known to work|                            |10.2.1
            Summary|arm: internal error in      |[11 Regression] arm:
                   |single_pred_edge            |internal error in
                   |                            |single_pred_edge

--- Comment #1 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Confirmed on trunk. GCC 10 doesn't ICE.

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

* [Bug target/99596] [11 Regression] arm: internal error in single_pred_edge
  2021-03-15 11:46 [Bug target/99596] New: arm: internal error in single_pred_edge arnd at linaro dot org
  2021-03-15 11:57 ` [Bug target/99596] [11 Regression] " acoplan at gcc dot gnu.org
@ 2021-03-15 12:27 ` rsandifo at gcc dot gnu.org
  2021-04-08 13:06 ` [Bug rtl-optimization/99596] " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2021-03-15 12:27 UTC (permalink / raw)
  To: gcc-bugs

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

rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |rsandifo at gcc dot gnu.org

--- Comment #2 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Mine.

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

* [Bug rtl-optimization/99596] [11 Regression] arm: internal error in single_pred_edge
  2021-03-15 11:46 [Bug target/99596] New: arm: internal error in single_pred_edge arnd at linaro dot org
  2021-03-15 11:57 ` [Bug target/99596] [11 Regression] " acoplan at gcc dot gnu.org
  2021-03-15 12:27 ` rsandifo at gcc dot gnu.org
@ 2021-04-08 13:06 ` rguenth at gcc dot gnu.org
  2021-04-12 14:18 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-08 13:06 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug rtl-optimization/99596] [11 Regression] arm: internal error in single_pred_edge
  2021-03-15 11:46 [Bug target/99596] New: arm: internal error in single_pred_edge arnd at linaro dot org
                   ` (2 preceding siblings ...)
  2021-04-08 13:06 ` [Bug rtl-optimization/99596] " rguenth at gcc dot gnu.org
@ 2021-04-12 14:18 ` rguenth at gcc dot gnu.org
  2021-04-16 11:38 ` cvs-commit at gcc dot gnu.org
  2021-04-16 11:41 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-04-12 14:18 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Richard, any progress?

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

* [Bug rtl-optimization/99596] [11 Regression] arm: internal error in single_pred_edge
  2021-03-15 11:46 [Bug target/99596] New: arm: internal error in single_pred_edge arnd at linaro dot org
                   ` (3 preceding siblings ...)
  2021-04-12 14:18 ` rguenth at gcc dot gnu.org
@ 2021-04-16 11:38 ` cvs-commit at gcc dot gnu.org
  2021-04-16 11:41 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-16 11:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Sandiford <rsandifo@gcc.gnu.org>:

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

commit r11-8213-gb4d6af55fe55c0eab87ab875bfd0346677e12236
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Fri Apr 16 12:38:01 2021 +0100

    rtlanal: Don't assume that calls write to a global SP [PR99596]

    This patch is a GCC 11 regression caused by the rtl-ssa code.
    Normally we treat calls as containing a potential set of a global
    register, but DF makes a sensible exception for the stack pointer:

          if (i == STACK_POINTER_REGNUM)
            /* The stack ptr is used (honorarily) by a CALL insn.  */
            df_ref_record (DF_REF_BASE, collection_rec, regno_reg_rtx[i],
                           NULL, bb, insn_info, DF_REF_REG_USE,
                           DF_REF_CALL_STACK_USAGE | flags);
          else if (global_regs[i])
            {
              /* Calls to const functions cannot access any global registers
and
                 calls to pure functions cannot set them.  All other calls may
                 reference any of the global registers, so they are recorded as
                 used. */

    The only DF definition of SP was therefore the one in the entry block.
    However, the rtlanal.c rtx_properties code (wrongly) assumed that calls
    also clobbered the global SP.  This led to multiple definitions of SP
    when we only expected one.

    This patch tightens the rtlanal.c handling of global registers
    to match the DF approach.

    gcc/
            PR rtl-optimization/99596
            * rtlanal.c (rtx_properties::try_to_add_insn): Don't add global
            register accesses for const calls.  Assume that pure functions
            can only read from global registers.  Ignore cases in which
            the stack pointer has been marked global.

    gcc/testsuite/
            PR rtl-optimization/99596
            * gcc.target/arm/pr99596.c: New test.

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

* [Bug rtl-optimization/99596] [11 Regression] arm: internal error in single_pred_edge
  2021-03-15 11:46 [Bug target/99596] New: arm: internal error in single_pred_edge arnd at linaro dot org
                   ` (4 preceding siblings ...)
  2021-04-16 11:38 ` cvs-commit at gcc dot gnu.org
@ 2021-04-16 11:41 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-04-16 11:41 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-04-16 11:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 11:46 [Bug target/99596] New: arm: internal error in single_pred_edge arnd at linaro dot org
2021-03-15 11:57 ` [Bug target/99596] [11 Regression] " acoplan at gcc dot gnu.org
2021-03-15 12:27 ` rsandifo at gcc dot gnu.org
2021-04-08 13:06 ` [Bug rtl-optimization/99596] " rguenth at gcc dot gnu.org
2021-04-12 14:18 ` rguenth at gcc dot gnu.org
2021-04-16 11:38 ` cvs-commit at gcc dot gnu.org
2021-04-16 11:41 ` jakub 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).