public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297
@ 2023-08-01 16:26 ro at gcc dot gnu.org
  2023-08-01 16:27 ` [Bug middle-end/110869] " ro at gcc dot gnu.org
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: ro at gcc dot gnu.org @ 2023-08-01 16:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110869
           Summary: [14 regression] ICE in decompose, at rtl.h:2297
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: stefansf at linux dot ibm.com
  Target Milestone: ---
              Host: sparc-sun-solaris2.11
            Target: sparc-sun-solaris2.11
             Build: sparc-sun-solaris2.11

Between 20230731 (bf67bf4880ce5be0b6e48c7c35828528b7be12ed) and 20230801
(a5451b8b9f3a6ab0cb1a60bc8b0b76cca46b080f), Solaris/SPARC bootstrap broke e.g.
compiling cp/lex.cc in stage 2:

during RTL pass: combine
/vol/gcc/src/hg/master/local/gcc/cp/lex.cc: In function ‘void
cxx_dup_lang_specific_decl(tree)’:
/vol/gcc/src/hg/master/local/gcc/cp/lex.cc:1026:1: internal compiler error: in
decompose, at rtl.h:2297
 1026 | }
      | ^
0x197362f wi::int_traits<std::pair<rtx_def*, machine_mode> >::decompose(long
long*, unsigned int, std::pair<rtx_def*, machine_mode> const&)
        /vol/gcc/src/hg/master/local/gcc/rtl.h:2297
0x1a034ef wide_int_ref_storage<false,
true>::wide_int_ref_storage<std::pair<rtx_def*, machine_mode>
>(std::pair<rtx_def*, machine_mode> const&)
        /vol/gcc/src/hg/master/local/gcc/wide-int.h:1030
0x1a02513 generic_wide_int<wide_int_ref_storage<false, true>
>::generic_wide_int<std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*,
machine_mode> const&)
        /vol/gcc/src/hg/master/local/gcc/wide-int.h:788
0x2151017 simplify_const_unary_operation(rtx_code, machine_mode, rtx_def*,
machine_mode)
        /vol/gcc/src/hg/master/local/gcc/simplify-rtx.cc:2131
0x214a35f simplify_context::simplify_unary_operation(rtx_code, machine_mode,
rtx_def*, machine_mode)
        /vol/gcc/src/hg/master/local/gcc/simplify-rtx.cc:889
0x2147e0f simplify_context::simplify_gen_unary(rtx_code, machine_mode,
rtx_def*, machine_mode)
        /vol/gcc/src/hg/master/local/gcc/simplify-rtx.cc:360
0x17e5317 simplify_gen_unary(rtx_code, machine_mode, rtx_def*, machine_mode)
        /vol/gcc/src/hg/master/local/gcc/rtl.h:3520
0x300c3f3 simplify_comparison
        /vol/gcc/src/hg/master/local/gcc/combine.cc:13125
0x2ff04cf simplify_set
        /vol/gcc/src/hg/master/local/gcc/combine.cc:6848
0x2fed9b3 combine_simplify_rtx
        /vol/gcc/src/hg/master/local/gcc/combine.cc:6353
0x2fea537 subst
        /vol/gcc/src/hg/master/local/gcc/combine.cc:5609
0x2fe0b3b try_combine
        /vol/gcc/src/hg/master/local/gcc/combine.cc:3339
0x2fd8a57 combine_instructions
        /vol/gcc/src/hg/master/local/gcc/combine.cc:1285
0x30130a3 rest_of_handle_combine
        /vol/gcc/src/hg/master/local/gcc/combine.cc:15059
0x30131c7 execute
        /vol/gcc/src/hg/master/local/gcc/combine.cc:15103

I've not yet identified the culprit patch, but this one seems plausible:

commit 7cdd0860949c6c3232e6cff1d7ca37bb5234074c
Author: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Date:   Mon Jul 31 16:35:33 2023 +0200

    combine: Narrow comparison of memory and constant

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
@ 2023-08-01 16:27 ` ro at gcc dot gnu.org
  2023-08-01 18:20 ` pinskia at gcc dot gnu.org
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: ro at gcc dot gnu.org @ 2023-08-01 16:27 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
  2023-08-01 16:27 ` [Bug middle-end/110869] " ro at gcc dot gnu.org
