public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/116516] New: [lra] ICE in decompose_normal_address, at rtlanal.cc:6712
@ 2024-08-28 11:45 pheeck at gcc dot gnu.org
  2024-08-28 12:17 ` [Bug rtl-optimization/116516] [15 Regression] " hjl.tools at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: pheeck at gcc dot gnu.org @ 2024-08-28 11:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 116516
           Summary: [lra] ICE in decompose_normal_address, at
                    rtlanal.cc:6712
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pheeck at gcc dot gnu.org
                CC: vmakarov at redhat dot com
  Target Milestone: ---
              Host: x86_64-linux
            Target: x86_64-linux

Compiling the gcc testsuite file gcc.dg/analyzer/pr95152-4.c with anything
stronger than -O0 results in an ICE

during RTL pass: reload
/home/fkastl/gcc/src/gcc/testsuite/gcc.dg/analyzer/pr95152-4.c:13:1: internal
compiler error: in decompose_normal_address, at rtlanal.cc:6712
   13 | }
      | ^
0x33b9e0e internal_error(char const*, ...)
        /home/fkastl/gcc/src/gcc/diagnostic-global-context.cc:492
0x3397bf3 fancy_abort(char const*, int, char const*)
        /home/fkastl/gcc/src/gcc/diagnostic.cc:1658
0x1628109 decompose_normal_address
        /home/fkastl/gcc/src/gcc/rtlanal.cc:6712
0x16284a9 decompose_address(address_info*, rtx_def**, machine_mode, unsigned
char, rtx_code)
        /home/fkastl/gcc/src/gcc/rtlanal.cc:6805
0x16284dd decompose_lea_address(address_info*, rtx_def**)
        /home/fkastl/gcc/src/gcc/rtlanal.cc:6815
0x1425625 process_address_1
        /home/fkastl/gcc/src/gcc/lra-constraints.cc:3730
0x14261c8 process_address
        /home/fkastl/gcc/src/gcc/lra-constraints.cc:4017
0x142685d curr_insn_transform
        /home/fkastl/gcc/src/gcc/lra-constraints.cc:4229
0x142acfe lra_constraints(bool)
        /home/fkastl/gcc/src/gcc/lra-constraints.cc:5496
0x1413956 lra(_IO_FILE*, int)
        /home/fkastl/gcc/src/gcc/lra.cc:2445
0x13bc8c9 do_reload
        /home/fkastl/gcc/src/gcc/ira.cc:5976
0x13bcdc6 execute
        /home/fkastl/gcc/src/gcc/ira.cc:6164

Maybe this is the same issue as pr63987?

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

* [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712
  2024-08-28 11:45 [Bug rtl-optimization/116516] New: [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 pheeck at gcc dot gnu.org
@ 2024-08-28 12:17 ` hjl.tools at gmail dot com
  2024-08-28 12:24 ` [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 by r15-3213-g708ee71808ea61 hjl.tools at gmail dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2024-08-28 12:17 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[lra] ICE in                |[15 Regression] [lra] ICE
                   |decompose_normal_address,   |in
                   |at rtlanal.cc:6712          |decompose_normal_address,
                   |                            |at rtlanal.cc:6712
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-08-28
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
It works with GCC 15 on 20240826.

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

* [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 by r15-3213-g708ee71808ea61
  2024-08-28 11:45 [Bug rtl-optimization/116516] New: [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 pheeck at gcc dot gnu.org
  2024-08-28 12:17 ` [Bug rtl-optimization/116516] [15 Regression] " hjl.tools at gmail dot com
@ 2024-08-28 12:24 ` hjl.tools at gmail dot com
  2024-08-28 12:37 ` rsandifo at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: hjl.tools at gmail dot com @ 2024-08-28 12:24 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[15 Regression] [lra] ICE   |[15 Regression] [lra] ICE
                   |in                          |in
                   |decompose_normal_address,   |decompose_normal_address,
                   |at rtlanal.cc:6712          |at rtlanal.cc:6712 by
                   |                            |r15-3213-g708ee71808ea61
                 CC|                            |rsandifo at gcc dot gnu.org

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
This is introduced by r15-3213-g708ee71808ea61.

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

