public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52290] New: internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712
@ 2012-02-16 23:51 cas43 at cs dot stanford.edu
  2012-02-20 12:24 ` [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: cas43 at cs dot stanford.edu @ 2012-02-16 23:51 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52290
           Summary: internal compiler error: tree check: expected
                    function_decl, have var_decl in start_function, at
                    c-decl.c:7712
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: cas43@cs.stanford.edu


Triggered by the (invalid) C source:
int f()[j]

Diagnostic:
2.c:1:9: error: ‘j’ undeclared here (not in a function)
2.c:1:1: internal compiler error: tree check: expected function_decl, have
var_decl in start_function, at c-decl.c:7712
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Compiler version:
Using built-in specs.
COLLECT_GCC=/new-gcc/i-4.7/bin/gcc
COLLECT_LTO_WRAPPER=/new-gcc/i-4.7/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../s-4.7/configure --prefix=/new-gcc/i-4.7
Thread model: posix
gcc version 4.7.0 20120216 (experimental) (GCC)


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

* [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712
  2012-02-16 23:51 [Bug c/52290] New: internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712 cas43 at cs dot stanford.edu
@ 2012-02-20 12:24 ` rguenth at gcc dot gnu.org
  2012-02-22 10:11 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-20 12:24 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |4.0.4
           Keywords|                            |error-recovery,
                   |                            |ice-on-invalid-code
   Last reconfirmed|                            |2012-02-20
     Ever Confirmed|0                           |1
            Summary|internal compiler error:    |[4.4/4.5/4.6/4.7
                   |tree check: expected        |Regression] internal
                   |function_decl, have         |compiler error: tree check:
                   |var_decl in start_function, |expected function_decl,
                   |at c-decl.c:7712            |have var_decl in
                   |                            |start_function, at
                   |                            |c-decl.c:7712
   Target Milestone|---                         |4.4.7
      Known to fail|                            |4.1.0

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-20 12:17:27 UTC ---
Confirmed.  Regression from 4.0.


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

