public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/106958] New: [13 Regression] ICE in reassoc since r13-2658
@ 2022-09-16 19:01 jakub at gcc dot gnu.org
  2022-09-16 19:02 ` [Bug tree-optimization/106958] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-09-16 19:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106958
           Summary: [13 Regression] ICE in reassoc since r13-2658
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

As reported privately to me, on armv7hl-linux-gnueabi my
r13-2658-g645ef01a463f15fc230e2155719c7a12cec89acf
change causes ICE on the following testcase at -O2:
int a;
void bar (int);

void
foo (char *x, char *y)
{
  int b = a != 0;
  int c = x != 0;
  int d = y != 0;
  bar (b | c | d);
}

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

* [Bug tree-optimization/106958] [13 Regression] ICE in reassoc since r13-2658
  2022-09-16 19:01 [Bug tree-optimization/106958] New: [13 Regression] ICE in reassoc since r13-2658 jakub at gcc dot gnu.org
@ 2022-09-16 19:02 ` jakub at gcc dot gnu.org
  2022-09-16 19:36 ` jeffreyalaw at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-09-16 19:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2022-09-16
   Target Milestone|---                         |13.0
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
           Priority|P3                          |P1
     Ever confirmed|0                           |1

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

* [Bug tree-optimization/106958] [13 Regression] ICE in reassoc since r13-2658
  2022-09-16 19:01 [Bug tree-optimization/106958] New: [13 Regression] ICE in reassoc since r13-2658 jakub at gcc dot gnu.org
  2022-09-16 19:02 ` [Bug tree-optimization/106958] " jakub at gcc dot gnu.org
@ 2022-09-16 19:36 ` jeffreyalaw at gmail dot com
  2022-09-16 20:33 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jeffreyalaw at gmail dot com @ 2022-09-16 19:36 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <jeffreyalaw at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jeffreyalaw at gmail dot com

--- Comment #1 from Jeffrey A. Law <jeffreyalaw at gmail dot com> ---
Note this affects glibc builds on various targets.  For example, sh3-linux-gnu
with this reduced testcase:

int
fmtmsg (int severity, const char *text, const char *action)
{
  int do_severity = severity != 0;
  int do_text = text != ((char *) 0);
  int do_action = action != ((char *) 0);
  int need_colon = do_severity | do_text | do_action ;
  frob (need_colon);
}

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

* [Bug tree-optimization/106958] [13 Regression] ICE in reassoc since r13-2658
  2022-09-16 19:01 [Bug tree-optimization/106958] New: [13 Regression] ICE in reassoc since r13-2658 jakub at gcc dot gnu.org
  2022-09-16 19:02 ` [Bug tree-optimization/106958] " jakub at gcc dot gnu.org
  2022-09-16 19:36 ` jeffreyalaw at gmail dot com
@ 2022-09-16 20:33 ` jakub at gcc dot gnu.org
  2022-09-17  6:19 ` cvs-commit at gcc dot gnu.org
  2022-09-17  6:42 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-09-16 20:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 53587
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53587&action=edit
gcc13-pr106958.patch

Untested fix.

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

* [Bug tree-optimization/106958] [13 Regression] ICE in reassoc since r13-2658
  2022-09-16 19:01 [Bug tree-optimization/106958] New: [13 Regression] ICE in reassoc since r13-2658 jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-09-16 20:33 ` jakub at gcc dot gnu.org
@ 2022-09-17  6:19 ` cvs-commit at gcc dot gnu.org
  2022-09-17  6:42 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-09-17  6:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 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:9ac9fde961f76879f0379ff3b2494a2f9ac915f7

commit r13-2709-g9ac9fde961f76879f0379ff3b2494a2f9ac915f7
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Sep 17 08:18:24 2022 +0200

    reassoc: Fix up recent regression in optimize_range_tests_cmp_bitwise
[PR106958]

    As the following testcase reduced from glibc fmtmsg.c shows
    (it doesn't ICE on x86_64/i686 unfortunately, but does on various other
    arches), my last optimize_range_tests_cmp_bitwise change wasn't fully
    correct.  The intent was to let all pointer operands be cast to
    pointer_sized_int_node first in addition to the other casts (to type1)
    which are done for id >= l cases.
    But one spot I've touched used always cast to type1 (note, the (b % 4) == 3
    case is impossible for pointer operands because that is for !TYPE_UNSIGNED
    operands and pointers are TYPE_UNSIGNED) and in the other spot the cast
    would be done only for id >= l if not useless, but for pointers we need
    to cast it always.

    2022-09-17  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/106958
            * tree-ssa-reassoc.cc (optimize_range_tests_cmp_bitwise): If
            id >= l, cast op to type1, otherwise to pointer_sized_int_node.
            If type has pointer type, cast exp to pointer_sized_int_node
            even when id < l.

            * gcc.c-torture/compile/pr106958.c: New test.

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

* [Bug tree-optimization/106958] [13 Regression] ICE in reassoc since r13-2658
  2022-09-16 19:01 [Bug tree-optimization/106958] New: [13 Regression] ICE in reassoc since r13-2658 jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-09-17  6:19 ` cvs-commit at gcc dot gnu.org
@ 2022-09-17  6:42 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-09-17  6:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2022-09-17  6:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 19:01 [Bug tree-optimization/106958] New: [13 Regression] ICE in reassoc since r13-2658 jakub at gcc dot gnu.org
2022-09-16 19:02 ` [Bug tree-optimization/106958] " jakub at gcc dot gnu.org
2022-09-16 19:36 ` jeffreyalaw at gmail dot com
2022-09-16 20:33 ` jakub at gcc dot gnu.org
2022-09-17  6:19 ` cvs-commit at gcc dot gnu.org
2022-09-17  6:42 ` 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).