public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion
@ 2021-09-24 19:25 zsojka at seznam dot cz
  2021-09-24 19:29 ` [Bug rtl-optimization/102478] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: zsojka at seznam dot cz @ 2021-09-24 19:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102478
           Summary: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in
                    gen_reg_rtx, at emit-rtl.c:1167 with -O2
                    -fno-if-conversion
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: powerpc64le-unknown-linux-gnu

Created attachment 51508
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51508&action=edit
reduced testcase

Compiler output:
$ powerpc64le-unknown-linux-gnu-gcc -O2 -fno-if-conversion testcase.c 
testcase.c: In function 'foo':
testcase.c:6:45: warning: division by zero [-Wdiv-by-zero]
    6 |   c |= __builtin_expect (65535 / a, 0) && 0 / 0;
      |                                             ^
during RTL pass: ce3
testcase.c:8:1: internal compiler error: in gen_reg_rtx, at emit-rtl.c:1167
    8 | }
      | ^
0x63b466 gen_reg_rtx(machine_mode)
        /repo/gcc-trunk/gcc/emit-rtl.c:1167
0xba8069 force_reg(machine_mode, rtx_def*)
        /repo/gcc-trunk/gcc/explow.c:676
0xe48e63 prepare_cmp_insn
        /repo/gcc-trunk/gcc/optabs.c:4396
0xe4a09f gen_cond_trap(rtx_code, rtx_def*, rtx_def*, rtx_def*)
        /repo/gcc-trunk/gcc/optabs.c:5851
0x19548e7 find_cond_trap
        /repo/gcc-trunk/gcc/ifcvt.c:4721
0x19548e7 find_if_header
        /repo/gcc-trunk/gcc/ifcvt.c:4346
0x19548e7 if_convert
        /repo/gcc-trunk/gcc/ifcvt.c:5475
0x195565d execute
        /repo/gcc-trunk/gcc/ifcvt.c:5628
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.

$ powerpc64le-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-powerpc64le/bin/powerpc64le-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-3885-20210924181655-g71f96511084-checking-yes-rtl-df-extra-powerpc64le/bin/../libexec/gcc/powerpc64le-unknown-linux-gnu/12.0.0/lto-wrapper
Target: powerpc64le-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl
--with-sysroot=/usr/powerpc64le-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=powerpc64le-unknown-linux-gnu
--with-ld=/usr/bin/powerpc64le-unknown-linux-gnu-ld
--with-as=/usr/bin/powerpc64le-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-3885-20210924181655-g71f96511084-checking-yes-rtl-df-extra-powerpc64le
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210924 (experimental) (GCC)

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

* [Bug rtl-optimization/102478] [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion
  2021-09-24 19:25 [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion zsojka at seznam dot cz
@ 2021-09-24 19:29 ` pinskia at gcc dot gnu.org
  2022-01-17 13:23 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-24 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|target                      |rtl-optimization
                 CC|                            |pinskia at gcc dot gnu.org
   Target Milestone|---                         |9.5

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