* [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 by r15-3213-g708ee71808ea61
  2024-08-28 11:45 [Bug rtl-optimization/116516] New: [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 pheeck at gcc dot gnu.org
  2024-08-28 12:17 ` [Bug rtl-optimization/116516] [15 Regression] " hjl.tools at gmail dot com
  2024-08-28 12:24 ` [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 by r15-3213-g708ee71808ea61 hjl.tools at gmail dot com
@ 2024-08-28 12:37 ` rsandifo at gcc dot gnu.org
  2024-08-28 12:56 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2024-08-28 12:37 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Sandiford <rsandifo at gcc dot gnu.org> changed:

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

--- Comment #3 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
Gah, mine then.

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

* [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 by r15-3213-g708ee71808ea61
  2024-08-28 11:45 [Bug rtl-optimization/116516] New: [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 pheeck at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-08-28 12:37 ` rsandifo at gcc dot gnu.org
@ 2024-08-28 12:56 ` rguenth at gcc dot gnu.org
  2024-08-28 15:53 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-08-28 12:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |15.0

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

* [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 by r15-3213-g708ee71808ea61
  2024-08-28 11:45 [Bug rtl-optimization/116516] New: [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 pheeck at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-08-28 12:56 ` rguenth at gcc dot gnu.org
@ 2024-08-28 15:53 ` pinskia at gcc dot gnu.org
  2024-08-28 21:34 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-08-28 15:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Just for reference here is the code:
```
extern void my_func (int);
typedef struct {
  int var;
} info_t;
extern void *_data_offs;
void test()
{
  info_t *info = (info_t *) ((void *)((void *)1) + ((unsigned
int)&_data_offs));
  my_func(info->var == 0);
}

```

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

* [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 by r15-3213-g708ee71808ea61
  2024-08-28 11:45 [Bug rtl-optimization/116516] New: [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 pheeck at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-08-28 15:53 ` pinskia at gcc dot gnu.org
@ 2024-08-28 21:34 ` pinskia at gcc dot gnu.org
  2024-08-29 13:01 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-08-28 21:34 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 116523 has been marked as a duplicate of this bug. ***

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

* [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 by r15-3213-g708ee71808ea61
  2024-08-28 11:45 [Bug rtl-optimization/116516] New: [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 pheeck at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-08-28 21:34 ` pinskia at gcc dot gnu.org
@ 2024-08-29 13:01 ` cvs-commit at gcc dot gnu.org
  2024-08-29 13:03 ` rsandifo at gcc dot gnu.org
  2024-08-29 19:28 ` slyfox at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-08-29 13:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Richard Sandiford <rsandifo@gcc.gnu.org>:

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

commit r15-3288-gac6d433b02ce26a646b2a7254b1d87fcc06b0beb
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Thu Aug 29 14:00:23 2024 +0100

    Allow subregs around constant displacements [PR116516]

    This patch fixes a regression introduced by g:708ee71808ea61758e73.
    x86_64 allows addresses of the form:

      (zero_extend:DI (subreg:SI (symbol_ref:DI "foo") 0))

    Before the previous patch, a lax SUBREG check meant that we would
    treat the subreg as a base and reload it into a base register.
    But that wasn't what the target was expecting.  Instead we should
    treat "foo" as a constant displacement, to match:

            leal foo, <dest>

    After the patch, we recognised that "foo" isn't a base register,
    but ICEd on it rather than handling it as a displacement.

    With or without the recent patches, if the address had instead been:

      (zero_extend:DI
        (subreg:SI (plus:DI (reg:DI R) (symbol_ref:DI "foo") 0)))

    then we would have treated "foo" as the displacement and R as the base
    or index, as expected.  The problem was that the code that does this was
    rejecting all subregs of objects, rather than just subregs of variable
    objects.

    gcc/
            PR middle-end/116516
            * rtlanal.cc (strip_address_mutations): Allow subregs around
            constant displacements.

    gcc/testsuite/
            PR middle-end/116516
            * gcc.c-torture/compile/pr116516.c: New test.

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

* [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 by r15-3213-g708ee71808ea61
  2024-08-28 11:45 [Bug rtl-optimization/116516] New: [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 pheeck at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2024-08-29 13:01 ` cvs-commit at gcc dot gnu.org
@ 2024-08-29 13:03 ` rsandifo at gcc dot gnu.org
  2024-08-29 19:28 ` slyfox at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2024-08-29 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Sandiford <rsandifo at gcc dot gnu.org> changed:

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

--- Comment #7 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
Hopefully fixed.  Thanks for the report.

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

* [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 by r15-3213-g708ee71808ea61
  2024-08-28 11:45 [Bug rtl-optimization/116516] New: [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 pheeck at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2024-08-29 13:03 ` rsandifo at gcc dot gnu.org
@ 2024-08-29 19:28 ` slyfox at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: slyfox at gcc dot gnu.org @ 2024-08-29 19:28 UTC (permalink / raw)
  To: gcc-bugs

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

Sergei Trofimovich <slyfox at gcc dot gnu.org> changed:

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

--- Comment #8 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
The change fixed ICE on linux-6.10.6 for me.

Thank you!

In case it's useful `cvise` reduced kernel's arch/x86/kernel/cpu/common.c into
the following:

// $ cat common.c.c
void entry_SYSENTER_compat(void)
{
    unsigned low = (long)entry_SYSENTER_compat;
    asm (""::"S"((long)low));
}

Before the fix gcc crashed as:

$ gcc   -O2  -c common.c.c -o bug.o
during RTL pass: reload
common.c.c: In function 'entry_SYSENTER_compat':
common.c.c:5:1: internal compiler error: in decompose_normal_address, at
rtlanal.cc:6712

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

end of thread, other threads:[~2024-08-29 19:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-28 11:45 [Bug rtl-optimization/116516] New: [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 pheeck at gcc dot gnu.org
2024-08-28 12:17 ` [Bug rtl-optimization/116516] [15 Regression] " hjl.tools at gmail dot com
2024-08-28 12:24 ` [Bug rtl-optimization/116516] [15 Regression] [lra] ICE in decompose_normal_address, at rtlanal.cc:6712 by r15-3213-g708ee71808ea61 hjl.tools at gmail dot com
2024-08-28 12:37 ` rsandifo at gcc dot gnu.org
2024-08-28 12:56 ` rguenth at gcc dot gnu.org
2024-08-28 15:53 ` pinskia at gcc dot gnu.org
2024-08-28 21:34 ` pinskia at gcc dot gnu.org
2024-08-29 13:01 ` cvs-commit at gcc dot gnu.org
2024-08-29 13:03 ` rsandifo at gcc dot gnu.org
2024-08-29 19:28 ` slyfox 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).