public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234
@ 2021-10-12 21:45 seurer at gcc dot gnu.org
  2021-10-13  2:16 ` [Bug testsuite/102720] " msebor at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: seurer at gcc dot gnu.org @ 2021-10-12 21:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102720
           Summary: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and
                    ldist-strlen-2.c fail after r12-4234
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:008e7397dad971c03c08fc1b0a4a98fddccaaed8, r12-4324

FAIL: gcc.dg/tree-ssa/ldist-strlen-1.c execution test
FAIL: gcc.dg/tree-ssa/ldist-strlen-2.c execution test


Executing on host: /home/seurer/gcc/git/build/gcc-test/gcc/xgcc
-B/home/seurer/gcc/git/build/gcc-test/gcc/ exceptions_enabled3377861.cc   
-fdiagnostics-plain-output  -S -o exceptions_enabled3377861.s    (timeout =
300)
spawn -ignore SIGHUP /home/seurer/gcc/git/build/gcc-test/gcc/xgcc
-B/home/seurer/gcc/git/build/gcc-test/gcc/ exceptions_enabled3377861.cc
-fdiagnostics-plain-output -S -o exceptions_enabled3377861.s
PASS: gcc.dg/tree-ssa/ldist-strlen-1.c (test for excess errors)
Setting LD_LIBRARY_PATH to
:/home/seurer/gcc/git/build/gcc-test/gcc::/home/seurer/gcc/git/build/gcc-test/gcc:/home/seurer/gcc/git/build/gcc-test/./gmp/.libs:/home/seurer/gcc/git/build/gcc-test/./prev-gmp/.libs:/home/seurer/gcc/git/build/gcc-test/./mpfr/src/.libs:/home/seurer/gcc/git/build/gcc-test/./prev-mpfr/src/.libs:/home/seurer/gcc/git/build/gcc-test/./mpc/src/.libs:/home/seurer/gcc/git/build/gcc-test/./prev-mpc/src/.libs:/home/seurer/gcc/git/build/gcc-test/./isl/.libs:/home/seurer/gcc/git/build/gcc-test/./prev-isl/.libs
Execution timeout is: 300
spawn [open ...]
ldist-strlen-1.exe:
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/tree-ssa/ldist-strlen-1.c:52:
main: Assertion `test_uint8_tsize_t (p) == 1' failed.
FAIL: gcc.dg/tree-ssa/ldist-strlen-1.c execution test


spawn -ignore SIGHUP /home/seurer/gcc/git/build/gcc-test/gcc/xgcc
-B/home/seurer/gcc/git/build/gcc-test/gcc/
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/tree-ssa/ldist-strlen-2.c
-fdiagnostics-plain-output -O2 -ftree-loop-distribution
-fdump-tree-ldist-details -lm -o ./ldist-strlen-2.exe
PASS: gcc.dg/tree-ssa/ldist-strlen-2.c (test for excess errors)
Setting LD_LIBRARY_PATH to
:/home/seurer/gcc/git/build/gcc-test/gcc::/home/seurer/gcc/git/build/gcc-test/gcc:/home/seurer/gcc/git/build/gcc-test/./gmp/.libs:/home/seurer/gcc/git/build/gcc-test/./prev-gmp/.libs:/home/seurer/gcc/git/build/gcc-test/./mpfr/src/.libs:/home/seurer/gcc/git/build/gcc-test/./prev-mpfr/src/.libs:/home/seurer/gcc/git/build/gcc-test/./mpc/src/.libs:/home/seurer/gcc/git/build/gcc-test/./prev-mpc/src/.libs:/home/seurer/gcc/git/build/gcc-test/./isl/.libs:/home/seurer/gcc/git/build/gcc-test/./prev-isl/.libs
Execution timeout is: 300
spawn [open ...]
ldist-strlen-2.exe:
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/tree-ssa/ldist-strlen-2.c:43:
main: Assertion `test_pos (s) == 42+13' failed.
FAIL: gcc.dg/tree-ssa/ldist-strlen-2.c execution test


commit 008e7397dad971c03c08fc1b0a4a98fddccaaed8 (HEAD, refs/bisect/bad)
Author: Jan Hubicka <hubicka@ucw.cz>
Date:   Mon Oct 11 18:43:26 2021 +0200

    Commonize ipa-pta constraint generation for calls

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

* [Bug testsuite/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
@ 2021-10-13  2:16 ` msebor at gcc dot gnu.org
  2021-10-13  7:37 ` rguenth at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-10-13  2:16 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-10-13
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed, also reported on x86_64 and i686:
https://gcc.gnu.org/pipermail/gcc-testresults/2021-October/727873.html
https://gcc.gnu.org/pipermail/gcc-testresults/2021-October/727870.html

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

* [Bug testsuite/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
  2021-10-13  2:16 ` [Bug testsuite/102720] " msebor at gcc dot gnu.org
