public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/63421] New: GCC generates a very misleading warning when looking at an erroneously-overloaded type
@ 2014-10-01  0:48 gccbugs at dima dot secretsauce.net
  2014-10-01 12:56 ` [Bug c/63421] " manu at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: gccbugs at dima dot secretsauce.net @ 2014-10-01  0:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63421
           Summary: GCC generates a very misleading warning when looking
                    at an erroneously-overloaded type
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gccbugs at dima dot secretsauce.net

Hi. I'm running gcc-4.9.1 from Debian/sid. This is built off of r214759. When
building source that had a mistake GCC produced a very misleading warning that
masked the underlying issue. A minimized test case:

typedef struct
{
    int x, y, z;
} S;

struct S
{
    int x;
};

S s;

void g(struct S *);

void f()
{
    g(&s);
}


Here the error is that S is defined both as a struct and a typedef struct. g()
expects a 'struct S *', but I'm giving it a S*. When gcc builds this I see:

dima@shorty:/tmp/recorder$ /usr/bin/gcc-4.9 -g -O0 -Wall -Wextra -std=gnu99 -I.
 -c -o dbtest.o dbtest.c
dbtest.c: In function 'f':
dbtest.c:17:5: warning: passing argument 1 of 'g' from incompatible pointer
type
     g(&s);
     ^
dbtest.c:13:6: note: expected 'struct S *' but argument is of type 'struct S *'
 void g(struct S *);
      ^

So it tells me that the function is getting a type mismatch, but it says that
both what it wants and what it got was 'struct S *'. This makes the complaint
look redundant.


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

* [Bug c/63421] GCC generates a very misleading warning when looking at an erroneously-overloaded type
  2014-10-01  0:48 [Bug c/63421] New: GCC generates a very misleading warning when looking at an erroneously-overloaded type gccbugs at dima dot secretsauce.net
@ 2014-10-01 12:56 ` manu at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: manu at gcc dot gnu.org @ 2014-10-01 12:56 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |manu at gcc dot gnu.org
         Resolution|---                         |DUPLICATE

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Duplicate. There is a bug in the pretty-printer and also we should do typedef
unwrapping in the C FE.

*** This bug has been marked as a duplicate of bug 56980 ***
>From gcc-bugs-return-463018-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 01 12:56:58 2014
Return-Path: <gcc-bugs-return-463018-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19135 invoked by alias); 1 Oct 2014 12:56:58 -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 19086 invoked by uid 48); 1 Oct 2014 12:56:54 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/63422] [5.0 Regression] ICE in freqs_to_counts_path, at tree-ssa-threadupdate.c:981
Date: Wed, 01 Oct 2014 12:56:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels 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-Flags:
X-Bugzilla-Changed-Fields: cc attachments.created
Message-ID: <bug-63422-4-WlvkDH2ioB@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63422-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63422-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-10/txt/msg00039.txt.bz2
Content-length: 1939

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |trippels at gcc dot gnu.org

--- Comment #4 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Created attachment 33636
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33636&action=edit
testcase

Here is a relative small testcase:

markus@x4 /tmp % g++ -flto -fprofile-use -fno-exceptions -std=gnu++0x -O2
mozilla-xremote-client.ii XRemoteClient.ii
/var/tmp/mozilla-central/widget/xremoteclient/mozilla-xremote-client.cpp: In
function ‘main’:
/var/tmp/mozilla-central/widget/xremoteclient/mozilla-xremote-client.cpp:16:5:
internal compiler error: in freqs_to_counts_path, at
tree-ssa-threadupdate.c:988
 int main(int argc, char **argv)
     ^
0xb00cf0 freqs_to_counts_path
        ../../gcc/gcc/tree-ssa-threadupdate.c:988
0xb00cf0 ssa_fix_duplicate_block_edges(redirection_data*, ssa_local_info_t*)
        ../../gcc/gcc/tree-ssa-threadupdate.c:1061
0xb02260 ssa_fixup_template_block
        ../../gcc/gcc/tree-ssa-threadupdate.c:1301
0xb02260 traverse_noresize<ssa_local_info_t*, ssa_fixup_template_block>
        ../../gcc/gcc/hash-table.h:942
0xb02260 traverse<ssa_local_info_t*, ssa_fixup_template_block>
        ../../gcc/gcc/hash-table.h:964
0xb02260 thread_block_1
        ../../gcc/gcc/tree-ssa-threadupdate.c:1523
0xb02994 thread_block
        ../../gcc/gcc/tree-ssa-threadupdate.c:1560
0xb031dd thread_through_all_blocks(bool)
        ../../gcc/gcc/tree-ssa-threadupdate.c:2279
0xb856a1 finalize_jump_threads
        ../../gcc/gcc/tree-vrp.c:9856
0xb856a1 execute_vrp
        ../../gcc/gcc/tree-vrp.c:10010
0xb856a1 execute
        ../../gcc/gcc/tree-vrp.c:10073
Please submit a full bug report,
>From gcc-bugs-return-463017-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 01 12:56:06 2014
Return-Path: <gcc-bugs-return-463017-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16737 invoked by alias); 1 Oct 2014 12:56:05 -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 16092 invoked by uid 48); 1 Oct 2014 12:55:57 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/56980] C pretty-printer does not handle well pointer to typedef of struct
Date: Wed, 01 Oct 2014 12:56:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-56980-4-frnNzrVHJa@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56980-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56980-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-10/txt/msg00038.txt.bz2
Content-length: 544

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gccbugs at dima dot secretsauce.ne
                   |                            |t

--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
*** Bug 63421 has been marked as a duplicate of this bug. ***
>From gcc-bugs-return-463019-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 01 13:09:49 2014
Return-Path: <gcc-bugs-return-463019-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28913 invoked by alias); 1 Oct 2014 13:09:48 -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 28852 invoked by uid 55); 1 Oct 2014 13:09:42 -0000
From: "joseph at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/59805] invalid preprocessing directive not diagnosed with assembler-with-cpp
Date: Wed, 01 Oct 2014 13:09:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: preprocessor
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: joseph at codesourcery dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59805-4-8vqfIaOPQx@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59805-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59805-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: 2014-10/txt/msg00040.txt.bz2
Content-length: 337

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

--- Comment #2 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
If there's something in the preprocessor that does this deliberately for
assembler-with-cpp instead of being an accidental consequence of something
else, then it's probably working as designed.


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

end of thread, other threads:[~2014-10-01 12:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-01  0:48 [Bug c/63421] New: GCC generates a very misleading warning when looking at an erroneously-overloaded type gccbugs at dima dot secretsauce.net
2014-10-01 12:56 ` [Bug c/63421] " manu 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).