public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM
@ 2012-08-24  3:04 pinskia at gcc dot gnu.org
  2012-09-03 10:00 ` [Bug middle-end/54362] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-08-24  3:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54362

             Bug #: 54362
           Summary: COND_EXPR not understood by either alias or ITM
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pinskia@gcc.gnu.org


Take this slightly modified  gcc.dg/tm/memopt-12.c :

/* { dg-do compile } */
/* { dg-options "-fgnu-tm -O3 -fdump-tree-tmmark" } */

extern int test(void) __attribute__((transaction_safe));
extern void *malloc (__SIZE_TYPE__) __attribute__((malloc,transaction_safe));

struct large { int foo[500]; };

int f(int j)
{
  int *p1, *p2, *p3;

  p1 = malloc (sizeof (*p1)*5000);
  __transaction_atomic {
    _Bool t;
    int i = 1;
    *p1 = 0;

    p2 = malloc (sizeof (*p2)*6000);
    *p2 = 1;
    t = test();

    for (i = 0;i < j;i++)
    {

    /* p3 = PHI (p1, p2) */
    if (t)
      p3 = p1;
    else
      p3 = p2;

    /* Since both p1 and p2 are thread-private, we can inherit the
       logging already done.  No ITM_W* instrumentation necessary.  */
    *p3 = 555;
    }
  }
  return p3[something()];
}

/* { dg-final { scan-tree-dump-times "ITM_WU" 0 "tmmark" } } */
/* { dg-final { cleanup-tree-dump "tmmark" } } */

--- CUT ---

It currently fails because the aliasing code does not understand that p3 cannot
alias only local memory.

I found this while adding support to phiopt to convert some phi's into
COND_EXPR.


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

* [Bug middle-end/54362] COND_EXPR not understood by either alias or ITM
  2012-08-24  3:04 [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM pinskia at gcc dot gnu.org
@ 2012-09-03 10:00 ` rguenth at gcc dot gnu.org
  2012-09-03 13:24 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-03 10:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54362

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-09-03
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-03 10:00:00 UTC ---
Alias (points-to analysis) should handle

 p_1 = COND_EXPR <..., p_2, p_3>;

by computing p_1 = ... U p_2 U p_3 (yes, it unions the condition ...).

Mine for the PTA part.  I understand that the testcase doesn't fail right now
because it misses your patch.


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

