public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/57021] New: Better error message for * missing an expression or rather using a non-type as a cast
@ 2013-04-21  7:21 pinskia at gcc dot gnu.org
  2013-04-21  7:21 ` [Bug c/57021] " pinskia at gcc dot gnu.org
  2013-04-21 12:57 ` manu at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-04-21  7:21 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57021
           Summary: Better error message for * missing an expression or
                    rather using a non-type as a cast
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pinskia@gcc.gnu.org


Take:
int main(void)
{
  int a;
  (a*)0;
}
---- CUT ---
Right now we produce:
t.c:4:6: error: expected expression before ‘)’ token
   (a*)0;
      ^
or for C++:
t.c:4:6: error: expected primary-expression before ‘)’ token
   (a*)0;
      ^
t.c:4:7: error: expected ‘;’ before numeric constant
   (a*)0;
       ^
---- CUT ----
Really we should say instead a is not a type.  Yes this is a complex error
recovery issue but I think we should be able to figure it out.
>From gcc-bugs-return-420676-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Apr 21 08:01:13 2013
Return-Path: <gcc-bugs-return-420676-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1456 invoked by alias); 21 Apr 2013 08:01:13 -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 1347 invoked by uid 48); 21 Apr 2013 08:01:08 -0000
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57019] [4.7/4.8/4.9 Regression] Compiler crashes (and make wrong assignments) at some combinations of pointers
Date: Sun, 21 Apr 2013 08:01:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: janus 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-Changed-Fields: Keywords Status Last reconfirmed CC Summary Ever Confirmed
Message-ID: <bug-57019-4-XmNaNLbvsW@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57019-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57019-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg01821.txt.bz2
Content-length: 2413


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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-04-21
                 CC|                            |janus at gcc dot gnu.org
            Summary|Compiler crashes (and make  |[4.7/4.8/4.9 Regression]
                   |wrong assignments) at some  |Compiler crashes (and make
                   |combinations of pointers    |wrong assignments) at some
                   |                            |combinations of pointers
     Ever Confirmed|0                           |1

--- Comment #2 from janus at gcc dot gnu.org 2013-04-21 08:01:07 UTC ---
(In reply to comment #0)
> and we have
> ~/src gfortran -Wall bug.f95
> data_types.f95: In function ‘MAIN__’:
> data_types.f95:19: internal compiler error: Ошибка сегментирования

This part I can reproduce. I have reduced it as much as I could:

type pCItem
    integer :: Ele
end type
type(pCItem), target, dimension(1:2,1:2) :: pCellArray
integer, pointer, dimension(:,:) :: pArray
integer, pointer :: p_pointer
pArray => pCellArray%Ele
p_pointer => pArray(1,1)
end

This gives the ICE

internal compiler error: Segmentation fault
 type pCItem
 ^
0x89099f crash_signal
        /home/janus/gcc49/trunk/gcc/toplev.c:332
0x5c6f8a gfc_get_symbol_decl(gfc_symbol*)
        /home/janus/gcc49/trunk/gcc/fortran/trans-decl.c:1464
0x5c733f generate_local_decl
        /home/janus/gcc49/trunk/gcc/fortran/trans-decl.c:4652
0x5965b3 do_traverse_symtree
        /home/janus/gcc49/trunk/gcc/fortran/symbol.c:3571
0x5c929a generate_local_vars
        /home/janus/gcc49/trunk/gcc/fortran/trans-decl.c:4811
0x5c929a gfc_generate_function_code(gfc_namespace*)
        /home/janus/gcc49/trunk/gcc/fortran/trans-decl.c:5385


with 4.7, 4.8 and trunk at least, but works with 4.3. So it seems to be a
regression introduced in 4.4. Thanks for reporting!

About the second part, I'm not fully sure how to reproduce it. Can you give a
full self-contained code example instead of describing it in words?
>From gcc-bugs-return-420677-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Apr 21 08:52:42 2013
Return-Path: <gcc-bugs-return-420677-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24582 invoked by alias); 21 Apr 2013 08:52:42 -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 24536 invoked by uid 48); 21 Apr 2013 08:52:37 -0000
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57019] [4.7/4.8/4.9 Regression] Compiler crashes (and make wrong assignments) at some combinations of pointers
Date: Sun, 21 Apr 2013 08:52:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: janus 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-Changed-Fields: CC
Message-ID: <bug-57019-4-URqtHFpFa9@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57019-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57019-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg01822.txt.bz2
Content-length: 645


http://gcc.gnu.org/bugzilla/show_bug.cgi?idW019

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com

--- Comment #3 from janus at gcc dot gnu.org 2013-04-21 08:52:36 UTC ---
(In reply to comment #2)
>         /home/janus/gcc49/trunk/gcc/fortran/trans-decl.c:1464


For this line, svn blame reports the following commit (which is quite likely
the origin of the regression):

http://gcc.gnu.org/viewcvs/gcc?view=revision&revision\x139782


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

end of thread, other threads:[~2013-04-21 12:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-21  7:21 [Bug c/57021] New: Better error message for * missing an expression or rather using a non-type as a cast pinskia at gcc dot gnu.org
2013-04-21  7:21 ` [Bug c/57021] " pinskia at gcc dot gnu.org
2013-04-21 12:57 ` 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).