public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/63543] New: incomplete type error should suppress duplicates
@ 2014-10-15  9:47 andi-gcc at firstfloor dot org
  2014-10-15  9:50 ` [Bug c/63543] " mpolacek at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: andi-gcc at firstfloor dot org @ 2014-10-15  9:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63543
           Summary: incomplete type error should suppress duplicates
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andi-gcc at firstfloor dot org

For a test case like this

struct undefined;

int f(struct undefined *f)
{
    int x = f->a;
    return x + f->a + f->b;
}

tmissing-type.c: In function 'f':
tmissing-type.c:5:11: error: dereferencing pointer to incomplete type
  int x = f->a;
           ^
tmissing-type.c:6:14: error: dereferencing pointer to incomplete type
  return x + f->a + f->b;
              ^
tmissing-type.c:6:21: error: dereferencing pointer to incomplete type
  return x + f->a + f->b;


gcc outputs three different errors for each reference of the undefined type.
It would be better if it remembered that it already gave an error for
referencing that type and suppress the later errors (similar to undefined
symbols). This would avoid cascading errors.


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

* [Bug c/63543] incomplete type error should suppress duplicates
  2014-10-15  9:47 [Bug c/63543] New: incomplete type error should suppress duplicates andi-gcc at firstfloor dot org
@ 2014-10-15  9:50 ` mpolacek at gcc dot gnu.org
  2014-10-15 10:00 ` manu at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-10-15  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-10-15
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |5.0
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Yeah.


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

* [Bug c/63543] incomplete type error should suppress duplicates
  2014-10-15  9:47 [Bug c/63543] New: incomplete type error should suppress duplicates andi-gcc at firstfloor dot org
  2014-10-15  9:50 ` [Bug c/63543] " mpolacek at gcc dot gnu.org