* [Bug middle-end/54362] COND_EXPR not understood by either alias or ITM
  2012-08-24  3:04 [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM pinskia at gcc dot gnu.org
  2012-09-03 10:00 ` [Bug middle-end/54362] " rguenth at gcc dot gnu.org
@ 2012-09-03 13:24 ` rguenth at gcc dot gnu.org
  2012-09-03 13:26 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-03 13:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54362

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-03 13:24:13 UTC ---
Author: rguenth
Date: Mon Sep  3 13:24:07 2012
New Revision: 190889

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190889
Log:
2012-09-03  Richard Guenther  <rguenther@suse.de>

    PR tree-optimization/54362
    * tree-ssa-structalias.c (find_func_aliases): Handle COND_EXPR.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-ssa-structalias.c


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

* [Bug middle-end/54362] COND_EXPR not understood by either alias or ITM
  2012-08-24  3:04 [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM pinskia at gcc dot gnu.org
  2012-09-03 10:00 ` [Bug middle-end/54362] " rguenth at gcc dot gnu.org
  2012-09-03 13:24 ` rguenth at gcc dot gnu.org
@ 2012-09-03 13:26 ` rguenth at gcc dot gnu.org
  2012-09-04  0:34 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-09-03 13:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54362

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
         AssignedTo|rguenth at gcc dot gnu.org  |unassigned at gcc dot
                   |                            |gnu.org

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-09-03 13:26:22 UTC ---
PTA part fixed.


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

* [Bug middle-end/54362] COND_EXPR not understood by either alias or ITM
  2012-08-24  3:04 [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM pinskia at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-09-03 13:26 ` rguenth at gcc dot gnu.org
@ 2012-09-04  0:34 ` pinskia at gcc dot gnu.org
  2012-09-04  1:31 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-09-04  0:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54362

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |pinskia at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-09-04 00:33:47 UTC ---
I have the rest of the fix.


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

* [Bug middle-end/54362] COND_EXPR not understood by either alias or ITM
  2012-08-24  3:04 [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM pinskia at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-09-04  0:34 ` pinskia at gcc dot gnu.org
@ 2012-09-04  1:31 ` pinskia at gcc dot gnu.org
  2012-09-11  4:21 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-09-04  1:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54362

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-09-04 01:31:13 UTC ---
Created attachment 28128
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28128
Patch which I committed to Cavium's toolchain

This patch is what I am testing.  It applies without any conflicts (except in
the ChangeLog).


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

* [Bug middle-end/54362] COND_EXPR not understood by either alias or ITM
  2012-08-24  3:04 [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM pinskia at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-09-11  4:21 ` pinskia at gcc dot gnu.org
@ 2012-09-11  4:21 ` pinskia at gcc dot gnu.org
  2012-09-11  4:22 ` pinskia at gcc dot gnu.org
  2012-09-11  4:22 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-09-11  4:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54362

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-09-11 04:21:12 UTC ---
Author: pinskia
Date: Tue Sep 11 04:21:00 2012
New Revision: 191172

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191172
Log:
2012-09-10  Andrew Pinski  <apinski@cavium.com>

    PR tree-opt/54362
    * trans-mem.c (thread_private_new_memory): Handle COND_EXPR also.

2012-09-10  Andrew Pinski  <apinski@cavium.com>

    PR tree-opt/c54362
    * gcc.dg/tm/memopt-16.c: New testcase.


Added:
    trunk/gcc/testsuite/gcc.dg/tm/memopt-16.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/trans-mem.c


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

* [Bug middle-end/54362] COND_EXPR not understood by either alias or ITM
  2012-08-24  3:04 [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM pinskia at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-09-04  1:31 ` pinskia at gcc dot gnu.org
@ 2012-09-11  4:21 ` pinskia at gcc dot gnu.org
  2012-09-11  4:21 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-09-11  4:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54362

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-09-11 04:21:42 UTC ---
Author: pinskia
Date: Tue Sep 11 04:21:30 2012
New Revision: 191173

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191173
Log:
2012-09-10  Andrew Pinski  <apinski@cavium.com>

    PR tree-opt/54362
    * trans-mem.c (thread_private_new_memory): Handle COND_EXPR also.

2012-09-10  Andrew Pinski  <apinski@cavium.com>

    PR tree-opt/c54362
    * gcc.dg/tm/memopt-16.c: New testcase.


Modified:
    trunk/gcc/testsuite/ChangeLog


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

* [Bug middle-end/54362] COND_EXPR not understood by either alias or ITM
  2012-08-24  3:04 [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM pinskia at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2012-09-11  4:21 ` pinskia at gcc dot gnu.org
@ 2012-09-11  4:22 ` pinskia at gcc dot gnu.org
  2012-09-11  4:22 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-09-11  4:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54362

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-09-11 04:21:42 UTC ---
Author: pinskia
Date: Tue Sep 11 04:21:30 2012
New Revision: 191173

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191173
Log:
2012-09-10  Andrew Pinski  <apinski@cavium.com>

    PR tree-opt/54362
    * trans-mem.c (thread_private_new_memory): Handle COND_EXPR also.

2012-09-10  Andrew Pinski  <apinski@cavium.com>

    PR tree-opt/c54362
    * gcc.dg/tm/memopt-16.c: New testcase.


Modified:
    trunk/gcc/testsuite/ChangeLog

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-09-11 04:21:56 UTC ---
Fixed in 4.8 and above.


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

* [Bug middle-end/54362] COND_EXPR not understood by either alias or ITM
  2012-08-24  3:04 [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM pinskia at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2012-09-11  4:22 ` pinskia at gcc dot gnu.org
@ 2012-09-11  4:22 ` pinskia at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-09-11  4:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54362

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-09-11 04:21:56 UTC ---
Fixed in 4.8 and above.


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

end of thread, other threads:[~2012-09-11  4:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-24  3:04 [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM pinskia at gcc dot gnu.org
2012-09-03 10:00 ` [Bug middle-end/54362] " rguenth at gcc dot gnu.org
2012-09-03 13:24 ` rguenth at gcc dot gnu.org
2012-09-03 13:26 ` rguenth at gcc dot gnu.org
2012-09-04  0:34 ` pinskia at gcc dot gnu.org
2012-09-04  1:31 ` pinskia at gcc dot gnu.org
2012-09-11  4:21 ` pinskia at gcc dot gnu.org
2012-09-11  4:21 ` pinskia at gcc dot gnu.org
2012-09-11  4:22 ` pinskia at gcc dot gnu.org
2012-09-11  4:22 ` pinskia 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).