@ 2023-08-01 18:20 ` pinskia at gcc dot gnu.org
  2023-08-01 19:58 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-01 18:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Can you test the patch in bug 110867 comment #1 to see if fixes the issue here
too?

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
  2023-08-01 16:27 ` [Bug middle-end/110869] " ro at gcc dot gnu.org
  2023-08-01 18:20 ` pinskia at gcc dot gnu.org
@ 2023-08-01 19:58 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2023-08-02  7:40 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2023-08-01 19:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> Can you test the patch in bug 110867 comment #1 to see if fixes the issue here
> too?

Sure: sparc-sun-solaris2.11 bootstrap in progress...

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-08-01 19:58 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2023-08-02  7:40 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2023-08-02  9:05 ` stefansf at linux dot ibm.com
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2023-08-02  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #2 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot
> Uni-Bielefeld.DE> ---
>> --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>> Can you test the patch in bug 110867 comment #1 to see if fixes the issue here
>> too?
>
> Sure: sparc-sun-solaris2.11 bootstrap in progress...

Bootstrap is restored with this patch, however all the new tests FAIL:

FAIL: gcc.dg/cmp-mem-const-1.c scan-rtl-dump combine "narrow comparison from
mode DI to QI"
FAIL: gcc.dg/cmp-mem-const-2.c scan-rtl-dump combine "narrow comparison from
mode DI to QI"
FAIL: gcc.dg/cmp-mem-const-3.c scan-rtl-dump combine "narrow comparison from
mode DI to HI"
FAIL: gcc.dg/cmp-mem-const-4.c scan-rtl-dump combine "narrow comparison from
mode DI to HI"
FAIL: gcc.dg/cmp-mem-const-5.c scan-rtl-dump combine "narrow comparison from
mode DI to SI"
FAIL: gcc.dg/cmp-mem-const-6.c scan-rtl-dump combine "narrow comparison from
mode DI to SI"

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-08-02  7:40 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2023-08-02  9:05 ` stefansf at linux dot ibm.com
  2023-08-02  9:17 ` ro at gcc dot gnu.org
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: stefansf at linux dot ibm.com @ 2023-08-02  9:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> ---
For sparc we already see some sort of pre-optimization which "breaks" the new
test cases.  For example, for test cmp-mem-const-1.c we have prior combine:

(insn 14 13 41 2 (set (reg:SI 117)
        (ior:SI (reg:SI 118)
            (const_int 1023 [0x3ff]))) "cmp-mem-const-1.c":10:13 307 {iorsi3}
     (expr_list:REG_DEAD (reg:SI 118)
        (expr_list:REG_EQUAL (const_int 1073741823 [0x3fffffff])
            (nil))))

(insn 41 14 42 2 (set (reg:CC 100 %icc)
        (compare:CC (reg:SI 117)
            (reg:SI 116 [ *x_2(D) ]))) "cmp-mem-const-1.c":10:13 1
{*cmpsi_insn}
     (expr_list:REG_DEAD (reg:SI 117)
        (expr_list:REG_DEAD (reg:SI 116 [ *x_2(D) ])
            (nil))))

where the 64-bit constant 0x3fffffffffffffff already got chopped into a 32-bit
constant 0x3fffffff.  Thus in combine we only see

narrow comparison from mode SI to QI: (MEM leu 0x3fffffff) to (MEM leu 0x3f)

whereas I have been pretty strict in the new tests and demanded to see a 64-bit
constant:

scan-rtl-dump "narrow comparison from mode DI to QI" "combine"

Thus one solution would be to not consider the source mode by using

scan-rtl-dump "narrow comparison from mode .I to QI" "combine"

This would solve test cases cmp-mem-const-{1,2,3,4}.c.  For cmp-mem-const-{5,6}
we have that the pre-optimization already chopped the 64-bit constant into a
32-bit constant and thus leaves us with nothing to do here.  I'm not entirely
sure how we handled such cases in the past.  Though, one solution would be to
simply exclude sparc from this test:

/* { dg-do compile { target { lp64 } && ! target { sparc*-*-* } } } */

