public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/109800] New: [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian
@ 2023-05-10 16:32 acoplan at gcc dot gnu.org
  2023-05-11  6:25 ` [Bug target/109800] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: acoplan at gcc dot gnu.org @ 2023-05-10 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109800
           Summary: [11/12/13/14 Regression] arm: ICE (segfault) loading
                    double with -mpure-code -mbig-endian
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

The following fails:

$ cat t.c
double f() { return 5.0; }
$ gcc/xgcc -B gcc -c -S -o /dev/null -O2 -march=armv7-m -mfloat-abi=hard
-mfpu=fpv4-sp-d16 -mbig-endian -mpure-code t.c
xgcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.

It started with r11-966-g9a182ef9ee011935d827ab5c6c9a7cd8e22257d8 .

Looking at the dumpfile 291r.split1, it looks like we end up splitting
indefinitely:

;; Function f (f, funcdef_no=0, decl_uid=5948, cgraph_uid=1, symbol_order=0)

Splitting with gen_split_111 (vfp.md:2138)
scanning new insn with uid = 12.
scanning new insn with uid = 13.
deleting insn with uid = 9.
Splitting with gen_split_111 (vfp.md:2138)
scanning new insn with uid = 14.
scanning new insn with uid = 15.
deleting insn with uid = 12.
Splitting with gen_split_111 (vfp.md:2138)
scanning new insn with uid = 16.
scanning new insn with uid = 17.
deleting insn with uid = 14.

I think we can adjust the splitter to avoid the new simplification introduced
above from undoing our subreg punning.

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

* [Bug target/109800] [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian
  2023-05-10 16:32 [Bug target/109800] New: [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian acoplan at gcc dot gnu.org
@ 2023-05-11  6:25 ` rguenth at gcc dot gnu.org
  2023-05-11 11:21 ` acoplan at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-11  6:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.4

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

* [Bug target/109800] [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian
  2023-05-10 16:32 [Bug target/109800] New: [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian acoplan at gcc dot gnu.org
  2023-05-11  6:25 ` [Bug target/109800] " rguenth at gcc dot gnu.org
@ 2023-05-11 11:21 ` acoplan at gcc dot gnu.org
  2023-05-25 12:35 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: acoplan at gcc dot gnu.org @ 2023-05-11 11:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2023-May/618
                   |                            |156.html
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |acoplan at gcc dot gnu.org
           Keywords|                            |patch
   Last reconfirmed|                            |2023-05-11

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

* [Bug target/109800] [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian
  2023-05-10 16:32 [Bug target/109800] New: [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian acoplan at gcc dot gnu.org
  2023-05-11  6:25 ` [Bug target/109800] " rguenth at gcc dot gnu.org
  2023-05-11 11:21 ` acoplan at gcc dot gnu.org
@ 2023-05-25 12:35 ` cvs-commit at gcc dot gnu.org
  2023-05-29 10:08 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-25 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Alex Coplan <acoplan@gcc.gnu.org>:

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

commit r14-1239-gf5298d9969b4fa34ff3aecd54b9630e22b2984a5
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Thu May 25 13:34:46 2023 +0100

    arm: Fix ICE due to infinite splitting [PR109800]

    In r11-966-g9a182ef9ee011935d827ab5c6c9a7cd8e22257d8 we introduce a
    simplification to emit_move_insn that attempts to simplify moves of the
form:

    (set (subreg:M1 (reg:M2 ...)) (constant C))

    where M1 and M2 are of equal mode size. That is problematic for the
splitter
    vfp.md:no_literal_pool_df_immediate in the arm backend, which tries to pun
an
    lvalue DFmode pseudo into DImode and assign a constant to it with
    emit_move_insn, as the new transformation simply undoes this, and we end up
    splitting indefinitely.

    This patch changes things around in the arm backend so that we use a
    DImode temporary (instead of DFmode) and first load the DImode constant
    into the pseudo, and then pun the pseudo into DFmode as an rvalue in a
    reg -> reg move. I believe this should be semantically equivalent but
    avoids the pathalogical behaviour seen in the PR.

    gcc/ChangeLog:

            PR target/109800
            * config/arm/arm.md (movdf): Generate temporary pseudo in DImode
            instead of DFmode.
            * config/arm/vfp.md (no_literal_pool_df_immediate): Rather than
punning an
            lvalue DFmode pseudo into DImode, use a DImode pseudo and pun it
into
            DFmode as an rvalue.

    gcc/testsuite/ChangeLog:

            PR target/109800
            * gcc.target/arm/pure-code/pr109800.c: New test.

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

* [Bug target/109800] [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian
  2023-05-10 16:32 [Bug target/109800] New: [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian acoplan at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-05-25 12:35 ` cvs-commit at gcc dot gnu.org
@ 2023-05-29 10:08 ` jakub at gcc dot gnu.org
  2023-06-07 14:12 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-29 10:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.4                        |11.5

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.4 is being released, retargeting bugs to GCC 11.5.

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

* [Bug target/109800] [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian
  2023-05-10 16:32 [Bug target/109800] New: [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian acoplan at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-05-29 10:08 ` jakub at gcc dot gnu.org
@ 2023-06-07 14:12 ` cvs-commit at gcc dot gnu.org
  2023-06-08 17:31 ` [Bug target/109800] [11/12 " cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-07 14:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Alex Coplan
<acoplan@gcc.gnu.org>:

https://gcc.gnu.org/g:98682182e394a0ebc96ba74d7958912ab328dee8

commit r13-7425-g98682182e394a0ebc96ba74d7958912ab328dee8
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Thu May 25 13:34:46 2023 +0100

    arm: Fix ICE due to infinite splitting [PR109800]

    In r11-966-g9a182ef9ee011935d827ab5c6c9a7cd8e22257d8 we introduce a
    simplification to emit_move_insn that attempts to simplify moves of the
form:

    (set (subreg:M1 (reg:M2 ...)) (constant C))

    where M1 and M2 are of equal mode size. That is problematic for the
splitter
    vfp.md:no_literal_pool_df_immediate in the arm backend, which tries to pun
an
    lvalue DFmode pseudo into DImode and assign a constant to it with
    emit_move_insn, as the new transformation simply undoes this, and we end up
    splitting indefinitely.

    This patch changes things around in the arm backend so that we use a
    DImode temporary (instead of DFmode) and first load the DImode constant
    into the pseudo, and then pun the pseudo into DFmode as an rvalue in a
    reg -> reg move. I believe this should be semantically equivalent but
    avoids the pathalogical behaviour seen in the PR.

    gcc/ChangeLog:

            PR target/109800
            * config/arm/arm.md (movdf): Generate temporary pseudo in DImode
            instead of DFmode.
            * config/arm/vfp.md (no_literal_pool_df_immediate): Rather than
punning an
            lvalue DFmode pseudo into DImode, use a DImode pseudo and pun it
into
            DFmode as an rvalue.

    gcc/testsuite/ChangeLog:

            PR target/109800
            * gcc.target/arm/pure-code/pr109800.c: New test.

    (cherry picked from commit f5298d9969b4fa34ff3aecd54b9630e22b2984a5)

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

* [Bug target/109800] [11/12 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian
  2023-05-10 16:32 [Bug target/109800] New: [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian acoplan at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-06-07 14:12 ` cvs-commit at gcc dot gnu.org
@ 2023-06-08 17:31 ` cvs-commit at gcc dot gnu.org
  2023-06-09 11:18 ` [Bug target/109800] [11 " cvs-commit at gcc dot gnu.org
  2023-06-09 11:19 ` acoplan at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-08 17:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Alex Coplan
<acoplan@gcc.gnu.org>:

https://gcc.gnu.org/g:43619dc6e120a80305d4a52d7f9b8833c110a7db

commit r12-9684-g43619dc6e120a80305d4a52d7f9b8833c110a7db
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Thu May 25 13:34:46 2023 +0100

    arm: Fix ICE due to infinite splitting [PR109800]

    In r11-966-g9a182ef9ee011935d827ab5c6c9a7cd8e22257d8 we introduce a
    simplification to emit_move_insn that attempts to simplify moves of the
form:

    (set (subreg:M1 (reg:M2 ...)) (constant C))

    where M1 and M2 are of equal mode size. That is problematic for the
splitter
    vfp.md:no_literal_pool_df_immediate in the arm backend, which tries to pun
an
    lvalue DFmode pseudo into DImode and assign a constant to it with
    emit_move_insn, as the new transformation simply undoes this, and we end up
    splitting indefinitely.

    This patch changes things around in the arm backend so that we use a
    DImode temporary (instead of DFmode) and first load the DImode constant
    into the pseudo, and then pun the pseudo into DFmode as an rvalue in a
    reg -> reg move. I believe this should be semantically equivalent but
    avoids the pathalogical behaviour seen in the PR.

    gcc/ChangeLog:

            PR target/109800
            * config/arm/arm.md (movdf): Generate temporary pseudo in DImode
            instead of DFmode.
            * config/arm/vfp.md (no_literal_pool_df_immediate): Rather than
punning an
            lvalue DFmode pseudo into DImode, use a DImode pseudo and pun it
into
            DFmode as an rvalue.

    gcc/testsuite/ChangeLog:

            PR target/109800
            * gcc.target/arm/pure-code/pr109800.c: New test.

    (cherry picked from commit f5298d9969b4fa34ff3aecd54b9630e22b2984a5)

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

* [Bug target/109800] [11 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian
  2023-05-10 16:32 [Bug target/109800] New: [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian acoplan at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-06-08 17:31 ` [Bug target/109800] [11/12 " cvs-commit at gcc dot gnu.org
@ 2023-06-09 11:18 ` cvs-commit at gcc dot gnu.org
  2023-06-09 11:19 ` acoplan at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-06-09 11:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Alex Coplan
<acoplan@gcc.gnu.org>:

https://gcc.gnu.org/g:2d3b72cbbfe7fb38b0e3b8ef2119156cbce57488

commit r11-10852-g2d3b72cbbfe7fb38b0e3b8ef2119156cbce57488
Author: Alex Coplan <alex.coplan@arm.com>
Date:   Thu May 25 13:34:46 2023 +0100

    arm: Fix ICE due to infinite splitting [PR109800]

    In r11-966-g9a182ef9ee011935d827ab5c6c9a7cd8e22257d8 we introduce a
    simplification to emit_move_insn that attempts to simplify moves of the
form:

    (set (subreg:M1 (reg:M2 ...)) (constant C))

    where M1 and M2 are of equal mode size. That is problematic for the
splitter
    vfp.md:no_literal_pool_df_immediate in the arm backend, which tries to pun
an
    lvalue DFmode pseudo into DImode and assign a constant to it with
    emit_move_insn, as the new transformation simply undoes this, and we end up
    splitting indefinitely.

    This patch changes things around in the arm backend so that we use a
    DImode temporary (instead of DFmode) and first load the DImode constant
    into the pseudo, and then pun the pseudo into DFmode as an rvalue in a
    reg -> reg move. I believe this should be semantically equivalent but
    avoids the pathalogical behaviour seen in the PR.

    gcc/ChangeLog:

            PR target/109800
            * config/arm/arm.md (movdf): Generate temporary pseudo in DImode
            instead of DFmode.
            * config/arm/vfp.md (no_literal_pool_df_immediate): Rather than
punning an
            lvalue DFmode pseudo into DImode, use a DImode pseudo and pun it
into
            DFmode as an rvalue.

    gcc/testsuite/ChangeLog:

            PR target/109800
            * gcc.target/arm/pure-code/pr109800.c: New test.

    (cherry picked from commit f5298d9969b4fa34ff3aecd54b9630e22b2984a5)

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

* [Bug target/109800] [11 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian
  2023-05-10 16:32 [Bug target/109800] New: [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian acoplan at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-06-09 11:18 ` [Bug target/109800] [11 " cvs-commit at gcc dot gnu.org
@ 2023-06-09 11:19 ` acoplan at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: acoplan at gcc dot gnu.org @ 2023-06-09 11:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Alex Coplan <acoplan at gcc dot gnu.org> ---
Fixed everywhere.

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

end of thread, other threads:[~2023-06-09 11:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-10 16:32 [Bug target/109800] New: [11/12/13/14 Regression] arm: ICE (segfault) loading double with -mpure-code -mbig-endian acoplan at gcc dot gnu.org
2023-05-11  6:25 ` [Bug target/109800] " rguenth at gcc dot gnu.org
2023-05-11 11:21 ` acoplan at gcc dot gnu.org
2023-05-25 12:35 ` cvs-commit at gcc dot gnu.org
2023-05-29 10:08 ` jakub at gcc dot gnu.org
2023-06-07 14:12 ` cvs-commit at gcc dot gnu.org
2023-06-08 17:31 ` [Bug target/109800] [11/12 " cvs-commit at gcc dot gnu.org
2023-06-09 11:18 ` [Bug target/109800] [11 " cvs-commit at gcc dot gnu.org
2023-06-09 11:19 ` acoplan 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).