public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/94526] New: [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze
@ 2020-04-07 22:33 jsm28 at gcc dot gnu.org
  2020-04-08  5:33 ` [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498 marxin at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2020-04-07 22:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94526
           Summary: [10 Regression] cselib ICE building glibc sigpause for
                    m68k and microblaze
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jsm28 at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---
            Target: m68k-*-* microblaze*-*-*

Created attachment 48235
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48235&action=edit
preprocessed source

The following ICE appears building glibc for m68k-linux-gnu, introduced by
commit 8662d0593438ecd498ab7591ad0d2810886eb6da ("cselib: Fix endless cselib
loop on (plus:P (reg) (const_int 0))"). This also appears for microblaze,
though I haven't bisected there to confirm the same commit introduces it.
Preprocessed source attached. Compile with -g -O2.

during RTL pass: vartrack
../sysdeps/posix/sigpause.c: In function '__default_sigpause':
../sysdeps/posix/sigpause.c:57:1: internal compiler error: in new_elt_loc_list,
at cselib.c:300
0x7cfe6b new_elt_loc_list
        /scratch/jmyers/glibc/many10/src/gcc/gcc/cselib.c:298
0x7d2c54 cselib_lookup_1
        /scratch/jmyers/glibc/many10/src/gcc/gcc/cselib.c:2301
0x7d2c54 cselib_lookup(rtx_def*, machine_mode, int, machine_mode)
        /scratch/jmyers/glibc/many10/src/gcc/gcc/cselib.c:2330
0xfaa4b8 use_type
        /scratch/jmyers/glibc/many10/src/gcc/gcc/var-tracking.c:5517
0xfab397 add_uses
        /scratch/jmyers/glibc/many10/src/gcc/gcc/var-tracking.c:5678
0xfab397 add_uses_1
        /scratch/jmyers/glibc/many10/src/gcc/gcc/var-tracking.c:5832
0xfa8abc add_with_sets
        /scratch/jmyers/glibc/many10/src/gcc/gcc/var-tracking.c:6589
0x7d5c6f cselib_record_sets
        /scratch/jmyers/glibc/many10/src/gcc/gcc/cselib.c:2835
0x7d71ca cselib_process_insn(rtx_insn*)
        /scratch/jmyers/glibc/many10/src/gcc/gcc/cselib.c:2997
0xfb097d vt_initialize
        /scratch/jmyers/glibc/many10/src/gcc/gcc/var-tracking.c:10228
0xfbdc57 variable_tracking_main_1
        /scratch/jmyers/glibc/many10/src/gcc/gcc/var-tracking.c:10457
0xfbdc57 variable_tracking_main()
        /scratch/jmyers/glibc/many10/src/gcc/gcc/var-tracking.c:10510
0xfbdc57 execute
        /scratch/jmyers/glibc/many10/src/gcc/gcc/var-tracking.c:10547
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] 10+ messages in thread

* [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498
  2020-04-07 22:33 [Bug middle-end/94526] New: [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze jsm28 at gcc dot gnu.org
@ 2020-04-08  5:33 ` marxin at gcc dot gnu.org
  2020-04-08  6:32 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-04-08  5:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[10 Regression] cselib ICE  |[10 Regression] cselib ICE
                   |building glibc sigpause for |building glibc sigpause for
                   |m68k and microblaze         |m68k and microblaze since
                   |                            |r10-7575-g8662d0593438ecd49
                   |                            |8
      Known to fail|                            |10.0
     Ever confirmed|0                           |1
      Known to work|                            |9.3.0
   Target Milestone|---                         |10.0
   Last reconfirmed|                            |2020-04-08
             Status|UNCONFIRMED                 |NEW
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Reduced test-case:

$ cat ice.i
typedef struct
{
  int __val[8 * sizeof 0];
} __sigset_t;

void
fn1 (__sigset_t *p1)
{
  __sigset_t *a = p1;
}

void fn3 ();

void
fn2 ()
{
  __sigset_t b;
  fn1 (&b);
  fn3 (b);
}

$ ./xgcc -B. -O2 -g ice.i
during RTL pass: vartrack
ice.i: In function ‘fn2’:
ice.i:20:1: internal compiler error: in new_elt_loc_list, at cselib.c:298
   20 | }
      | ^
0xb1538a new_elt_loc_list
        ../../gcc/cselib.c:298
0xb154ea new_elt_loc_list
        ../../gcc/cselib.c:322
0xb1a993 cselib_lookup_1
        ../../gcc/cselib.c:2301
