public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275
@ 2021-02-08  9:14 marxin at gcc dot gnu.org
  2021-02-09 17:20 ` [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427 jakub at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-02-08  9:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98998
           Summary: ICE in change_address_1, at emit-rtl.c:2275
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: rsandifo at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-linux-gnu
            Target: arm-linux-gnueabi

Likely similar to PR97269:

$ gcc /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/ext/vla15.C
-mcpu=cortex-m1 -mpure-code -fstack-protector -c
during RTL pass: mach
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/ext/vla15.C: In function ‘int
main()’:
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/ext/vla15.C:23:1: internal
compiler error: in change_address_1, at emit-rtl.c:2275
   23 | }
      | ^
0x62057d change_address_1
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-arm/build/gcc/emit-rtl.c:2275
0x9d275d emit_move_insn(rtx_def*, rtx_def*)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-arm/build/gcc/expr.c:3932
0x12becc9 gen_split_74(rtx_insn*, rtx_def**)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-arm/build/gcc/config/arm/arm.md:9219
0x9a143e try_split(rtx_def*, rtx_insn*, int)
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-arm/build/gcc/emit-rtl.c:3834
0xc366c1 split_insn
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-arm/build/gcc/recog.c:3361
0xc3bdd7 split_all_insns_noflow()
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-arm/build/gcc/recog.c:3523
0xfc209a arm_reorg
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-arm/build/gcc/config/arm/arm.c:19153
0xc646a9 execute
       
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-trunk-arm/build/gcc/reorg.c:4028
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] 11+ messages in thread

* [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427
  2021-02-08  9:14 [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275 marxin at gcc dot gnu.org
@ 2021-02-09 17:20 ` jakub at gcc dot gnu.org
  2021-02-09 17:20 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-09 17:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-02-09
             Status|UNCONFIRMED                 |NEW
                 CC|                            |jakub at gcc dot gnu.org
            Summary|ICE in change_address_1, at |[11 Regression] ICE in
                   |emit-rtl.c:2275             |change_address_1, at
                   |                            |emit-rtl.c:2275 since
                   |                            |r11-3427

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r11-3427-ge94797250b403d66cb3624a594e41faf0dd76617

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