@ 2014-10-15 10:00 ` manu at gcc dot gnu.org
  2014-10-15 14:47 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: manu at gcc dot gnu.org @ 2014-10-15 10:00 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 11121 bytes --]

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

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

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

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
It would also be nice to mention the type.

test.c:6:12: error: incomplete definition of type 'struct undefined'
  int x = f->a;
          ~^
test.c:2:8: note: forward declaration of 'struct undefined'
struct undefined;
       ^
>From gcc-bugs-return-464115-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 15 10:08:14 2014
Return-Path: <gcc-bugs-return-464115-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 26741 invoked by alias); 15 Oct 2014 10:08:14 -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 26697 invoked by uid 48); 15 Oct 2014 10:08:09 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/63543] incomplete type error should suppress duplicates
Date: Wed, 15 Oct 2014 10:08: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.9.2
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
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: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: keywords
Message-ID: <bug-63543-4-lIF0rGh3mR@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63543-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63543-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/msg01136.txt.bz2
Content-length: 687

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
The C++ FE prints:

test.c:6:12: error: invalid use of incomplete type ‘struct undefined’
   int x = f->a;
            ^
test.c:2:8: note: forward declaration of ‘struct undefined’
 struct undefined;
        ^

but it also prints it three times.
>From gcc-bugs-return-464116-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 15 10:11:20 2014
Return-Path: <gcc-bugs-return-464116-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 315 invoked by alias); 15 Oct 2014 10:11:20 -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 32733 invoked by uid 48); 15 Oct 2014 10:11:16 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug go/59432] [4.9/5 regression] sync/atomic FAILs on 32bit x86 systems without .cfi directives
Date: Wed, 15 Oct 2014 10:11:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: go
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P5
X-Bugzilla-Assigned-To: ubizjak at gmail dot com
X-Bugzilla-Target-Milestone: 4.9.2
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status assigned_to attachments.created
Message-ID: <bug-59432-4-uvs2pIMc2f@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59432-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59432-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/msg01137.txt.bz2
Content-length: 1006

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|ian at airs dot com                |ubizjak at gmail dot com

--- Comment #12 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 33719
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33719&action=edit
Patch to enable unconditional use of %ebx in
atomic_compare_and_swap<dwi>_doubleword pattern

Patch in testing.

Now that %ebx is not fixed anymore, we can always use it and avoid all PIC
related complications in atomic_compare_and_swap<dwi>_doubleword pattern.

Attached patch fixes sync/atomic on CentOS 5 and doesn't regress in Fedora 20.

The patch in effect reverts Ian's patch at [1].

[1] https://gcc.gnu.org/ml/gcc-patches/2013-11/msg00309.html
>From gcc-bugs-return-464117-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 15 10:16:26 2014
Return-Path: <gcc-bugs-return-464117-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4083 invoked by alias); 15 Oct 2014 10:16:25 -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 4049 invoked by uid 48); 15 Oct 2014 10:16:22 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug go/59432] [4.9/5 regression] sync/atomic FAILs on 32bit x86 systems without .cfi directives
Date: Wed, 15 Oct 2014 10:16:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: go
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P5
X-Bugzilla-Assigned-To: ubizjak at gmail dot com
X-Bugzilla-Target-Milestone: 4.9.2
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created
Message-ID: <bug-59432-4-QU8ec3EaDb@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59432-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59432-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/msg01138.txt.bz2
Content-length: 561

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #33719|0                           |1
        is obsolete|                            |

--- Comment #13 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 33720
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33720&action=edit
Updated patch.

The correct version of the patch.
>From gcc-bugs-return-464118-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Oct 15 11:28:50 2014
Return-Path: <gcc-bugs-return-464118-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20465 invoked by alias); 15 Oct 2014 11:28:49 -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 20420 invoked by uid 48); 15 Oct 2014 11:28:45 -0000
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/53513] [SH] Add support for fschg and fpchg insns and improve fenv support
Date: Wed, 15 Oct 2014 11:28:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: olegendo 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: attachments.isobsolete attachments.created
Message-ID: <bug-53513-4-s9XGB7IXNN@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-53513-4@http.gcc.gnu.org/bugzilla/>
References: <bug-53513-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/msg01139.txt.bz2
Content-length: 959

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

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #33717|0                           |1
        is obsolete|                            |

--- Comment #27 from Oleg Endo <olegendo at gcc dot gnu.org> ---
Created attachment 33721
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id3721&actioníit
Using virtual FPSCR registers to model insn dependencies

Updated patch that avoids the single_set problems by using (clobber (reg:SI
FPSCR_STAT_REG)) instead of a set.  This also eliminates the fsca pattern
changes in the previous patch.  Since the 'fpu_switch' insn is still a multiple
set insn, it won't be used for delay slot stuffing, but this is a minor issue
that can be addressed later.  I'm testing the patch now on sh-sim.  At least
'make all' works.


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

* [Bug c/63543] incomplete type error should suppress duplicates
  2014-10-15  9:47 [Bug c/63543] New: incomplete type error should suppress duplicates andi-gcc at firstfloor dot org
  2014-10-15  9:50 ` [Bug c/63543] " mpolacek at gcc dot gnu.org
  2014-10-15 10:00 ` manu at gcc dot gnu.org
@ 2014-10-15 14:47 ` mpolacek at gcc dot gnu.org
  2014-10-17 18:54 ` mpolacek at gcc dot gnu.org
  2014-10-17 19:12 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-10-15 14:47 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Testing a fix.


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

* [Bug c/63543] incomplete type error should suppress duplicates
  2014-10-15  9:47 [Bug c/63543] New: incomplete type error should suppress duplicates andi-gcc at firstfloor dot org
                   ` (2 preceding siblings ...)
  2014-10-15 14:47 ` mpolacek at gcc dot gnu.org
@ 2014-10-17 18:54 ` mpolacek at gcc dot gnu.org
  2014-10-17 19:12 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-10-17 18:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Fri Oct 17 18:53:35 2014
New Revision: 216414

URL: https://gcc.gnu.org/viewcvs?rev=216414&root=gcc&view=rev
Log:
    PR c/63543
    * c-tree.h (C_TYPE_ERROR_REPORTED): Define.
    * c-typeck.c (build_indirect_ref): Don't print the "dereferencing..."
    error multiple times.  Print the type.

    * gcc.dg/pr63543.c: New test.
    * gcc.dg/array-8.c: Remove dg-error.
    * gcc.dg/pr48552-1.c: Remove and adjust dg-error.
    * gcc.dg/pr48552-2.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/pr63543.c
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-tree.h
    trunk/gcc/c/c-typeck.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/array-8.c
    trunk/gcc/testsuite/gcc.dg/pr48552-1.c
    trunk/gcc/testsuite/gcc.dg/pr48552-2.c


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

* [Bug c/63543] incomplete type error should suppress duplicates
  2014-10-15  9:47 [Bug c/63543] New: incomplete type error should suppress duplicates andi-gcc at firstfloor dot org
                   ` (3 preceding siblings ...)
  2014-10-17 18:54 ` mpolacek at gcc dot gnu.org
@ 2014-10-17 19:12 ` mpolacek at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-10-17 19:12 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

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

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.


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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-15  9:47 [Bug c/63543] New: incomplete type error should suppress duplicates andi-gcc at firstfloor dot org
2014-10-15  9:50 ` [Bug c/63543] " mpolacek at gcc dot gnu.org
2014-10-15 10:00 ` manu at gcc dot gnu.org
2014-10-15 14:47 ` mpolacek at gcc dot gnu.org
2014-10-17 18:54 ` mpolacek at gcc dot gnu.org
2014-10-17 19:12 ` mpolacek 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).