* [Bug rtl-optimization/102478] [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion
  2021-09-24 19:25 [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion zsojka at seznam dot cz
  2021-09-24 19:29 ` [Bug rtl-optimization/102478] " pinskia at gcc dot gnu.org
@ 2022-01-17 13:23 ` rguenth at gcc dot gnu.org
  2022-01-20 15:49 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-17 13:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-01-17
             Status|UNCONFIRMED                 |NEW
           Priority|P3                          |P2

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed on trunk.

#1  0x0000000000db64a9 in gen_reg_rtx (mode=E_SImode)
    at ../../src/trunk/gcc/emit-rtl.c:1167
1167      gcc_assert (can_create_pseudo_p ());

I suppose the whole find_cond_trap case should be disabled post reload.

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

* [Bug rtl-optimization/102478] [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion
  2021-09-24 19:25 [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion zsojka at seznam dot cz
  2021-09-24 19:29 ` [Bug rtl-optimization/102478] " pinskia at gcc dot gnu.org
  2022-01-17 13:23 ` rguenth at gcc dot gnu.org
@ 2022-01-20 15:49 ` jakub at gcc dot gnu.org
  2022-01-20 16:06 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-20 15:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r9-2592-g62852194225ed2df31ff6a600659e5cefbb1e8c0 on this
testcase.
But changing the testcase to:
unsigned a, b, c;

void
foo (void)
{
  if (a <= 65535)
    __builtin_trap ();
  b = 0;
}
again with -O2 -fno-if-conversion it ICEs even earlier, with my
r7-6861-gada61c3d4774b98d42b53e99836abd695969fbc6 change.
And with
unsigned a, b;

void
foo (void)
{
  if (a > 65535)
    b = 0;
  else
    __builtin_trap ();
}
it started even much earlier than that (before svn r200000).

Seems to be similar to PR103028 where Andreas was already suggesting what you
suggest here.
Changing those prepare_cmp_insn:
  /* If we are optimizing, force expensive constants into a register.  */
  if (CONSTANT_P (x) && optimize
      && (rtx_cost (x, mode, COMPARE, 0, optimize_insn_for_speed_p ())
          > COSTS_N_INSNS (1)))
    x = force_reg (mode, x);

  if (CONSTANT_P (y) && optimize
      && (rtx_cost (y, mode, COMPARE, 1, optimize_insn_for_speed_p ())
          > COSTS_N_INSNS (1)))
    y = force_reg (mode, y);
which are purely an optimization to add && !reload_completed
after && optimize would work too, the question is what other
force_reg/copy_to_reg calls in prepare_cmp_insn could be a problem.
The BLKmode case certainly, the VOIDmode case as well (but both of those
shouldn't trigger for the cond_trap cases, then there is
  if (cfun->can_throw_non_call_exceptions)
    {
      if (may_trap_p (x))
        x = copy_to_reg (x);
      if (may_trap_p (y))
        y = copy_to_reg (y);
    }
not really sure about that one.

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

* [Bug rtl-optimization/102478] [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion
  2021-09-24 19:25 [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2022-01-20 15:49 ` jakub at gcc dot gnu.org
@ 2022-01-20 16:06 ` jakub at gcc dot gnu.org
  2022-01-21 10:18 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-20 16:06 UTC (permalink / raw)
  To: gcc-bugs

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

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 52243
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52243&action=edit
gcc12-pr102478.patch

Untested fix.

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

* [Bug rtl-optimization/102478] [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion
  2021-09-24 19:25 [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2022-01-20 16:06 ` jakub at gcc dot gnu.org
@ 2022-01-21 10:18 ` cvs-commit at gcc dot gnu.org
  2022-01-24  9:21 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-21 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:c2d9159717b474f9c06dde4d32b48b87164deb50

commit r12-6786-gc2d9159717b474f9c06dde4d32b48b87164deb50
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jan 21 11:16:50 2022 +0100

    optabs: Don't create pseudos in prepare_cmp_insn when not allowed
[PR102478]

    cond traps can be created during ce3 after reload (and e.g. PR103028
    recently fixed some ce3 cond trap related bug, so I think often that
    works fine and we shouldn't disable cond traps after RA altogether),
    but it calls prepare_cmp_insn.  This function can fail, so I don't
    see why we couldn't make it work after RA (in most cases it already
    just works).  The first hunk is just an optimization which doesn't
    make sense after RA, so I've guarded it with can_create_pseudo_p.
    The second hunk is just a theoretical case, I don't have a testcase for it.
    prepare_cmp_insn has some other spots that can create pseudos, like when
    both operands have VOIDmode, or when it is BLKmode comparison, or
    not OPTAB_DIRECT, but I think none of that applies to ce3, we punt on
    BLKmode earlier, use OPTAB_DIRECT and shouldn't be comparing two
    VOIDmode CONST_INTs.

    2022-01-21  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/102478
            * optabs.cc (prepare_cmp_insn): If !can_create_pseudo_p (), don't
            force_reg constants and for -fnon-call-exceptions fail if
copy_to_reg
            would be needed.

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

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

* [Bug rtl-optimization/102478] [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion
  2021-09-24 19:25 [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2022-01-21 10:18 ` cvs-commit at gcc dot gnu.org
@ 2022-01-24  9:21 ` cvs-commit at gcc dot gnu.org
  2022-01-25 13:52 ` [Bug rtl-optimization/102478] [9/10 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-24  9:21 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:505b418a40a339cca86e977158fe38e4d5df7aa9

commit r11-9506-g505b418a40a339cca86e977158fe38e4d5df7aa9
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jan 21 11:16:50 2022 +0100

    optabs: Don't create pseudos in prepare_cmp_insn when not allowed
[PR102478]

    cond traps can be created during ce3 after reload (and e.g. PR103028
    recently fixed some ce3 cond trap related bug, so I think often that
    works fine and we shouldn't disable cond traps after RA altogether),
    but it calls prepare_cmp_insn.  This function can fail, so I don't
    see why we couldn't make it work after RA (in most cases it already
    just works).  The first hunk is just an optimization which doesn't
    make sense after RA, so I've guarded it with can_create_pseudo_p.
    The second hunk is just a theoretical case, I don't have a testcase for it.
    prepare_cmp_insn has some other spots that can create pseudos, like when
    both operands have VOIDmode, or when it is BLKmode comparison, or
    not OPTAB_DIRECT, but I think none of that applies to ce3, we punt on
    BLKmode earlier, use OPTAB_DIRECT and shouldn't be comparing two
    VOIDmode CONST_INTs.

    2022-01-21  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/102478
            * optabs.c (prepare_cmp_insn): If !can_create_pseudo_p (), don't
            force_reg constants and for -fnon-call-exceptions fail if
copy_to_reg
            would be needed.

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

    (cherry picked from commit c2d9159717b474f9c06dde4d32b48b87164deb50)

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

* [Bug rtl-optimization/102478] [9/10 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion
  2021-09-24 19:25 [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2022-01-24  9:21 ` cvs-commit at gcc dot gnu.org
@ 2022-01-25 13:52 ` jakub at gcc dot gnu.org
  2022-05-10  8:23 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-25 13:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10/11/12 Regression]     |[9/10 Regression] during
                   |during RTL pass: ce3: ICE:  |RTL pass: ce3: ICE: in
                   |in gen_reg_rtx, at          |gen_reg_rtx, at
                   |emit-rtl.c:1167 with -O2    |emit-rtl.c:1167 with -O2
                   |-fno-if-conversion          |-fno-if-conversion

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk and for 11.3+ so far.

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

* [Bug rtl-optimization/102478] [9/10 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion
  2021-09-24 19:25 [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2022-01-25 13:52 ` [Bug rtl-optimization/102478] [9/10 " jakub at gcc dot gnu.org
@ 2022-05-10  8:23 ` cvs-commit at gcc dot gnu.org
  2022-05-11  6:24 ` cvs-commit at gcc dot gnu.org
  2022-05-11  6:36 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10  8:23 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:42d66df40b5a12e1b7e77f0901ee8a6710cabd5f

commit r10-10670-g42d66df40b5a12e1b7e77f0901ee8a6710cabd5f
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jan 21 11:16:50 2022 +0100

    optabs: Don't create pseudos in prepare_cmp_insn when not allowed
[PR102478]

    cond traps can be created during ce3 after reload (and e.g. PR103028
    recently fixed some ce3 cond trap related bug, so I think often that
    works fine and we shouldn't disable cond traps after RA altogether),
    but it calls prepare_cmp_insn.  This function can fail, so I don't
    see why we couldn't make it work after RA (in most cases it already
    just works).  The first hunk is just an optimization which doesn't
    make sense after RA, so I've guarded it with can_create_pseudo_p.
    The second hunk is just a theoretical case, I don't have a testcase for it.
    prepare_cmp_insn has some other spots that can create pseudos, like when
    both operands have VOIDmode, or when it is BLKmode comparison, or
    not OPTAB_DIRECT, but I think none of that applies to ce3, we punt on
    BLKmode earlier, use OPTAB_DIRECT and shouldn't be comparing two
    VOIDmode CONST_INTs.

    2022-01-21  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/102478
            * optabs.c (prepare_cmp_insn): If !can_create_pseudo_p (), don't
            force_reg constants and for -fnon-call-exceptions fail if
copy_to_reg
            would be needed.

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

    (cherry picked from commit c2d9159717b474f9c06dde4d32b48b87164deb50)

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

* [Bug rtl-optimization/102478] [9/10 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion
  2021-09-24 19:25 [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2022-05-10  8:23 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11  6:24 ` cvs-commit at gcc dot gnu.org
  2022-05-11  6:36 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-11  6:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:02da8ea28601e2d85447550cad3429f8127f646b

commit r9-10119-g02da8ea28601e2d85447550cad3429f8127f646b
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jan 21 11:16:50 2022 +0100

    optabs: Don't create pseudos in prepare_cmp_insn when not allowed
[PR102478]

    cond traps can be created during ce3 after reload (and e.g. PR103028
    recently fixed some ce3 cond trap related bug, so I think often that
    works fine and we shouldn't disable cond traps after RA altogether),
    but it calls prepare_cmp_insn.  This function can fail, so I don't
    see why we couldn't make it work after RA (in most cases it already
    just works).  The first hunk is just an optimization which doesn't
    make sense after RA, so I've guarded it with can_create_pseudo_p.
    The second hunk is just a theoretical case, I don't have a testcase for it.
    prepare_cmp_insn has some other spots that can create pseudos, like when
    both operands have VOIDmode, or when it is BLKmode comparison, or
    not OPTAB_DIRECT, but I think none of that applies to ce3, we punt on
    BLKmode earlier, use OPTAB_DIRECT and shouldn't be comparing two
    VOIDmode CONST_INTs.

    2022-01-21  Jakub Jelinek  <jakub@redhat.com>

            PR rtl-optimization/102478
            * optabs.c (prepare_cmp_insn): If !can_create_pseudo_p (), don't
            force_reg constants and for -fnon-call-exceptions fail if
copy_to_reg
            would be needed.

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

    (cherry picked from commit c2d9159717b474f9c06dde4d32b48b87164deb50)

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

* [Bug rtl-optimization/102478] [9/10 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion
  2021-09-24 19:25 [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion zsojka at seznam dot cz
                   ` (8 preceding siblings ...)
  2022-05-11  6:24 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11  6:36 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-11  6:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2022-05-11  6:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24 19:25 [Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion zsojka at seznam dot cz
2021-09-24 19:29 ` [Bug rtl-optimization/102478] " pinskia at gcc dot gnu.org
2022-01-17 13:23 ` rguenth at gcc dot gnu.org
2022-01-20 15:49 ` jakub at gcc dot gnu.org
2022-01-20 16:06 ` jakub at gcc dot gnu.org
2022-01-21 10:18 ` cvs-commit at gcc dot gnu.org
2022-01-24  9:21 ` cvs-commit at gcc dot gnu.org
2022-01-25 13:52 ` [Bug rtl-optimization/102478] [9/10 " jakub at gcc dot gnu.org
2022-05-10  8:23 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:24 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:36 ` 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).