public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/97534] New: [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf)
@ 2020-10-22 22:48 doko at debian dot org
  2020-10-23  6:04 ` [Bug target/97534] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: doko at debian dot org @ 2020-10-22 22:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97534
           Summary: [10/11 Regression] ICE in decompose, at rtl.h:2280
                    (arm-linux-gnueabihf)
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at debian dot org
  Target Milestone: ---

seen building mariadb with the gcc-10 branch and trunk, not seen without -g, or
with -O0:

$ cat btr0cu.ii
struct a {
  int b;
  void c(int d) { __atomic_fetch_sub(&b, d, int()); }
};
class e {
  a f;
  int g = 1 << 31;
  void h() { f.c(g); }
public:
  void i() {
    e j;
    j.h();
  }
} k;
void l() { k.i(); }

$ g++ -std=gnu++11 -c -g -O2 btr0cu.ii
during RTL pass: vartrack
btr0cu.ii: In function 'void l()':
btr0cu.ii:15:19: internal compiler error: in decompose, at rtl.h:2280
   15 | void l() { k.i(); }
      |                   ^
0x8d359d wi::int_traits<std::pair<rtx_def*, machine_mode> >::decompose(long
long*, unsigned int, std::pair<rtx_def*, machine_mode> const&)
        ../../src/gcc/rtl.h:2280
0x8d36ab wide_int_ref_storage<false,
false>::wide_int_ref_storage<std::pair<rtx_def*, machine_mode>
>(std::pair<rtx_def*, machine_mode> const&)
        ../../src/gcc/wide-int.h:1024
0x8d36ab generic_wide_int<wide_int_ref_storage<false, false>
>::generic_wide_int<std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*,
machine_mode> const&)
        ../../src/gcc/wide-int.h:782
0x8d36ab poly_int<1u, generic_wide_int<wide_int_ref_storage<false, false> >
>::poly_int<std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*,
machine_mode> const&)
        ../../src/gcc/poly-int.h:670
0x8d36ab wi::to_poly_wide(rtx_def const*, machine_mode)
        ../../src/gcc/rtl.h:2365
0x8d36ab neg_poly_int_rtx
        ../../src/gcc/simplify-rtx.c:64
0x8daa91 simplify_binary_operation_1
        ../../src/gcc/simplify-rtx.c:2728
0x8dfa79 simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
        ../../src/gcc/simplify-rtx.c:2342
0x8dfaef simplify_gen_binary(rtx_code, machine_mode, rtx_def*, rtx_def*)
        ../../src/gcc/simplify-rtx.c:189
0xb7294d reverse_op
        ../../src/gcc/var-tracking.c:5942
0xb7294d add_stores
        ../../src/gcc/var-tracking.c:6225
0xb6cca9 add_with_sets
        ../../src/gcc/var-tracking.c:6648
0x51b913 cselib_record_sets
        ../../src/gcc/cselib.c:2904
0x51c6cf cselib_process_insn(rtx_insn*)
        ../../src/gcc/cselib.c:3066
0xb7c5d5 vt_initialize
        ../../src/gcc/var-tracking.c:10252
0xb82185 variable_tracking_main_1
        ../../src/gcc/var-tracking.c:10481
0xb822df variable_tracking_main()
        ../../src/gcc/var-tracking.c:10534
0xb822df execute
        ../../src/gcc/var-tracking.c:10571
Please submit a full bug report,
with preprocessed source if appropriate.


gcc-10 was configured with 

--with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb 
--enable-checking=yes,extra,rtl
--enable-default-pie

gcc trunk was configured with --enable-checking=yes

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

* [Bug target/97534] [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf)
  2020-10-22 22:48 [Bug target/97534] New: [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf) doko at debian dot org
@ 2020-10-23  6:04 ` rguenth at gcc dot gnu.org
  2020-10-23  7:08 ` marxin at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-23  6:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.3

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

* [Bug target/97534] [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf)
  2020-10-22 22:48 [Bug target/97534] New: [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf) doko at debian dot org
  2020-10-23  6:04 ` [Bug target/97534] " rguenth at gcc dot gnu.org