Would that be ok?

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-08-02  9:05 ` stefansf at linux dot ibm.com
@ 2023-08-02  9:17 ` ro at gcc dot gnu.org
  2023-08-02  9:50 ` ebotcazou at gcc dot gnu.org
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: ro at gcc dot gnu.org @ 2023-08-02  9:17 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

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

--- Comment #5 from Rainer Orth <ro at gcc dot gnu.org> ---
(In reply to Stefan Schulze Frielinghaus from comment #4)

> This would solve test cases cmp-mem-const-{1,2,3,4}.c.  For
> cmp-mem-const-{5,6} we have that the pre-optimization already chopped the
> 64-bit constant into a 32-bit constant and thus leaves us with nothing to do
> here.  I'm not entirely sure how we handled such cases in the past.  Though,
> one solution would be to simply exclude sparc from this test:
> 
> /* { dg-do compile { target { lp64 } && ! target { sparc*-*-* } } } */
> 
> Would that be ok?

I guess that's best for Eric (Cc'ed) to say.

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-08-02  9:17 ` ro at gcc dot gnu.org
@ 2023-08-02  9:50 ` ebotcazou at gcc dot gnu.org
  2023-08-02 14:05 ` stefansf at linux dot ibm.com
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-08-02  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-08-02

--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> I guess that's best for Eric (Cc'ed) to say.

No objections by me.

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-08-02  9:50 ` ebotcazou at gcc dot gnu.org
@ 2023-08-02 14:05 ` stefansf at linux dot ibm.com
  2023-08-02 19:44 ` cvs-commit at gcc dot gnu.org
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: stefansf at linux dot ibm.com @ 2023-08-02 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> ---
I've send a patch for review:

https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626075.html

and thanks for testing :)

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-08-02 14:05 ` stefansf at linux dot ibm.com
@ 2023-08-02 19:44 ` cvs-commit at gcc dot gnu.org
  2023-08-04  7:53 ` ro at gcc dot gnu.org
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-02 19:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Stefan Schulze Frielinghaus
<stefansf@gcc.gnu.org>:

https://gcc.gnu.org/g:41ef5a34161356817807be3a2e51fbdbe575ae85

commit r14-2932-g41ef5a34161356817807be3a2e51fbdbe575ae85
Author: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Date:   Wed Aug 2 21:43:22 2023 +0200

    rtl-optimization/110867 Fix narrow comparison of memory and constant

    In certain cases a constant may not fit into the mode used to perform a
    comparison.  This may be the case for sign-extended constants which are
    used during an unsigned comparison as e.g. in

    (set (reg:CC 100 cc)
        (compare:CC (mem:SI (reg/v/f:SI 115 [ a ]) [1 *a_4(D)+0 S4 A64])
            (const_int -2147483648 [0xffffffff80000000])))

    Fixed by ensuring that the constant fits into comparison mode.

    Furthermore, on some targets as e.g. sparc the constant used in a
    comparison is chopped off before combine which leads to failing test
    cases (see PR 110869).  Fixed by not requiring that the source mode has
    to be DImode, and excluding sparc from the last two test cases entirely
    since there the constant cannot be further reduced.

    gcc/ChangeLog:

            PR rtl-optimization/110867
            * combine.cc (simplify_compare_const): Try the optimization only
            in case the constant fits into the comparison mode.

    gcc/testsuite/ChangeLog:

            PR rtl-optimization/110869
            * gcc.dg/cmp-mem-const-1.c: Relax mode for constant.
            * gcc.dg/cmp-mem-const-2.c: Relax mode for constant.
            * gcc.dg/cmp-mem-const-3.c: Relax mode for constant.
            * gcc.dg/cmp-mem-const-4.c: Relax mode for constant.
            * gcc.dg/cmp-mem-const-5.c: Exclude sparc since here the
            constant is already reduced.
            * gcc.dg/cmp-mem-const-6.c: Exclude sparc since here the
            constant is already reduced.

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-08-02 19:44 ` cvs-commit at gcc dot gnu.org
@ 2023-08-04  7:53 ` ro at gcc dot gnu.org
  2023-08-04  7:53 ` ro at gcc dot gnu.org
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: ro at gcc dot gnu.org @ 2023-08-04  7:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Rainer Orth <ro at gcc dot gnu.org> ---
Created attachment 55684
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55684&action=edit
64-bit sparc-sun-solaris2.11 cmp-mem-const-1.c.289r.combine

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-08-04  7:53 ` ro at gcc dot gnu.org
@ 2023-08-04  7:53 ` ro at gcc dot gnu.org
  2023-08-04  8:38 ` stefansf at linux dot ibm.com
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: ro at gcc dot gnu.org @ 2023-08-04  7:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Rainer Orth <ro at gcc dot gnu.org> ---
The tests still FAIL on Solaris/SPARC:

