public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/57021] Better error message for * missing an expression or rather using a non-type as a cast
  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 ` pinskia at gcc dot gnu.org
  2013-04-21 12:57 ` manu at gcc dot gnu.org
  1 sibling, 0 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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
           Severity|normal                      |enhancement

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-04-21 07:21:42 UTC ---
Note I created this bug after reading PR 57020.


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

* [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

* [Bug c/57021] Better error message for * missing an expression or rather using a non-type as a cast
  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
  1 sibling, 0 replies; 3+ messages in thread
From: manu at gcc dot gnu.org @ 2013-04-21 12:57 UTC (permalink / raw)
  To: gcc-bugs


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

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> 2013-04-21 12:57:45 UTC ---
(In reply to comment #0)
> 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.

I think that would be difficult, since by the time ")" is parsed, we are
already assuming that this is a binary expression. 

Nonetheless, I don't see why it is better to assume that "a" is a type than to
assume that the user wanted to type "(a * 0)".
>From gcc-bugs-return-420691-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Apr 21 12:59:02 2013
Return-Path: <gcc-bugs-return-420691-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 31143 invoked by alias); 21 Apr 2013 12:59:01 -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 31122 invoked by uid 48); 21 Apr 2013 12:58:59 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/57020] error:=?UTF-8?Q? expected expression before ‘?=)=?UTF-8?Q?’ token?Date: Sun, 21 Apr 2013 12:59: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-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: WAITING
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields: Status Last reconfirmed CC Ever Confirmed
Message-ID: <bug-57020-4-ZeLMvbI8U2@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57020-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57020-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/msg01836.txt.bz2
Content-length: 680


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2013-04-21
                 CC|                            |manu at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2013-04-21 12:58:59 UTC ---
Please provide a minimal self-contained testcase showing the problem.
>From gcc-bugs-return-420692-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Apr 21 13:00:40 2013
Return-Path: <gcc-bugs-return-420692-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 32416 invoked by alias); 21 Apr 2013 13:00:39 -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 32385 invoked by uid 48); 21 Apr 2013 13:00:37 -0000
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57023] [4.7/4.8/4.9 Regression] Not packing arrays with changing variable used for size
Date: Sun, 21 Apr 2013 13:00: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: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dominiq at lps dot ens.fr
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: Status Last reconfirmed Ever Confirmed
Message-ID: <bug-57023-4-zcY2CMrjDV@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57023-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57023-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/msg01837.txt.bz2
Content-length: 1066


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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-04-21
     Ever Confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2013-04-21 13:00:36 UTC ---
Revision 162456 (2010-07-23) is OK, but not revision 1635293 (2010-08-24). The
test gives the correct result with the following change

--- pr57023.f90    2013-04-21 13:15:55.000000000 +0200
+++ pr57023_db.f90    2013-04-21 14:11:58.000000000 +0200
@@ -2,9 +2,9 @@ module mymod
 contains
   subroutine foo(a,n)
     integer, dimension(n,n), intent(inout) :: a
-    integer :: n
-    n = n - 1
-    call baz(a(1:n,1:n),n)
+    integer :: m, n
+    m = n - 1
+    call baz(a(1:m,1:m),m)
   end subroutine foo

   subroutine baz(a,n)


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