public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/115199] New: [15 regression] gettext (libtextstyle) testsuite miscompiled
@ 2024-05-22 21:28 sjames at gcc dot gnu.org
  2024-05-22 21:28 ` [Bug tree-optimization/115199] " sjames at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-05-22 21:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115199
           Summary: [15 regression] gettext (libtextstyle) testsuite
                    miscompiled
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: kacper.slominski72 at gmail dot com
  Target Milestone: ---

This originally came out with gettext (libtextstyle)'s testsuite being
miscompiled with a single test failing.

Kacper Słomiński (qookie) did all the separation and reduction work.

We both tidied it up together a bit more after and hopefully we didn't do it
too far:
```
struct b {
  char *volatile c;
} *d() {
  char *e;
  struct b *b = __builtin_malloc(sizeof(b));
  void *f = __builtin_malloc(1);

  e = __builtin_memcpy(f, "z", 1);
  b->c = e;
  return b;
}

int main() {
  struct b b = *d();
  if (b.c[0] != 'z')
    __builtin_abort();
}
```

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

* [Bug tree-optimization/115199] [15 regression] gettext (libtextstyle) testsuite miscompiled
  2024-05-22 21:28 [Bug tree-optimization/115199] New: [15 regression] gettext (libtextstyle) testsuite miscompiled sjames at gcc dot gnu.org
@ 2024-05-22 21:28 ` sjames at gcc dot gnu.org
  2024-05-22 21:35 ` sjames at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-05-22 21:28 UTC (permalink / raw)
  To: gcc-bugs

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

Sam James <sjames at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code

--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
I'll bisect now.

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

* [Bug tree-optimization/115199] [15 regression] gettext (libtextstyle) testsuite miscompiled
  2024-05-22 21:28 [Bug tree-optimization/115199] New: [15 regression] gettext (libtextstyle) testsuite miscompiled sjames at gcc dot gnu.org
  2024-05-22 21:28 ` [Bug tree-optimization/115199] " sjames at gcc dot gnu.org
@ 2024-05-22 21:35 ` sjames at gcc dot gnu.org
  2024-05-22 21:42 ` kacper.slominski72 at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sjames at gcc dot gnu.org @ 2024-05-22 21:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
From an earlier version:
"""
[22:12] <qookie> sam_: first difference that matters is between
foo-{good,bad}-foo.c.122t.dse2
[22:12] <qookie>    _9 = __builtin_malloc (4);
[22:12] <qookie> -  _10 = __builtin_memcpy (_9, "foo", 4);
[22:12] <qookie> +  _10 = _9;
"""

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

* [Bug tree-optimization/115199] [15 regression] gettext (libtextstyle) testsuite miscompiled
  2024-05-22 21:28 [Bug tree-optimization/115199] New: [15 regression] gettext (libtextstyle) testsuite miscompiled sjames at gcc dot gnu.org
  2024-05-22 21:28 ` [Bug tree-optimization/115199] " sjames at gcc dot gnu.org
  2024-05-22 21:35 ` sjames at gcc dot gnu.org
@ 2024-05-22 21:42 ` kacper.slominski72 at gmail dot com
  2024-05-22 21:43 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kacper.slominski72 at gmail dot com @ 2024-05-22 21:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Kacper Słomiński <kacper.slominski72 at gmail dot com> ---
For the version in the bug report the first bad diff is:

--- foo-good-foo.c.044t.dse1    2024-05-22 23:22:35.962903496 +0200
+++ foo-bad-foo.c.044t.dse1     2024-05-22 23:22:23.869476999 +0200
@@ -11,7 +11,7 @@
   <bb 2> :
   b_3 = __builtin_malloc (8);
   f_5 = __builtin_malloc (1);
-  e_7 = __builtin_memcpy (f_5, "z", 1);
+  e_7 = f_5;
   b_3->c ={v} e_7;
   return b_3;

So the same thing, but happening in an earlier pass.

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

* [Bug tree-optimization/115199] [15 regression] gettext (libtextstyle) testsuite miscompiled
  2024-05-22 21:28 [Bug tree-optimization/115199] New: [15 regression] gettext (libtextstyle) testsuite miscompiled sjames at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-05-22 21:42 ` kacper.slominski72 at gmail dot com