FAIL: gcc.dg/cmp-mem-const-1.c scan-rtl-dump combine "narrow comparison from
mode .I to QI"
FAIL: gcc.dg/cmp-mem-const-2.c scan-rtl-dump combine "narrow comparison from
mode .I to QI"
FAIL: gcc.dg/cmp-mem-const-3.c scan-rtl-dump combine "narrow comparison from
mode .I to HI"
FAIL: gcc.dg/cmp-mem-const-4.c scan-rtl-dump combine "narrow comparison from
mode .I to HI"
FAIL: gcc.dg/cmp-mem-const-5.c scan-rtl-dump combine "narrow comparison from
mode .I to SI"
FAIL: gcc.dg/cmp-mem-const-6.c scan-rtl-dump combine "narrow comparison from
mode .I to SI"

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2023-08-04  7:53 ` ro at gcc dot gnu.org
@ 2023-08-04  8:38 ` stefansf at linux dot ibm.com
  2023-08-04  8:40 ` stefansf at linux dot ibm.com
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: stefansf at linux dot ibm.com @ 2023-08-04  8:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> ---
Created attachment 55686
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55686&action=edit
Increase optimization

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2023-08-04  8:38 ` stefansf at linux dot ibm.com
@ 2023-08-04  8:40 ` stefansf at linux dot ibm.com
  2023-08-04  8:51 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: stefansf at linux dot ibm.com @ 2023-08-04  8:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> ---
I have done a test with a cross-compiler and it looks to me as if we need -O2
instead of -O1 on Sparc in order to trigger the optimization.  Can you give the
attached patch a try?  Sorry for all the hassle.

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2023-08-04  8:40 ` stefansf at linux dot ibm.com
@ 2023-08-04  8:51 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2023-08-04  9:42 ` stefansf at linux dot ibm.com
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2023-08-04  8:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #12 from Stefan Schulze Frielinghaus <stefansf at linux dot
> ibm.com> ---
> I have done a test with a cross-compiler and it looks to me as if we need -O2
> instead of -O1 on Sparc in order to trigger the optimization.  Can you give the
> attached patch a try?  Sorry for all the hassle.

We're getting there.  The -1.c and -2.c tests PASS now, however the rest
still FAILs: they lack "narrow comparison"... completely.

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2023-08-04  8:51 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2023-08-04  9:42 ` stefansf at linux dot ibm.com
  2023-08-04 14:16 ` stefansf at linux dot ibm.com
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: stefansf at linux dot ibm.com @ 2023-08-04  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> ---
For -3 and -4 I can confirm that we do not end up with a proper comparison
during combine which means we should just ignore these on Sparc.

I'm currently puzzled that -5 and -6 are actually processed on Sparc (32 or 64
bit) at all.  Shouldn't this:

/* { dg-do compile { target { lp64 } && ! target { sparc*-*-* } } } */

prevent this?

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2023-08-04  9:42 ` stefansf at linux dot ibm.com
@ 2023-08-04 14:16 ` stefansf at linux dot ibm.com
  2023-08-04 14:18 ` stefansf at linux dot ibm.com
                   ` (5 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: stefansf at linux dot ibm.com @ 2023-08-04 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> ---
Created attachment 55688
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55688&action=edit
Increase optimization and skip sparc for 4-6

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2023-08-04 14:16 ` stefansf at linux dot ibm.com
@ 2023-08-04 14:18 ` stefansf at linux dot ibm.com
  2023-08-07 12:29 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: stefansf at linux dot ibm.com @ 2023-08-04 14:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> ---
Turns out that my dejagnu foo is weak ;-) I came up with a wrong target
selector. Should be fixed in the new attachment.

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2023-08-04 14:18 ` stefansf at linux dot ibm.com
@ 2023-08-07 12:29 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2023-08-07 13:41 ` stefansf at linux dot ibm.com
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2023-08-07 12:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #16 from Stefan Schulze Frielinghaus <stefansf at linux dot
> ibm.com> ---
> Turns out that my dejagnu foo is weak ;-) I came up with a wrong target
> selector. Should be fixed in the new attachment.

Right: DejaGnu selector syntax is tricky indeed ;-(

Now tested on sparc-sun-solaris2.11 and amd-64-pc-solaris2.11: works as
expected.

One suggestion: in case you exclude a particular target by triple, it's
helpful to add a short comment explaining why this was done.  This way,
if the test later is discovered to FAIL on a different target, it's
easier to see if this is the same issue.  When using effective-target
keywords instead, the semantics of the exclusion is easier to
understand.

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2023-08-07 12:29 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2023-08-07 13:41 ` stefansf at linux dot ibm.com
  2023-08-08  6:54 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 23+ messages in thread