* [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712
  2012-02-16 23:51 [Bug c/52290] New: internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712 cas43 at cs dot stanford.edu
  2012-02-20 12:24 ` [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
@ 2012-02-22 10:11 ` jakub at gcc dot gnu.org
  2012-02-22 23:38 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-02-22 10:11 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
                 CC|                            |jakub at gcc dot gnu.org


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

* [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712
  2012-02-16 23:51 [Bug c/52290] New: internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712 cas43 at cs dot stanford.edu
  2012-02-20 12:24 ` [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
  2012-02-22 10:11 ` jakub at gcc dot gnu.org
@ 2012-02-22 23:38 ` ubizjak at gmail dot com
  2012-02-23 16:42 ` uros at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2012-02-22 23:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Uros Bizjak <ubizjak at gmail dot com> 2012-02-22 23:24:07 UTC ---
How about:

Index: c-decl.c
===================================================================
--- c-decl.c    (revision 184492)
+++ c-decl.c    (working copy)
@@ -7702,7 +7702,8 @@ start_function (struct c_declspecs *declspecs, str

   /* If the declarator is not suitable for a function definition,
      cause a syntax error.  */
-  if (decl1 == 0)
+  if (decl1 == 0
+      || TREE_CODE (decl1) != FUNCTION_DECL)
     return 0;

   loc = DECL_SOURCE_LOCATION (decl1);


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

* [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712
  2012-02-16 23:51 [Bug c/52290] New: internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712 cas43 at cs dot stanford.edu
                   ` (2 preceding siblings ...)
  2012-02-22 23:38 ` ubizjak at gmail dot com
@ 2012-02-23 16:42 ` uros at gcc dot gnu.org
  2012-02-23 17:43 ` uros at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: uros at gcc dot gnu.org @ 2012-02-23 16:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from uros at gcc dot gnu.org 2012-02-23 16:34:15 UTC ---
Author: uros
Date: Thu Feb 23 16:34:02 2012
New Revision: 184511

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184511
Log:
    PR c/52290
    * c-decl.c (start_function): Exit early if decl1 is not FUNTION_DECL.

testsuite/ChangeLog:

    PR c/52290
    * gcc.dg/noncompile/pr52290.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/noncompile/pr52290.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-decl.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712
  2012-02-16 23:51 [Bug c/52290] New: internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712 cas43 at cs dot stanford.edu
                   ` (3 preceding siblings ...)
  2012-02-23 16:42 ` uros at gcc dot gnu.org
@ 2012-02-23 17:43 ` uros at gcc dot gnu.org
  2012-02-23 18:04 ` uros at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: uros at gcc dot gnu.org @ 2012-02-23 17:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from uros at gcc dot gnu.org 2012-02-23 17:38:20 UTC ---
Author: uros
Date: Thu Feb 23 17:38:13 2012
New Revision: 184514

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184514
Log:
    PR c/52290
    * c-decl.c (start_function): Exit early if decl1 is not FUNTION_DECL.

testsuite/ChangeLog:

    PR c/52290
    * gcc.dg/noncompile/pr52290.c: New test.


Added:
    branches/gcc-4_6-branch/gcc/testsuite/gcc.dg/noncompile/pr52290.c
      - copied unchanged from r184511,
trunk/gcc/testsuite/gcc.dg/noncompile/pr52290.c
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/c-decl.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712
  2012-02-16 23:51 [Bug c/52290] New: internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712 cas43 at cs dot stanford.edu
                   ` (4 preceding siblings ...)
  2012-02-23 17:43 ` uros at gcc dot gnu.org
@ 2012-02-23 18:04 ` uros at gcc dot gnu.org
  2012-02-23 18:05 ` uros at gcc dot gnu.org
  2012-02-23 18:07 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: uros at gcc dot gnu.org @ 2012-02-23 18:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from uros at gcc dot gnu.org 2012-02-23 18:01:54 UTC ---
Author: uros
Date: Thu Feb 23 18:01:45 2012
New Revision: 184517

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184517
Log:
    PR c/52290
    * c-decl.c (start_function): Exit early if decl1 is not FUNTION_DECL.

testsuite/ChangeLog:

    PR c/52290
    * gcc.dg/noncompile/pr52290.c: New test.


Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/noncompile/pr52290.c
      - copied unchanged from r184511,
trunk/gcc/testsuite/gcc.dg/noncompile/pr52290.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/c-decl.c
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog


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

* [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712
  2012-02-16 23:51 [Bug c/52290] New: internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712 cas43 at cs dot stanford.edu
                   ` (5 preceding siblings ...)
  2012-02-23 18:04 ` uros at gcc dot gnu.org
@ 2012-02-23 18:05 ` uros at gcc dot gnu.org
  2012-02-23 18:07 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: uros at gcc dot gnu.org @ 2012-02-23 18:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from uros at gcc dot gnu.org 2012-02-23 18:03:47 UTC ---
Author: uros
Date: Thu Feb 23 18:03:33 2012
New Revision: 184518

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184518
Log:
    PR c/52290
    * c-decl.c (start_function): Exit early if decl1 is not FUNTION_DECL.

testsuite/ChangeLog:

    PR c/52290
    * gcc.dg/noncompile/pr52290.c: New test.


Added:
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/noncompile/pr52290.c
      - copied unchanged from r184511,
trunk/gcc/testsuite/gcc.dg/noncompile/pr52290.c
Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/c-decl.c
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


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

* [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712
  2012-02-16 23:51 [Bug c/52290] New: internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712 cas43 at cs dot stanford.edu
                   ` (6 preceding siblings ...)
  2012-02-23 18:05 ` uros at gcc dot gnu.org
@ 2012-02-23 18:07 ` ubizjak at gmail dot com
  7 siblings, 0 replies; 9+ messages in thread
From: ubizjak at gmail dot com @ 2012-02-23 18:07 UTC (permalink / raw)
  To: gcc-bugs

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

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2012-02/msg01168.htm
                   |                            |l
         Resolution|                            |FIXED
         AssignedTo|unassigned at gcc dot       |ubizjak at gmail dot com
                   |gnu.org                     |

--- Comment #7 from Uros Bizjak <ubizjak at gmail dot com> 2012-02-23 18:05:34 UTC ---
Fixed everywhere.


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

end of thread, other threads:[~2012-02-23 18:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16 23:51 [Bug c/52290] New: internal compiler error: tree check: expected function_decl, have var_decl in start_function, at c-decl.c:7712 cas43 at cs dot stanford.edu
2012-02-20 12:24 ` [Bug c/52290] [4.4/4.5/4.6/4.7 Regression] " rguenth at gcc dot gnu.org
2012-02-22 10:11 ` jakub at gcc dot gnu.org
2012-02-22 23:38 ` ubizjak at gmail dot com
2012-02-23 16:42 ` uros at gcc dot gnu.org
2012-02-23 17:43 ` uros at gcc dot gnu.org
2012-02-23 18:04 ` uros at gcc dot gnu.org
2012-02-23 18:05 ` uros at gcc dot gnu.org
2012-02-23 18:07 ` ubizjak 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).