public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67582] New: typeof(*p) * fails when p is void *
@ 2015-09-15  8:38 vegard.nossum at gmail dot com
  2015-09-15  9:47 ` [Bug c++/67582] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vegard.nossum at gmail dot com @ 2015-09-15  8:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67582
           Summary: typeof(*p) * fails when p is void *
           Product: gcc
           Version: 4.8.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vegard.nossum at gmail dot com
  Target Milestone: ---

$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

$ cat voidptr 
void foo(void *p)
{
        typeof(*p) *x;
}

I'd expect this to work as if 'x' was declared 'void *x' (which is legal). It
works in C, but not in C++:

$ gcc -x c -c - < voidptr && echo success
success

$ gcc -x c++ -c - < voidptr
<stdin>: In function ‘int foo(void*)’:
<stdin>:3:10: error: ‘void*’ is not a pointer-to-object type
<stdin>:3:15: error: invalid type in declaration before ‘;’ token
>From gcc-bugs-return-497226-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Sep 15 09:21:45 2015
Return-Path: <gcc-bugs-return-497226-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 96726 invoked by alias); 15 Sep 2015 09:21:44 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 96633 invoked by uid 48); 15 Sep 2015 09:21:40 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/67470] [5/6 Regression] ICE at -O3 on x86_64-linux-gnu in compute_live_loop_exits, at tree-ssa-loop-manip.c:235
Date: Tue, 15 Sep 2015 09:21:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-67470-4-Z9ZJTeSSZw@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67470-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67470-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01204.txt.bz2
Content-length: 676

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg470

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
g_40 = PHI <0B(9), &a(6)>
  invariant up to level 1, cost 21.

pretmp_42 = g_40 == 0B;
  invariant up to level 1, cost 22.

but we're only moving pretmp_42, not g_40.  The PHI is controlled by
if (f_16(D) != 0).  But when applying stmt movement we are faced with
g_40 = PHI <0B(9), &a(6)> turned into

<bb 11>:
# g_40 = PHI <0B(26), &a(21), &a(22), 0B(25)>

whoops.  That's because predicated store-motion already messed up the
CFG without ensuring we have forwarder blocks that at least preserve
the existing PHI node structure.

This is a latent issue.


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

end of thread, other threads:[~2015-09-15 14:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-15  8:38 [Bug c++/67582] New: typeof(*p) * fails when p is void * vegard.nossum at gmail dot com
2015-09-15  9:47 ` [Bug c++/67582] " redi at gcc dot gnu.org
2015-09-15  9:48 ` redi at gcc dot gnu.org
2015-09-15 10:28 ` vegard.nossum at gmail dot com
2015-09-15 11:53 ` redi at gcc dot gnu.org
2015-09-15 14:05 ` vegard.nossum at gmail dot com

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).