@ 2024-05-22 21:43 ` pinskia at gcc dot gnu.org
  2024-05-22 21:46 ` [Bug tree-optimization/115199] [15 regression] gettext (libtextstyle) testsuite miscompiled since r15-579 jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-22 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |15.0
             Status|UNCONFIRMED                 |NEW
                 CC|                            |rguenth at gcc dot gnu.org
           Keywords|                            |alias
   Last reconfirmed|                            |2024-05-22
     Ever confirmed|0                           |1

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.
```
  Deleted dead call: # .MEM_6 = VDEF <.MEM_4>
# PT = null { D.2790 }
# ALIGN = 8, MISALIGN = 0
e_7 = memcpyD.1670 (f_5, "z", 1);
```

Note the volatile makes the difference. It seems like we miss that the memory
escapes through the volatile store so we delete the memcpy as being dead.

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

* [Bug tree-optimization/115199] [15 regression] gettext (libtextstyle) testsuite miscompiled since r15-579
  2024-05-22 21:28 [Bug tree-optimization/115199] New: [15 regression] gettext (libtextstyle) testsuite miscompiled sjames at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-05-22 21:43 ` pinskia at gcc dot gnu.org
@ 2024-05-22 21:46 ` jakub at gcc dot gnu.org
  2024-05-23  8:59 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-05-22 21:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
           Priority|P3                          |P1
            Summary|[15 regression] gettext     |[15 regression] gettext
                   |(libtextstyle) testsuite    |(libtextstyle) testsuite
                   |miscompiled                 |miscompiled since r15-579

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
r15-579-ga9251ab3c91c8c559d0306838575a666ae62dff4

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

* [Bug tree-optimization/115199] [15 regression] gettext (libtextstyle) testsuite miscompiled since r15-579
  2024-05-22 21:28 [Bug tree-optimization/115199] New: [15 regression] gettext (libtextstyle) testsuite miscompiled sjames at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-05-22 21:46 ` [Bug tree-optimization/115199] [15 regression] gettext (libtextstyle) testsuite miscompiled since r15-579 jakub at gcc dot gnu.org
@ 2024-05-23  8:59 ` rguenth at gcc dot gnu.org
  2024-05-23 12:39 ` cvs-commit at gcc dot gnu.org
  2024-05-23 12:40 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-23  8:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
            Version|unknown                     |15.0
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.

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

* [Bug tree-optimization/115199] [15 regression] gettext (libtextstyle) testsuite miscompiled since r15-579
  2024-05-22 21:28 [Bug tree-optimization/115199] New: [15 regression] gettext (libtextstyle) testsuite miscompiled sjames at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-05-23  8:59 ` rguenth at gcc dot gnu.org
@ 2024-05-23 12:39 ` cvs-commit at gcc dot gnu.org
  2024-05-23 12:40 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-05-23 12:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

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

commit r15-792-gf0a02467bbc35a478eb82f5a8a7e8870827b51fc
Author: Richard Biener <rguenther@suse.de>
Date:   Thu May 23 13:33:15 2024 +0200

    tree-optimization/115199 - fix PTA constraint processing for &ANYTHING LHS

    When processing a &ANYTHING = X constraint we treat it as *ANYTHING = X
    during constraint processing but then end up recording it as
    &ANYTHING = X anyway, breaking constraint graph building.  This is
    because we only update the local copy of the LHS and not the constraint
    itself.

            PR tree-optimization/115199
            * tree-ssa-structalias.cc (process_constraint): Also
            record &ANYTHING = X as *ANYTING = X in the end.

            * gcc.dg/torture/pr115199.c: New testcase.

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

* [Bug tree-optimization/115199] [15 regression] gettext (libtextstyle) testsuite miscompiled since r15-579
  2024-05-22 21:28 [Bug tree-optimization/115199] New: [15 regression] gettext (libtextstyle) testsuite miscompiled sjames at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2024-05-23 12:39 ` cvs-commit at gcc dot gnu.org
@ 2024-05-23 12:40 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-05-23 12:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2024-05-23 12:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-22 21:28 [Bug tree-optimization/115199] New: [15 regression] gettext (libtextstyle) testsuite miscompiled sjames at gcc dot gnu.org
2024-05-22 21:28 ` [Bug tree-optimization/115199] " sjames at gcc dot gnu.org
2024-05-22 21:35 ` sjames at gcc dot gnu.org
2024-05-22 21:42 ` kacper.slominski72 at gmail dot com
2024-05-22 21:43 ` pinskia at gcc dot gnu.org
2024-05-22 21:46 ` [Bug tree-optimization/115199] [15 regression] gettext (libtextstyle) testsuite miscompiled since r15-579 jakub at gcc dot gnu.org
2024-05-23  8:59 ` rguenth at gcc dot gnu.org
2024-05-23 12:39 ` cvs-commit at gcc dot gnu.org
2024-05-23 12:40 ` rguenth 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).