From: stefansf at linux dot ibm.com @ 2023-08-07 13:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> ---
Thanks again for testing.  Very much appreciated!

I like the idea of a comment and posted a patch:

https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626514.html

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2023-08-07 13:41 ` stefansf at linux dot ibm.com
@ 2023-08-08  6:54 ` cvs-commit at gcc dot gnu.org
  2023-10-02  5:23 ` xry111 at gcc dot gnu.org
  2023-10-02  5:24 ` xry111 at gcc dot gnu.org
  21 siblings, 0 replies; 23+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-08  6:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Stefan Schulze Frielinghaus
<stefansf@gcc.gnu.org>:

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

commit r14-3074-gf3a8dde08b420dbe9cacbc1a1febaaf77357f4d4
Author: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Date:   Tue Aug 8 08:53:12 2023 +0200

    rtl-optimization/110869 Fix tests cmp-mem-const-*.c for sparc

    This fixes the rather new tests cmp-mem-const-{1,2,3,4,5,6}.c for sparc.
    For -1 and -2 we need at least optimization level 2 on sparc.  For the
    sake of homogeneity, change all test cases to -O2.  For -3 and -4 we do
    not end up with a comparison of memory and a constant, and finally for
    -5 and -6 the constants are reduced by a prior optimization which means
    there is nothing left to do.  Thus excluding sparc from those tests.

    gcc/testsuite/ChangeLog:

            PR rtl-optimization/110869
            * gcc.dg/cmp-mem-const-1.c: Use optimization level 2.
            * gcc.dg/cmp-mem-const-2.c: Dito.
            * gcc.dg/cmp-mem-const-3.c: Exclude sparc from this test.
            * gcc.dg/cmp-mem-const-4.c: Dito.
            * gcc.dg/cmp-mem-const-5.c: Dito.
            * gcc.dg/cmp-mem-const-6.c: Dito.

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2023-08-08  6:54 ` cvs-commit at gcc dot gnu.org
@ 2023-10-02  5:23 ` xry111 at gcc dot gnu.org
  2023-10-02  5:24 ` xry111 at gcc dot gnu.org
  21 siblings, 0 replies; 23+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-10-02  5:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110869
Bug 110869 depends on bug 110867, which changed state.

Bug 110867 Summary: [14 Regression] ICE in combine after 7cdd0860949c6c3232e6cff1d7ca37bb5234074c
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110867

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

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

* [Bug middle-end/110869] [14 regression] ICE in decompose, at rtl.h:2297
  2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2023-10-02  5:23 ` xry111 at gcc dot gnu.org
@ 2023-10-02  5:24 ` xry111 at gcc dot gnu.org
  21 siblings, 0 replies; 23+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-10-02  5:24 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
                 CC|                            |xry111 at gcc dot gnu.org
             Status|NEW                         |RESOLVED

--- Comment #20 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
Marking as fixed as the patch is already pushed.

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

end of thread, other threads:[~2023-10-02  5:24 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-01 16:26 [Bug middle-end/110869] New: [14 regression] ICE in decompose, at rtl.h:2297 ro at gcc dot gnu.org
2023-08-01 16:27 ` [Bug middle-end/110869] " ro at gcc dot gnu.org
2023-08-01 18:20 ` pinskia at gcc dot gnu.org
2023-08-01 19:58 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-02  7:40 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-02  9:05 ` stefansf at linux dot ibm.com
2023-08-02  9:17 ` ro at gcc dot gnu.org
2023-08-02  9:50 ` ebotcazou at gcc dot gnu.org
2023-08-02 14:05 ` stefansf at linux dot ibm.com
2023-08-02 19:44 ` cvs-commit at gcc dot gnu.org
2023-08-04  7:53 ` ro at gcc dot gnu.org
2023-08-04  7:53 ` ro at gcc dot gnu.org
2023-08-04  8:38 ` stefansf at linux dot ibm.com
2023-08-04  8:40 ` stefansf at linux dot ibm.com
2023-08-04  8:51 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-04  9:42 ` stefansf at linux dot ibm.com
2023-08-04 14:16 ` stefansf at linux dot ibm.com
2023-08-04 14:18 ` stefansf at linux dot ibm.com
2023-08-07 12:29 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-07 13:41 ` stefansf at linux dot ibm.com
2023-08-08  6:54 ` cvs-commit at gcc dot gnu.org
2023-10-02  5:23 ` xry111 at gcc dot gnu.org
2023-10-02  5:24 ` xry111 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).