@ 2020-10-23  7:08 ` marxin at gcc dot gnu.org
  2020-10-23 11:20 ` ktkachov at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-23  7:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Can't reproduce with a cross-compiler.

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

* [Bug target/97534] [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf)
  2020-10-22 22:48 [Bug target/97534] New: [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf) doko at debian dot org
  2020-10-23  6:04 ` [Bug target/97534] " rguenth at gcc dot gnu.org
  2020-10-23  7:08 ` marxin at gcc dot gnu.org
@ 2020-10-23 11:20 ` ktkachov at gcc dot gnu.org
  2020-11-04 16:52 ` otto at kekalainen dot net
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2020-10-23 11:20 UTC (permalink / raw)
  To: gcc-bugs

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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-10-23
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |ktkachov at gcc dot gnu.org

--- Comment #2 from ktkachov at gcc dot gnu.org ---
Confirmed.

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

* [Bug target/97534] [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf)
  2020-10-22 22:48 [Bug target/97534] New: [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf) doko at debian dot org
                   ` (2 preceding siblings ...)
  2020-10-23 11:20 ` ktkachov at gcc dot gnu.org
@ 2020-11-04 16:52 ` otto at kekalainen dot net
  2020-11-12 19:57 ` jrtc27 at jrtc27 dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: otto at kekalainen dot net @ 2020-11-04 16:52 UTC (permalink / raw)
  To: gcc-bugs

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

Otto Kekäläinen <otto at kekalainen dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |otto at kekalainen dot net

--- Comment #3 from Otto Kekäläinen <otto at kekalainen dot net> ---
I was wondering is somebody perhaps looking into creating some kind of fix for
this?

MariaDB is suffering from this issue in Debian unstable (with latest GCC, CMake
etc) and since the armhf builds are failing, MariaDB is blocked from migrating
from Debian unstable to Debian testing.

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

* [Bug target/97534] [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf)
  2020-10-22 22:48 [Bug target/97534] New: [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf) doko at debian dot org
                   ` (3 preceding siblings ...)
  2020-11-04 16:52 ` otto at kekalainen dot net
@ 2020-11-12 19:57 ` jrtc27 at jrtc27 dot com
  2020-11-13  0:58 ` rearnsha at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jrtc27 at jrtc27 dot com @ 2020-11-12 19:57 UTC (permalink / raw)
  To: gcc-bugs

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

James Clarke <jrtc27 at jrtc27 dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jrtc27 at jrtc27 dot com,
                   |                            |rearnsha at arm dot com

--- Comment #4 from James Clarke <jrtc27 at jrtc27 dot com> ---
[Adding Richard to CC]

Richard, I see you committed a big series of changes in Oct 2019 to
gcc/config/arm that affected subtraction; is it possible one of those broke
this test case?

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

* [Bug target/97534] [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf)
  2020-10-22 22:48 [Bug target/97534] New: [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf) doko at debian dot org
                   ` (4 preceding siblings ...)
  2020-11-12 19:57 ` jrtc27 at jrtc27 dot com
@ 2020-11-13  0:58 ` rearnsha at gcc dot gnu.org
  2020-11-24 16:35 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2020-11-13  0:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
No, I don't think it's related to that, in fact, I think this is just a latent
bug that's been in the code for a long time.

At one point we have a 32-bit signed integer containing INT_MIN, which is
internally represented as a 64-bit constant 0xffffffff80000000; we try to
negate that (so that we can use addition) and end up with 0x0000000080000000,
but that's not a canonical value for internal use on an SImode value (they need
to be sign-extended) and eventually this causes the compiler to trip over its
own feet.

I'm testing a patch.

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

* [Bug target/97534] [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf)
  2020-10-22 22:48 [Bug target/97534] New: [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf) doko at debian dot org
                   ` (5 preceding siblings ...)
  2020-11-13  0:58 ` rearnsha at gcc dot gnu.org
@ 2020-11-24 16:35 ` cvs-commit at gcc dot gnu.org
  2020-11-24 16:51 ` cvs-commit at gcc dot gnu.org
  2020-11-24 16:52 ` rearnsha at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-24 16:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r11-5319-gf30a9a8d9e06ae2bf38e0d25e3ca6095212c78e9