@ 2021-10-13  7:37 ` rguenth at gcc dot gnu.org
  2021-10-13  7:38 ` [Bug tree-optimization/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324 rguenth at gcc dot gnu.org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-13  7:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
   Target Milestone|---                         |12.0
           Keywords|                            |wrong-code
             Target|powerpc64-linux-gnu,        |powerpc64-linux-gnu,
                   |powerpc64le-linux-gnu       |powerpc64le-linux-gnu,
                   |                            |x86_64-linux-gnu

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Also seen on x86_64-linux but are you sure about the bisection?

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

* [Bug tree-optimization/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
  2021-10-13  2:16 ` [Bug testsuite/102720] " msebor at gcc dot gnu.org
  2021-10-13  7:37 ` rguenth at gcc dot gnu.org
@ 2021-10-13  7:38 ` rguenth at gcc dot gnu.org
  2021-10-13 10:14 ` stefansf at linux dot ibm.com
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-10-13  7:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|testsuite                   |tree-optimization
            Summary|[12 regression]             |[12 regression]
                   |gcc.dg/tree-ssa/ldist-strle |gcc.dg/tree-ssa/ldist-strle
                   |n-1.c and ldist-strlen-2.c  |n-1.c and ldist-strlen-2.c
                   |fail after r12-4234         |fail after r12-4324

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ah, the summary is just wrong...

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

* [Bug tree-optimization/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-10-13  7:38 ` [Bug tree-optimization/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324 rguenth at gcc dot gnu.org
@ 2021-10-13 10:14 ` stefansf at linux dot ibm.com
  2021-10-13 14:50 ` clyon at gcc dot gnu.org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: stefansf at linux dot ibm.com @ 2021-10-13 10:14 UTC (permalink / raw)
  To: gcc-bugs

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

Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stefansf at linux dot ibm.com

--- Comment #4 from Stefan Schulze Frielinghaus <stefansf at linux dot ibm.com> ---
typedef __SIZE_TYPE__ size_t;
extern void* malloc (size_t);
extern void* memset (void*, int, size_t);

__attribute__((noinline))
int test (char *s)
{
  int i;
  for (i=0; s[i]; ++i);
  return i;
}

int main (void)
{
  char *p = malloc (1024);
  memset (p, 0xf, 1024);     // removed
  p[1] = 0;                  // removed
  int i = test (p);
  if (i != 1)
    __builtin_abort ();
  return 0;
}

$ gcc -O2 -fdump-tree-dse2-details test.c

In dse2 we then have:

Deleted dead store: MEM[(char *)p_3 + 1B] = 0;
Deleted dead call: memset (p_3, 15, 1024);

prior g:008e7397dad971c03c08fc1b0a4a98fddccaaed8 the store and call is not
removed.

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

* [Bug tree-optimization/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-10-13 10:14 ` stefansf at linux dot ibm.com
@ 2021-10-13 14:50 ` clyon at gcc dot gnu.org
  2021-10-13 14:52 ` clyon at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: clyon at gcc dot gnu.org @ 2021-10-13 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

Christophe Lyon <clyon at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clyon at gcc dot gnu.org
             Target|powerpc64-linux-gnu,        |powerpc64-linux-gnu,
                   |powerpc64le-linux-gnu,      |powerpc64le-linux-gnu,
                   |x86_64-linux-gnu            |x86_64-linux-gnu, arm,
                   |                            |aarch64

--- Comment #5 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Seen on arm and aarch64 too

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

* [Bug tree-optimization/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-10-13 14:50 ` clyon at gcc dot gnu.org
@ 2021-10-13 14:52 ` clyon at gcc dot gnu.org
  2021-10-15 11:36 ` [Bug ipa/102720] " hubicka at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: clyon at gcc dot gnu.org @ 2021-10-13 14:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Christophe Lyon <clyon at gcc dot gnu.org> ---
On aarch64, this also causes gcc.dg/loop-unswitch-4.c to fail

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

* [Bug ipa/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-10-13 14:52 ` clyon at gcc dot gnu.org
@ 2021-10-15 11:36 ` hubicka at gcc dot gnu.org
  2021-10-15 12:21 ` hubicka at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-10-15 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
simplified testcase is:
typedef unsigned char uint8_t;
typedef __SIZE_TYPE__ size_t;
extern void* malloc (size_t);
extern void* memset (void*, int, size_t);

#define test(T, U)        \
__attribute__((noinline)) \
U test_##T##U (T *s)      \
{                         \
  U i;                    \
  for (i=0; s[i]; ++i);   \
  return i;               \
}

test (uint8_t,  size_t)

#define run(T, U, i)             \
{                                \
T *q = p;                        \
q[i] = 0;                        \
if (test_##T##U (p) != i) __builtin_abort ();   \
}

int main(void)
{
  void *p = malloc (1024);
  memset (p, 0xf, 1024);

  run (uint8_t, size_t, 1);

  return 0;
}

things goes wrong with dse2:
;; Function main (main, funcdef_no=1, decl_uid=1994, cgraph_uid=2,
symbol_order=1) (executed once)

  Deleted dead store: MEM[(uint8_t *)p_4 + 1B] = 0;

  Deleted dead call: memset (p_4, 15, 1024);

int main ()
{
  void * p;
  long unsigned int _1;

  <bb 2> [local count: 1073741824]:
  p_4 = malloc (1024);
  _1 = test_uint8_tsize_t (p_4);
  if (_1 != 1)
    goto <bb 3>; [0.00%]
  else
    goto <bb 4>; [100.00%]

  <bb 3> [count: 0]:
  __builtin_abort ();

  <bb 4> [local count: 1073741824]:
  return 0;

}

so it seems that we conlcude that the memory initialization is not needed.
modref2 info seems ok:
  loads:
    Limits: 32 bases, 16 refs
      Base 0: alias set 0
        Ref 0: alias set 0
          access: Parm 0 param offset:0 offset:0 size:8 max_size:8
          access: Parm 0 param offset:1 offset:0 size:-1 max_size:-1
  stores:
    Limits: 32 bases, 16 refs
  parm 0 flags: direct

since function is detected as pure we do not store noclobber which is implicit
here.

PTA solution is:

ANYTHING = { ANYTHING }
ESCAPED = { ESCAPED NONLOCAL }
NONLOCAL = { ESCAPED NONLOCAL } same as callescape(23)
STOREDANYTHING = { }
INTEGER = { ANYTHING }
HEAP(14) = { NULL ANYTHING }
malloc = { }
callescape(9) = { ESCAPED NONLOCAL }
CALLUSED(10) = { ESCAPED NONLOCAL } same as callescape(9)
CALLCLOBBERED(11) = { ESCAPED NONLOCAL } same as callescape(9)
callarg(12) = { ESCAPED NONLOCAL } same as callescape(9)
p_4 = { HEAP(14) }
derefaddrtmp(15) = { NULL }
test_uint8_tsize_t = { }
callescape(17) = { NONLOCAL }
CALLUSED(18) = { NONLOCAL HEAP(14) }
CALLCLOBBERED(19) = { }
callarg(20) = { HEAP(14) }
_1 = { NONLOCAL HEAP(14) } same as CALLUSED(18)
abort = { }
callescape(23) = { ESCAPED NONLOCAL }
CALLUSED(24) = { ESCAPED NONLOCAL } same as callescape(23)
CALLCLOBBERED(25) = { }
main = { }


Alias information for main

Aliased symbols


Call clobber information

ESCAPED, points-to non-local, points-to vars: { }

Flow-insensitive points-to information

p_4, points-to NULL, points-to vars: { D.2014 }

We know that heap is used by the call, so I am bit confused why we optimize the
store out...

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

* [Bug ipa/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-10-15 11:36 ` [Bug ipa/102720] " hubicka at gcc dot gnu.org
@ 2021-10-15 12:21 ` hubicka at gcc dot gnu.org
  2021-10-15 13:26 ` hubicka at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-10-15 12:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
so it is really pt_solutions_intersect in ref_maybe_used_by_call returning
false.
We get:
(gdb) p *pt1
$6 = {anything = 0, nonlocal = 1, escaped = 1, ipa_escaped = 0, null = 0,
vars_contains_nonlocal = 0, vars_contains_escaped = 0,
vars_contains_escaped_heap = 0, vars_contains_restrict = 0,
vars_contains_interposable = 0,
  vars = 0x7ffff7518dc0}
(gdb) p *pt2
$7 = {anything = 0, nonlocal = 0, escaped = 0, ipa_escaped = 0, null = 1,
vars_contains_nonlocal = 0, vars_contains_escaped = 0,
vars_contains_escaped_heap = 0, vars_contains_restrict = 0,
vars_contains_interposable = 0,
  vars = 0x7ffff7518ae0}
(gdb) p debug_bitmap (pt1->vars)

first = 0x7ffff7531b40 current = 0x7ffff7531b40 indx = 15
        0x7ffff7531b40 next = (nil) prev = (nil) indx = 15
                bits = { 2008 }
$8 = void
(gdb) p debug_bitmap (pt2->vars)

first = 0x7ffff7540a00 current = 0x7ffff7540a00 indx = 15
        0x7ffff7540a00 next = (nil) prev = (nil) indx = 15
                bits = { 2014 }

Here pt1 is call use and pt2 is PTA of MEM[(uint8_t *)p_4 + 1B];

The bitmaps are indeed disjoint. 

I would expect them to be
p_4 = { HEAP(14) }
CALLUSED(18) = { NONLOCAL HEAP(14) }

So they should overleap by HEAP(14)...
Honza

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

* [Bug ipa/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2021-10-15 12:21 ` hubicka at gcc dot gnu.org
@ 2021-10-15 13:26 ` hubicka at gcc dot gnu.org
  2021-10-15 13:28 ` hubicka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-10-15 13:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
OK, with -alias dump we have:

int main ()
{
  uint8_t * q;
  void * p;
  long unsigned int _2;

  <bb 2> :
  # PT = null { D.2008 }
  # ALIGN = 8, MISALIGN = 0
  # USE = anything 
  # CLB = anything 
  p_5 = malloc (1024);
  # USE = anything 
  # CLB = anything 
  memset (p_5, 15, 1024);
  MEM[(uint8_t *)p_5 + 1B] = 0;
  # USE = nonlocal escaped { D.2008 }
  _2 = test_uint8_tsize_t (p_5);
  if (_2 != 1)
    goto <bb 3>; [INV]
  else
    goto <bb 4>; [INV]

  <bb 3> :
  # USE = nonlocal escaped 
  # CLB = nonlocal escaped 
  __builtin_abort ();

  <bb 4> :
  return 0;

}

and here I think the problem is that p points-to contains D.2008 while call
uses D.2014 so they do not intersect.  Interestingly enough for ealias we have
D.2008 in both and the graph solution dumpted is exactly the same...

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

* [Bug ipa/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2021-10-15 13:26 ` hubicka at gcc dot gnu.org
@ 2021-10-15 13:28 ` hubicka at gcc dot gnu.org
  2021-10-15 13:54 ` hubicka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-10-15 13:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
copied ealias dump rather than alis dump in previous comment.
alias dump is
int main ()
{
  void * p;
  long unsigned int _1;

  <bb 2> [local count: 1073741824]:
  # PT = null { D.2014 }
  # ALIGN = 8, MISALIGN = 0
  # USE = anything 
  # CLB = anything 
  p_4 = malloc (1024);
  # USE = anything 
  # CLB = anything 
  memset (p_4, 15, 1024);
  MEM[(uint8_t *)p_4 + 1B] = 0;
  # USE = nonlocal escaped { D.2008 }
  _1 = test_uint8_tsize_t (p_4);
  if (_1 != 1)
    goto <bb 3>; [0.00%]
  else
    goto <bb 4>; [100.00%]

  <bb 3> [count: 0]:
  # USE = nonlocal escaped 
  # CLB = nonlocal escaped 
  __builtin_abort ();

  <bb 4> [local count: 1073741824]:
  return 0;

}

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

* [Bug ipa/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2021-10-15 13:28 ` hubicka at gcc dot gnu.org
@ 2021-10-15 13:54 ` hubicka at gcc dot gnu.org
  2021-10-16 12:45 ` [Bug tree-optimization/102720] " cvs-commit at gcc dot gnu.org
  2021-11-21 11:57 ` hubicka at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-10-15 13:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Aha, the problem is in the way I updated computing use/clobber sets.  I
accidentally disabled code that copies the solution from solver local
representation into the final form. As a result we failed to update the call
uses while doing the late alias pass and ended up with stale decl from first
run.

Honza

diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 6f12a66ee0d..ebb4ea78674 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -379,7 +379,7 @@ new_var_info (tree t, const char *name, bool add_id)

   if (dump_file && add_id)
     {
-      char *tempname = xasprintf ("%s(%d)", name, index);
+      char *tempname = xasprintf ("%s(%d,%d)", name, index, t?DECL_UID
(t):-1);
       name = ggc_strdup (tempname);
       free (tempname);
     }
@@ -7541,17 +7541,18 @@ compute_points_to_sets (void)
              determine_global_memory_access (stmt, NULL,
                                              &reads_global_memory,
                                              &uses_global_memory);
-             if (!uses_global_memory)
-               ;
-             else if ((vi = lookup_call_use_vi (stmt)) != NULL)
+             if ((vi = lookup_call_use_vi (stmt)) != NULL)
                {
                  *pt = find_what_var_points_to (cfun->decl, vi);
                  /* Escaped (and thus nonlocal) variables are always
                     implicitly used by calls.  */
                  /* ???  ESCAPED can be empty even though NONLOCAL
                     always escaped.  */
-                 pt->nonlocal = uses_global_memory;
-                 pt->escaped = uses_global_memory;
+                 if (uses_global_memory)
+                   {
+                     pt->nonlocal = uses_global_memory;
+                     pt->escaped = uses_global_memory;
+                   }
                }
              else if (uses_global_memory)
                {
@@ -7572,17 +7573,18 @@ compute_points_to_sets (void)
              determine_global_memory_access (stmt, &writes_global_memory,
                                              NULL, NULL);

-             if (!writes_global_memory)
-               ;
-             else if ((vi = lookup_call_clobber_vi (stmt)) != NULL)
+             if ((vi = lookup_call_clobber_vi (stmt)) != NULL)
                {
                  *pt = find_what_var_points_to (cfun->decl, vi);
                  /* Escaped (and thus nonlocal) variables are always
                     implicitly clobbered by calls.  */
                  /* ???  ESCAPED can be empty even though NONLOCAL
                     always escaped.  */
-                 pt->nonlocal = writes_global_memory;
-                 pt->escaped = writes_global_memory;
+                 if (writes_global_memory)
+                   {
+                     pt->nonlocal = writes_global_memory;
+                     pt->escaped = writes_global_memory;
+                   }
                }
              else if (writes_global_memory)
                {

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

* [Bug tree-optimization/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2021-10-15 13:54 ` hubicka at gcc dot gnu.org
@ 2021-10-16 12:45 ` cvs-commit at gcc dot gnu.org
  2021-11-21 11:57 ` hubicka at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-10-16 12:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jan Hubicka <hubicka@gcc.gnu.org>:

https://gcc.gnu.org/g:99b287b8ef51a0be52f7400879a619dc5f993f31

commit r12-4457-g99b287b8ef51a0be52f7400879a619dc5f993f31
Author: Jan Hubicka <hubicka@ucw.cz>
Date:   Sat Oct 16 14:45:06 2021 +0200

    Fix wrong code in ldost-strlen-1.c

    gcc/ChangeLog:

            PR tree-optimization/102720
            * tree-ssa-structalias.c (compute_points_to_sets): Fix producing
            of call used and clobbered sets.

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

* [Bug tree-optimization/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324
  2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2021-10-16 12:45 ` [Bug tree-optimization/102720] " cvs-commit at gcc dot gnu.org
@ 2021-11-21 11:57 ` hubicka at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-11-21 11:57 UTC (permalink / raw)
  To: gcc-bugs

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

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

--- Comment #13 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2021-11-21 11:57 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-12 21:45 [Bug testsuite/102720] New: [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4234 seurer at gcc dot gnu.org
2021-10-13  2:16 ` [Bug testsuite/102720] " msebor at gcc dot gnu.org
2021-10-13  7:37 ` rguenth at gcc dot gnu.org
2021-10-13  7:38 ` [Bug tree-optimization/102720] [12 regression] gcc.dg/tree-ssa/ldist-strlen-1.c and ldist-strlen-2.c fail after r12-4324 rguenth at gcc dot gnu.org
2021-10-13 10:14 ` stefansf at linux dot ibm.com
2021-10-13 14:50 ` clyon at gcc dot gnu.org
2021-10-13 14:52 ` clyon at gcc dot gnu.org
2021-10-15 11:36 ` [Bug ipa/102720] " hubicka at gcc dot gnu.org
2021-10-15 12:21 ` hubicka at gcc dot gnu.org
2021-10-15 13:26 ` hubicka at gcc dot gnu.org
2021-10-15 13:28 ` hubicka at gcc dot gnu.org
2021-10-15 13:54 ` hubicka at gcc dot gnu.org
2021-10-16 12:45 ` [Bug tree-optimization/102720] " cvs-commit at gcc dot gnu.org
2021-11-21 11:57 ` hubicka 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).