public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/97404] New: [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d
@ 2020-10-13 16:36 acoplan at gcc dot gnu.org
  2020-10-13 18:19 ` [Bug ipa/97404] " marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: acoplan at gcc dot gnu.org @ 2020-10-13 16:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97404
           Summary: [9/10/11 Regression] aarch64: Wrong code since
                    r9-3666-g74ca1c01d
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

AArch64 GCC miscompiles the following testcase:

char a, b;
long c;
short d, e;
long *f = &c;
int g;
char h(signed char i) { return 0; }
static short j(short i, int k) { return i < 0 ? 0 : i >> k; }
void l(void);
void m(void)
{
  e = j(d | 9766, 11);
  *f = e;
}
void l(void)
{
  a = 5 | g;
  b = h(a);
}
int main()
{
  m();
  if (c != 4)
    __builtin_abort();
}

when built with -O2 -fno-inline since
r9-3666-g74ca1c01d02e548f32aa26f9a887dcc0730703fb. Immediately prior to this
revision we have:

j.constprop.0:
.LFB5:
        .cfi_startproc
        tst     w0, 32768
        sbfx    w0, w0, 11, 5
        csel    w0, w0, wzr, eq
        ret

and afterwards we have:

j.constprop.0:
.LFB5:
        .cfi_startproc
        mov     w0, 0
        ret

which would suggest that GCC has determined that j is always called with
arguments such that it returns 0, but this is not the case.

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

* [Bug ipa/97404] [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d
  2020-10-13 16:36 [Bug ipa/97404] New: [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d acoplan at gcc dot gnu.org
@ 2020-10-13 18:19 ` marxin at gcc dot gnu.org
  2020-10-14  6:20 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-13 18:19 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Target Milestone|---                         |9.4
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-10-13
           Priority|P3                          |P1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Thank you for the report, I'm gonna take a look tomorrow.

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

* [Bug ipa/97404] [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d
  2020-10-13 16:36 [Bug ipa/97404] New: [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d acoplan at gcc dot gnu.org
  2020-10-13 18:19 ` [Bug ipa/97404] " marxin at gcc dot gnu.org
@ 2020-10-14  6:20 ` rguenth at gcc dot gnu.org
  2020-10-16  7:44 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-10-14  6:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2

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

* [Bug ipa/97404] [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d
  2020-10-13 16:36 [Bug ipa/97404] New: [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d acoplan at gcc dot gnu.org
  2020-10-13 18:19 ` [Bug ipa/97404] " marxin at gcc dot gnu.org
  2020-10-14  6:20 ` rguenth at gcc dot gnu.org
@ 2020-10-16  7:44 ` cvs-commit at gcc dot gnu.org
  2020-10-16  7:53 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-16  7:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

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

commit r11-3997-ga86623902767122c71c7229150a8b8a79cbb3673
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Oct 15 14:57:31 2020 +0200

    IPA: compare VRP types.

    gcc/ChangeLog:

            PR ipa/97404
            * ipa-prop.c (struct ipa_vr_ggc_hash_traits):
            Compare types of VRP as we can merge ranges of different types.

    gcc/testsuite/ChangeLog:

            PR ipa/97404
            * gcc.c-torture/execute/pr97404.c: New test.

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

* [Bug ipa/97404] [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d
  2020-10-13 16:36 [Bug ipa/97404] New: [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d acoplan at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-10-16  7:44 ` cvs-commit at gcc dot gnu.org
@ 2020-10-16  7:53 ` marxin at gcc dot gnu.org
  2020-10-16  8:52 ` [Bug ipa/97404] [9/10 " cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-16  7:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |11.0

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master so far.

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

* [Bug ipa/97404] [9/10 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d
  2020-10-13 16:36 [Bug ipa/97404] New: [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d acoplan at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-10-16  7:53 ` marxin at gcc dot gnu.org
@ 2020-10-16  8:52 ` cvs-commit at gcc dot gnu.org
  2020-10-16  8:52 ` cvs-commit at gcc dot gnu.org
  2020-10-16  8:53 ` marxin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-16  8:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Martin Liska
<marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:92fedd32d8568f2336050b064da50b3c6441d029

commit r10-8896-g92fedd32d8568f2336050b064da50b3c6441d029
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Oct 15 14:57:31 2020 +0200

    IPA: compare VRP types.

    gcc/ChangeLog:

            PR ipa/97404
            * ipa-prop.c (struct ipa_vr_ggc_hash_traits):
            Compare types of VRP as we can merge ranges of different types.

    gcc/testsuite/ChangeLog:

            PR ipa/97404
            * gcc.c-torture/execute/pr97404.c: New test.

    (cherry picked from commit a86623902767122c71c7229150a8b8a79cbb3673)

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

* [Bug ipa/97404] [9/10 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d
  2020-10-13 16:36 [Bug ipa/97404] New: [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d acoplan at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-10-16  8:52 ` [Bug ipa/97404] [9/10 " cvs-commit at gcc dot gnu.org
@ 2020-10-16  8:52 ` cvs-commit at gcc dot gnu.org
  2020-10-16  8:53 ` marxin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-16  8:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Martin Liska
<marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:3faef34e9e0888ad82a115a5a7d775d299863c4f

commit r9-8999-g3faef34e9e0888ad82a115a5a7d775d299863c4f
Author: Martin Liska <mliska@suse.cz>
Date:   Thu Oct 15 14:57:31 2020 +0200

    IPA: compare VRP types.

    gcc/ChangeLog:

            PR ipa/97404
            * ipa-prop.c (struct ipa_vr_ggc_hash_traits):
            Compare types of VRP as we can merge ranges of different types.

    gcc/testsuite/ChangeLog:

            PR ipa/97404
            * gcc.c-torture/execute/pr97404.c: New test.

    (cherry picked from commit a86623902767122c71c7229150a8b8a79cbb3673)

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

* [Bug ipa/97404] [9/10 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d
  2020-10-13 16:36 [Bug ipa/97404] New: [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d acoplan at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-10-16  8:52 ` cvs-commit at gcc dot gnu.org
@ 2020-10-16  8:53 ` marxin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-10-16  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on all affected branched.

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

end of thread, other threads:[~2020-10-16  8:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 16:36 [Bug ipa/97404] New: [9/10/11 Regression] aarch64: Wrong code since r9-3666-g74ca1c01d acoplan at gcc dot gnu.org
2020-10-13 18:19 ` [Bug ipa/97404] " marxin at gcc dot gnu.org
2020-10-14  6:20 ` rguenth at gcc dot gnu.org
2020-10-16  7:44 ` cvs-commit at gcc dot gnu.org
2020-10-16  7:53 ` marxin at gcc dot gnu.org
2020-10-16  8:52 ` [Bug ipa/97404] [9/10 " cvs-commit at gcc dot gnu.org
2020-10-16  8:52 ` cvs-commit at gcc dot gnu.org
2020-10-16  8:53 ` marxin 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).