* [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427
  2021-02-08  9:14 [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275 marxin at gcc dot gnu.org
  2021-02-09 17:20 ` [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427 jakub at gcc dot gnu.org
@ 2021-02-09 17:20 ` jakub at gcc dot gnu.org
  2021-02-11 11:30 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-09 17:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
   Target Milestone|---                         |11.0

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

* [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427
  2021-02-08  9:14 [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275 marxin at gcc dot gnu.org
  2021-02-09 17:20 ` [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427 jakub at gcc dot gnu.org
  2021-02-09 17:20 ` jakub at gcc dot gnu.org
@ 2021-02-11 11:30 ` jakub at gcc dot gnu.org
  2021-02-11 11:54 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-11 11:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As this is a post-reload splitter, I guess one can't call
arm_legitimize_address on the force_const_mem's address because that would
create pseudos (and it doesn't seem to do anything with SYMBOL_REFs anyway).
Dunno if just forcing the address into operands[2] register would do the job.
Richard?

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

* [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427
  2021-02-08  9:14 [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275 marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-02-11 11:30 ` jakub at gcc dot gnu.org
@ 2021-02-11 11:54 ` jakub at gcc dot gnu.org
  2021-02-11 12:17 ` rsandifo at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-11 11:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
--- gcc/config/arm/arm.md.jj    2021-01-04 10:25:44.404170742 +0100
+++ gcc/config/arm/arm.md       2021-02-11 12:50:26.049604711 +0100
@@ -9216,6 +9216,11 @@
       else
        {
          rtx mem = force_const_mem (SImode, operands[1]);
+         if (!general_operand (mem, SImode))
+           {
+             emit_move_insn (operands[2], XEXP (mem, 0));
+             mem = replace_equiv_address (mem, operands[2], false);
+           }
          emit_move_insn (operands[2], mem);
        }
     }
@@ -9299,6 +9304,11 @@
       else
        {
          rtx mem = force_const_mem (SImode, operands[1]);
+         if (!general_operand (mem, SImode))
+           {
+             emit_move_insn (operands[3], XEXP (mem, 0));
+             mem = replace_equiv_address (mem, operands[3], false);
+           }
          emit_move_insn (operands[3], mem);
        }
     }
actually seems to work, and because before r11-3427 the code has done
emit_move_insn (operands[{2,3}], XEXP (force_const_mem (...), [0])); I think it
must work.

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

* [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427
  2021-02-08  9:14 [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275 marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-02-11 11:54 ` jakub at gcc dot gnu.org
@ 2021-02-11 12:17 ` rsandifo at gcc dot gnu.org
  2021-02-11 12:20 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2021-02-11 12:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Thanks for looking at this, and sorry for not having got to
it before now.  I've been spending most of the past week fighting
the WRF thing.

(In reply to Jakub Jelinek from comment #3)
> --- gcc/config/arm/arm.md.jj	2021-01-04 10:25:44.404170742 +0100
> +++ gcc/config/arm/arm.md	2021-02-11 12:50:26.049604711 +0100
> @@ -9216,6 +9216,11 @@
>        else
>  	{
>  	  rtx mem = force_const_mem (SImode, operands[1]);
> +	  if (!general_operand (mem, SImode))
> +	    {
> +	      emit_move_insn (operands[2], XEXP (mem, 0));
> +	      mem = replace_equiv_address (mem, operands[2], false);
> +	    }
>  	  emit_move_insn (operands[2], mem);
>  	}
>      }
> @@ -9299,6 +9304,11 @@
>        else
>  	{
>  	  rtx mem = force_const_mem (SImode, operands[1]);
> +	  if (!general_operand (mem, SImode))
> +	    {
> +	      emit_move_insn (operands[3], XEXP (mem, 0));
> +	      mem = replace_equiv_address (mem, operands[3], false);
> +	    }
>  	  emit_move_insn (operands[3], mem);
>  	}
>      }
> actually seems to work, and because before r11-3427 the code has done
> emit_move_insn (operands[{2,3}], XEXP (force_const_mem (...), [0])); I think
> it must work.
Yeah, this definitely looks plausible.

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

* [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427
  2021-02-08  9:14 [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275 marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-02-11 12:17 ` rsandifo at gcc dot gnu.org
@ 2021-02-11 12:20 ` jakub at gcc dot gnu.org
  2021-02-11 14:36 ` clyon at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-11 12:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Thanks, will test it.
No idea what to do for testcase though, lost in all the incompatible options
and can't find a single gcc.target/arm/ test with -mpure-code in dg-*options.

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

* [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427
  2021-02-08  9:14 [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275 marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-02-11 12:20 ` jakub at gcc dot gnu.org
@ 2021-02-11 14:36 ` clyon at gcc dot gnu.org
  2021-02-16 15:00 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: clyon at gcc dot gnu.org @ 2021-02-11 14:36 UTC (permalink / raw)
  To: gcc-bugs

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

Christophe Lyon <clyon at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clyon at gcc dot gnu.org

--- Comment #6 from Christophe Lyon <clyon at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #5)
> Thanks, will test it.
> No idea what to do for testcase though, lost in all the incompatible options
> and can't find a single gcc.target/arm/ test with -mpure-code in dg-*options.

Such tests are in gcc.target/arm/pure-code/

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

* [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427
  2021-02-08  9:14 [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275 marxin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-02-11 14:36 ` clyon at gcc dot gnu.org
@ 2021-02-16 15:00 ` jakub at gcc dot gnu.org
  2021-02-19 12:09 ` cvs-commit at gcc dot gnu.org
  2021-02-19 12:10 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-16 15:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427
  2021-02-08  9:14 [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275 marxin at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2021-02-16 15:00 ` jakub at gcc dot gnu.org
@ 2021-02-19 12:09 ` cvs-commit at gcc dot gnu.org
  2021-02-19 12:10 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-19 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

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

commit r11-7295-g1a132c4d7cdb22cbab85b8596418daa2c3157812
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Feb 19 13:05:47 2021 +0100

    arm: Fix ICE with -fstack-protector -mpure-code [PR98998]

    The vla15.C testcase ICEs with
    -mcpu=cortex-m1 -mpure-code -fstack-protector -mthumb
    as what force_const_mem returns (a SYMBOL_REF) is not a valid
    memory address.
    Previously the code was moving the address of the force_const_mem
    into a register rather than the content of that MEM, so that instruction
    must have been supported and loading from a MEM with a single REG base
ought
    to be valid too.

    2021-02-19  Jakub Jelinek  <jakub@redhat.com>

            PR target/98998
            * config/arm/arm.md (*stack_protect_combined_set_insn,
            *stack_protect_combined_test_insn): If force_const_mem result
            is not valid general operand, force its address into the
destination
            register first.

            * gcc.target/arm/pure-code/pr98998.c: New test.

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

* [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427
  2021-02-08  9:14 [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275 marxin at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2021-02-19 12:09 ` cvs-commit at gcc dot gnu.org
@ 2021-02-19 12:10 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-02-19 12:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Should be fixed now.

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

end of thread, other threads:[~2021-02-19 12:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08  9:14 [Bug target/98998] New: ICE in change_address_1, at emit-rtl.c:2275 marxin at gcc dot gnu.org
2021-02-09 17:20 ` [Bug target/98998] [11 Regression] ICE in change_address_1, at emit-rtl.c:2275 since r11-3427 jakub at gcc dot gnu.org
2021-02-09 17:20 ` jakub at gcc dot gnu.org
2021-02-11 11:30 ` jakub at gcc dot gnu.org
2021-02-11 11:54 ` jakub at gcc dot gnu.org
2021-02-11 12:17 ` rsandifo at gcc dot gnu.org
2021-02-11 12:20 ` jakub at gcc dot gnu.org
2021-02-11 14:36 ` clyon at gcc dot gnu.org
2021-02-16 15:00 ` jakub at gcc dot gnu.org
2021-02-19 12:09 ` cvs-commit at gcc dot gnu.org
2021-02-19 12:10 ` 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).