From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13434 invoked by alias); 24 Aug 2012 03:04:45 -0000 Received: (qmail 13421 invoked by uid 22791); 24 Aug 2012 03:04:44 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Aug 2012 03:04:32 +0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/54362] New: COND_EXPR not understood by either alias or ITM Date: Fri, 24 Aug 2012 03:04:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-08/txt/msg01650.txt.bz2 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.