0xb1aa39 cselib_lookup(rtx_def*, machine_mode, int, machine_mode)
        ../../gcc/cselib.c:2330
0x15511c7 use_type
        ../../gcc/var-tracking.c:5516
0x1551741 add_uses
        ../../gcc/var-tracking.c:5678
0x1551f8e add_uses_1
        ../../gcc/var-tracking.c:5832
0x109b117 note_uses(rtx_def**, void (*)(rtx_def**, void*), void*)
        ../../gcc/rtlanal.c:2042
0x15551c4 add_with_sets
        ../../gcc/var-tracking.c:6589
0xb1bc1e cselib_record_sets
        ../../gcc/cselib.c:2835
0xb1c40a cselib_process_insn(rtx_insn*)
        ../../gcc/cselib.c:2997
0x1560a96 vt_initialize
        ../../gcc/var-tracking.c:10228
0x156148c variable_tracking_main_1
        ../../gcc/var-tracking.c:10457
0x15615d7 variable_tracking_main()
        ../../gcc/var-tracking.c:10510
0x1561664 execute
        ../../gcc/var-tracking.c:10547
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] 10+ messages in thread

* [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498
  2020-04-07 22:33 [Bug middle-end/94526] New: [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze jsm28 at gcc dot gnu.org
  2020-04-08  5:33 ` [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498 marxin at gcc dot gnu.org
@ 2020-04-08  6:32 ` rguenth at gcc dot gnu.org
  2020-04-08 11:08 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-08  6:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498
  2020-04-07 22:33 [Bug middle-end/94526] New: [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze jsm28 at gcc dot gnu.org
  2020-04-08  5:33 ` [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498 marxin at gcc dot gnu.org
  2020-04-08  6:32 ` rguenth at gcc dot gnu.org
@ 2020-04-08 11:08 ` jakub at gcc dot gnu.org
  2020-04-08 11:17 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-08 11:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We have before var-tracking:
(insn/f:TI 33 6 7 2 (parallel [
            (set/f (reg/f:SI 14 %a6)
                (plus:SI (reg/f:SI 15 %sp)
                    (const_int -4 [0xfffffffffffffffc])))
            (set/f (mem/c:SI (plus:SI (reg/f:SI 15 %sp)
                        (const_int -4 [0xfffffffffffffffc])) [5  S4 A8])
                (reg/f:SI 14 %a6))
            (set/f (reg/f:SI 15 %sp)
                (plus:SI (reg/f:SI 15 %sp)
                    (const_int -132 [0xffffffffffffff7c])))
        ]) "pr94526.c":13:1 417 {*link}
     (nil))
(debug_insn 7 33 8 2 (var_location:SI p1 (plus:SI (reg/f:SI 15 %sp)
        (const_int 0 [0]))) "pr94526.c":15:3 -1
     (nil))
(debug_insn 8 7 9 2 (debug_marker) "pr94526.c":6:3 -1
     (nil))
(debug_insn 9 8 10 2 (var_location:SI a (plus:SI (reg/f:SI 15 %sp)
        (const_int 0 [0]))) "pr94526.c":6:13 -1
     (nil))
The first insn in this snippet is fp_setter after which we forget the sp value
so that it is not related to the hard frame pointer, thus the new
SP_DERIVED_VALUE_P VALUE has location of %sp and setting_insn NULL.
Then we have two debug insns with %sp + 0 due to reload (unnecessary).
And when processing those, we properly compute the hash of %sp + 0 the same as
hash of %sp, but rtx_equal_for_cselib_1 doesn't figure out the equality, we
create each time a different VALUE, due to the equivalency insert locs into the
%sp VALUE though and ICE on an assert that two different DEBUG_INSNs don't add
locs to the same VALUE (admittedly a weird assert).
I have two fixes, teach rtx_equal_for_cselib_1 to deal with this + 0 case, and
adjust reload so that in DEBUG_INSNs it doesn't add this useless stuff, both
fix the ICE.

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

* [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498
  2020-04-07 22:33 [Bug middle-end/94526] New: [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze jsm28 at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-04-08 11:08 ` jakub at gcc dot gnu.org
@ 2020-04-08 11:17 ` jakub at gcc dot gnu.org
  2020-04-08 14:51 ` schwab@linux-m68k.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-08 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 48242
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48242&action=edit
gcc10-pr94526.patch

Untested fix (either the cselib.c or reload1.c change fixes it).

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

* [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498
  2020-04-07 22:33 [Bug middle-end/94526] New: [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze jsm28 at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-04-08 11:17 ` jakub at gcc dot gnu.org
@ 2020-04-08 14:51 ` schwab@linux-m68k.org
  2020-04-08 14:53 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: schwab@linux-m68k.org @ 2020-04-08 14:51 UTC (permalink / raw)
  To: gcc-bugs

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

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |build

--- Comment #4 from Andreas Schwab <schwab@linux-m68k.org> ---
This breaks build on m68k.

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

* [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498
  2020-04-07 22:33 [Bug middle-end/94526] New: [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze jsm28 at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-04-08 14:51 ` schwab@linux-m68k.org
@ 2020-04-08 14:53 ` jakub at gcc dot gnu.org
  2020-04-08 15:08 ` schwab@linux-m68k.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-08 14:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
You mean the bug or the proposed patch?

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

* [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498
  2020-04-07 22:33 [Bug middle-end/94526] New: [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze jsm28 at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-04-08 14:53 ` jakub at gcc dot gnu.org
@ 2020-04-08 15:08 ` schwab@linux-m68k.org
  2020-04-08 19:24 ` cvs-commit at gcc dot gnu.org
  2020-04-08 19:25 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: schwab@linux-m68k.org @ 2020-04-08 15:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andreas Schwab <schwab@linux-m68k.org> ---
The bug, I haven't tested the patch yet.

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

* [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498
  2020-04-07 22:33 [Bug middle-end/94526] New: [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze jsm28 at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2020-04-08 15:08 ` schwab@linux-m68k.org
@ 2020-04-08 19:24 ` cvs-commit at gcc dot gnu.org
  2020-04-08 19:25 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-08 19:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:d0cc1b79b39994c917abb23f71064bb39eedcc70

commit r10-7640-gd0cc1b79b39994c917abb23f71064bb39eedcc70
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Apr 8 21:23:58 2020 +0200

    cselib, reload: Fix cselib ICE on m68k/microblaze [PR94526]

    The following testcase ICEs on m68k (and another one Jeff mailed me
    privately on microblaze).
    The problem is that reload creates two DEBUG_INSNs with the same
    value of (plus:P (reg:P sp) (const_int 0)), we compute correctly the
    same hash value for them, but then don't find them in the cselib hash
table,
    as rtx_equal_for_cselib_1 thinks it is different from (reg:P sp),
    and trigger an assertion failure that requires that from two different
debug
    insns one doesn't add locations to VALUEs.

    The patch has two fixes for this, each fixes the ICE on both targets
    separately, but I think we want both.

    The cselib.c change ensures that rtx_equal_for_cselib_1 considers
    (value:P sp_derived_value) and (plus:P (reg:P sp) (const_int 0))
equivalent.

    The reload1.c change makes sure we don't create those bogus plus 0
    expressions.  I understand the reasons for creating them, but they don't
    really apply to DEBUG_INSNs; we don't have validity matching there, all we
    care is that the expressions aren't arbitrarily deep, but it is just fine
    to fold x + 0 into just x in there.

    2020-04-08  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/94526
            * cselib.c (autoinc_split): Handle e->val_rtx being
SP_DERIVED_VALUE_P
            with zero offset.
            * reload1.c (eliminate_regs_1): Avoid creating
            (plus (reg) (const_int 0)) in DEBUG_INSNs.

            * gcc.dg/pr94526.c: New test.

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

* [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498
  2020-04-07 22:33 [Bug middle-end/94526] New: [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze jsm28 at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2020-04-08 19:24 ` cvs-commit at gcc dot gnu.org
@ 2020-04-08 19:25 ` jakub at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-08 19:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2020-04-08 19:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-07 22:33 [Bug middle-end/94526] New: [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze jsm28 at gcc dot gnu.org
2020-04-08  5:33 ` [Bug middle-end/94526] [10 Regression] cselib ICE building glibc sigpause for m68k and microblaze since r10-7575-g8662d0593438ecd498 marxin at gcc dot gnu.org
2020-04-08  6:32 ` rguenth at gcc dot gnu.org
2020-04-08 11:08 ` jakub at gcc dot gnu.org
2020-04-08 11:17 ` jakub at gcc dot gnu.org
2020-04-08 14:51 ` schwab@linux-m68k.org
2020-04-08 14:53 ` jakub at gcc dot gnu.org
2020-04-08 15:08 ` schwab@linux-m68k.org
2020-04-08 19:24 ` cvs-commit at gcc dot gnu.org
2020-04-08 19:25 ` 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).