Author: Richard Earnshaw <rearnsha@arm.com>
Date:   Tue Nov 24 16:21:17 2020 +0000

    arm: correctly handle negating INT_MIN in arm_split_atomic_op [PR97534]

    arm_split_atomic_op handles subtracting a constant by converting it
    into addition of the negated constant.  But if the type of the operand
    is int and the constant is -1 we currently end up generating invalid
    RTL which can lead to an abort later on.

    The problem is that in a HOST_WIDE_INT, INT_MIN is represented as
    0xffffffff80000000 and the negation of this is 0x0000000080000000, but
    that's not a valid constant for use in SImode operations.

    The fix is straight-forward which is to use gen_int_mode rather than
    simply GEN_INT.  This knows how to correctly sign-extend the negated
    constant when this is needed.

    gcc/
            PR target/97534
            * config/arm/arm.c (arm_split_atomic_op): Use gen_int_mode when
            negating a const_int.
    gcc/testsuite
            * gcc.dg/pr97534.c: New test.

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

* [Bug target/97534] [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf)
  2020-10-22 22:48 [Bug target/97534] New: [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf) doko at debian dot org
                   ` (6 preceding siblings ...)
  2020-11-24 16:35 ` cvs-commit at gcc dot gnu.org
@ 2020-11-24 16:51 ` cvs-commit at gcc dot gnu.org
  2020-11-24 16:52 ` rearnsha at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-24 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Richard Earnshaw
<rearnsha@gcc.gnu.org>:

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

commit r10-9068-gdd2c4e4e97331b1b3d9081191d14f8967d73e31c
Author: Richard Earnshaw <rearnsha@arm.com>
Date:   Tue Nov 24 16:21:17 2020 +0000

    arm: correctly handle negating INT_MIN in arm_split_atomic_op [PR97534]

    arm_split_atomic_op handles subtracting a constant by converting it
    into addition of the negated constant.  But if the type of the operand
    is int and the constant is -1 we currently end up generating invalid
    RTL which can lead to an abort later on.

    The problem is that in a HOST_WIDE_INT, INT_MIN is represented as
    0xffffffff80000000 and the negation of this is 0x0000000080000000, but
    that's not a valid constant for use in SImode operations.

    The fix is straight-forward which is to use gen_int_mode rather than
    simply GEN_INT.  This knows how to correctly sign-extend the negated
    constant when this is needed.

    gcc/
            PR target/97534
            * config/arm/arm.c (arm_split_atomic_op): Use gen_int_mode when
            negating a const_int.
    gcc/testsuite
            * gcc.dg/pr97534.c: New test.

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

* [Bug target/97534] [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf)
  2020-10-22 22:48 [Bug target/97534] New: [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf) doko at debian dot org
                   ` (7 preceding siblings ...)
  2020-11-24 16:51 ` cvs-commit at gcc dot gnu.org
@ 2020-11-24 16:52 ` rearnsha at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2020-11-24 16:52 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:

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

--- Comment #8 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
Fixed on gcc-10 and master.

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

end of thread, other threads:[~2020-11-24 16:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22 22:48 [Bug target/97534] New: [10/11 Regression] ICE in decompose, at rtl.h:2280 (arm-linux-gnueabihf) doko at debian dot org
2020-10-23  6:04 ` [Bug target/97534] " rguenth at gcc dot gnu.org
2020-10-23  7:08 ` marxin at gcc dot gnu.org
2020-10-23 11:20 ` ktkachov at gcc dot gnu.org
2020-11-04 16:52 ` otto at kekalainen dot net
2020-11-12 19:57 ` jrtc27 at jrtc27 dot com
2020-11-13  0:58 ` rearnsha at gcc dot gnu.org
2020-11-24 16:35 ` cvs-commit at gcc dot gnu.org
2020-11-24 16:51 ` cvs-commit at gcc dot gnu.org
2020-11-24 16:52 ` rearnsha 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).