public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/97978] New: [11 Regression] ICE in lra_assign,  at lra-assigns.c:1648
@ 2020-11-25  3:23 asolokha at gmx dot com
  2020-11-25  8:14 ` [Bug rtl-optimization/97978] [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 since r11-5066-gbe39636d9f68c437 marxin at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2020-11-25  3:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97978
           Summary: [11 Regression] ICE in lra_assign, at
                    lra-assigns.c:1648
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: x86_64-pc-linux-gnu

gcc-11.0.0-alpha20201122 snapshot (g:e23f47ec4065e9eec53c4ad9db91bc36a4f90793)
ICEs when compiling the following testcase w/ -Os -fno-PIC:

int sg;
long int kk;

#ifdef DONT_ICE
__attribute__ ((stack_protect))
#endif
void
bp (int jz, int tj, long int li)
{
  if (jz == 0 || tj == 0)
    __builtin_unreachable ();

  kk = li;
}

void
qp (void)
{
  ++kk;

  for (;;)
    bp (1l / sg, 0, ~0u);
}

% x86_64-pc-linux-gnu-gcc-11.0.0 -Os -fno-PIC -c cy3ebm8v.c
during RTL pass: reload
cy3ebm8v.c: In function 'qp':
cy3ebm8v.c:23:1: internal compiler error: in lra_assign, at lra-assigns.c:1648
   23 | }
      | ^
0xc47c5a lra_assign(bool&)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/lra-assigns.c:1648
0xc41d24 lra(_IO_FILE*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/lra.c:2381
0xbfada9 do_reload
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/ira.c:5802
0xbfada9 execute
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201122/work/gcc-11-20201122/gcc/ira.c:5988

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

* [Bug rtl-optimization/97978] [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 since r11-5066-gbe39636d9f68c437
  2020-11-25  3:23 [Bug rtl-optimization/97978] New: [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 asolokha at gmx dot com
@ 2020-11-25  8:14 ` marxin at gcc dot gnu.org
  2020-11-25 12:39 ` roger at nextmovesoftware dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-11-25  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |10.2.0
   Target Milestone|---                         |11.0
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |roger at nextmovesoftware dot com
   Last reconfirmed|                            |2020-11-25
      Known to fail|                            |11.0
            Summary|[11 Regression] ICE in      |[11 Regression] ICE in
                   |lra_assign, at              |lra_assign, at
                   |lra-assigns.c:1648          |lra-assigns.c:1648 since
                   |                            |r11-5066-gbe39636d9f68c437
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
           Priority|P3                          |P1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-5066-gbe39636d9f68c437.

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

* [Bug rtl-optimization/97978] [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 since r11-5066-gbe39636d9f68c437
  2020-11-25  3:23 [Bug rtl-optimization/97978] New: [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 asolokha at gmx dot com
  2020-11-25  8:14 ` [Bug rtl-optimization/97978] [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 since r11-5066-gbe39636d9f68c437 marxin at gcc dot gnu.org
@ 2020-11-25 12:39 ` roger at nextmovesoftware dot com
  2021-01-04 16:48 ` vmakarov at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: roger at nextmovesoftware dot com @ 2020-11-25 12:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Roger Sayle <roger at nextmovesoftware dot com> ---
The -fno-PIC isn't required, as -Os alone is sufficient to trigger this ICE.
I'm not sure if unconditionally calling __builtin_unreachable qualifies as
"valid-code" (or possibly an error condition) but lra_assign shouldn't ICE.
Removing or commenting out the conditional call to __builtin_unreachable in bp
resolves the issue.  It appears that the undefined behaviour produced by
reaching __builtin_unreachable, with the mixture of pseudos and hard registers
resulting from my change, leaves the CFG/LRA pass in an unexpected state, that
breaks a required invariant...

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

* [Bug rtl-optimization/97978] [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 since r11-5066-gbe39636d9f68c437
  2020-11-25  3:23 [Bug rtl-optimization/97978] New: [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 asolokha at gmx dot com
  2020-11-25  8:14 ` [Bug rtl-optimization/97978] [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 since r11-5066-gbe39636d9f68c437 marxin at gcc dot gnu.org
  2020-11-25 12:39 ` roger at nextmovesoftware dot com
@ 2021-01-04 16:48 ` vmakarov at gcc dot gnu.org
  2021-01-06 21:16 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vmakarov at gcc dot gnu.org @ 2021-01-04 16:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
Thank you for reporting it.

I've started work on the PR.  It seems a rare but dangerous bug and its fix
might affect many targets and will require a lot of testing but I try to fix
the PR on this week.

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

* [Bug rtl-optimization/97978] [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 since r11-5066-gbe39636d9f68c437
  2020-11-25  3:23 [Bug rtl-optimization/97978] New: [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2021-01-04 16:48 ` vmakarov at gcc dot gnu.org
@ 2021-01-06 21:16 ` cvs-commit at gcc dot gnu.org
  2021-01-07  8:44 ` asolokha at gmx dot com
  2021-01-12 11:48 ` asolokha at gmx dot com
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-06 21:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:15a47f437d2ba320aa9cb72986812f115498dbf9

commit r11-6509-g15a47f437d2ba320aa9cb72986812f115498dbf9
Author: Vladimir N. Makarov <vmakarov@redhat.com>
Date:   Wed Jan 6 14:48:53 2021 -0500

    [PR97978] LRA: Permit temporary allocation incorrectness after hard reg
split.

    LRA can crash when a hard register was split and the same hard register
    was assigned on the previous assignment sub-pass.  The following
    patch fixes this problem.

    gcc/ChangeLog:

            PR rtl-optimization/97978
            * lra-int.h (lra_hard_reg_split_p): New external.
            * lra.c (lra_hard_reg_split_p): New global.
            (lra): Set up lra_hard_reg_split_p after splitting a hard reg.
            * lra-assigns.c (lra_assign): Don't check allocation correctness
            after hard reg splitting.

    gcc/testsuite/ChangeLog:

            PR rtl-optimization/97978
            * gcc.target/i386/pr97978.c: New.

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

* [Bug rtl-optimization/97978] [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 since r11-5066-gbe39636d9f68c437
  2020-11-25  3:23 [Bug rtl-optimization/97978] New: [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2021-01-06 21:16 ` cvs-commit at gcc dot gnu.org
@ 2021-01-07  8:44 ` asolokha at gmx dot com
  2021-01-12 11:48 ` asolokha at gmx dot com
  5 siblings, 0 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2021-01-07  8:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Arseny Solokha <asolokha at gmx dot com> ---
Can this PR be closed now?

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

* [Bug rtl-optimization/97978] [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 since r11-5066-gbe39636d9f68c437
  2020-11-25  3:23 [Bug rtl-optimization/97978] New: [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2021-01-07  8:44 ` asolokha at gmx dot com
@ 2021-01-12 11:48 ` asolokha at gmx dot com
  5 siblings, 0 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2021-01-12 11:48 UTC (permalink / raw)
  To: gcc-bugs

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

Arseny Solokha <asolokha at gmx dot com> changed:

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

--- Comment #6 from Arseny Solokha <asolokha at gmx dot com> ---
Fixed.

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

end of thread, other threads:[~2021-01-12 11:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25  3:23 [Bug rtl-optimization/97978] New: [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 asolokha at gmx dot com
2020-11-25  8:14 ` [Bug rtl-optimization/97978] [11 Regression] ICE in lra_assign, at lra-assigns.c:1648 since r11-5066-gbe39636d9f68c437 marxin at gcc dot gnu.org
2020-11-25 12:39 ` roger at nextmovesoftware dot com
2021-01-04 16:48 ` vmakarov at gcc dot gnu.org
2021-01-06 21:16 ` cvs-commit at gcc dot gnu.org
2021-01-07  8:44 ` asolokha at gmx dot com
2021-01-12 11:48 ` asolokha at gmx dot com

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).