public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/64766] New: internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122
@ 2015-01-24 10:22 mpolacek at gcc dot gnu.org
  2015-01-26 11:31 ` [Bug middle-end/64766] [4.8/4.9/5 Regression] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-01-24 10:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64766
           Summary: internal compiler error: tree check: expected block,
                    have error_mark in lower_function_body, at
                    gimple-low.c:122
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org

./cc1 -quiet ice1.c
ice1.c:6:1: error: function ‘fn1’ is initialized like a variable
 void fn1 () =
 ^
ice1.c:6:1: error: expected expression at end of input
ice1.c: In function ‘fn1’:
ice1.c:2:1: internal compiler error: tree check: expected block, have
error_mark in lower_function_body, at gimple-low.c:122
 fn1 ()
 ^
0xface14 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
    /home/marek/src/gcc/gcc/tree.c:9290
0x14f37fb tree_check
    /home/marek/src/gcc/gcc/tree.h:2846
0x14f37fb lower_function_body
    /home/marek/src/gcc/gcc/gimple-low.c:122
0x14f37fb execute
    /home/marek/src/gcc/gcc/gimple-low.c:205
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

void
fn1 ()
{
}

void fn1 () =
>From gcc-bugs-return-474680-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jan 24 10:23:24 2015
Return-Path: <gcc-bugs-return-474680-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 1274 invoked by alias); 24 Jan 2015 10:23:23 -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 1179 invoked by uid 48); 24 Jan 2015 10:23:19 -0000
From: "ulfalizer at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/64767] New: Could GCC warn when a pointer is compared against '\0'?
Date: Sat, 24 Jan 2015 10:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: ulfalizer at gmail 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-64767-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: 2015-01/txt/msg02674.txt.bz2
Content-length: 759

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

            Bug ID: 64767
           Summary: Could GCC warn when a pointer is compared against
                    '\0'?
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ulfalizer at gmail dot com

This would detect e.g. ptr == '\0' when *ptr == '\0' was intended, which could
be very dangerous (and just bit me).

This might be tricky to implement in C since '\0' has type int and comparing a
pointer against 0 is common. In C++ it has type char, so maybe a warning could
be generated for ptr == (char)0 there.

Thoughts?


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

* [Bug middle-end/64766] [4.8/4.9/5 Regression] internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122
  2015-01-24 10:22 [Bug middle-end/64766] New: internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122 mpolacek at gcc dot gnu.org
@ 2015-01-26 11:31 ` rguenth at gcc dot gnu.org
  2015-01-27  8:14 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-01-26 11:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery
           Priority|P3                          |P4


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

* [Bug middle-end/64766] [4.8/4.9/5 Regression] internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122
  2015-01-24 10:22 [Bug middle-end/64766] New: internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122 mpolacek at gcc dot gnu.org
  2015-01-26 11:31 ` [Bug middle-end/64766] [4.8/4.9/5 Regression] " rguenth at gcc dot gnu.org
@ 2015-01-27  8:14 ` jakub at gcc dot gnu.org
  2015-01-27  8:48 ` [Bug middle-end/64766] [4.8/4.9 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-01-27  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Tue Jan 27 08:13:45 2015
New Revision: 220152

URL: https://gcc.gnu.org/viewcvs?rev=220152&root=gcc&view=rev
Log:
    PR c/64766
    * c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL
    of FUNCTION_DECLs with error_mark_node.

    * gcc.dg/pr64766.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr64766.c
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug middle-end/64766] [4.8/4.9 Regression] internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122
  2015-01-24 10:22 [Bug middle-end/64766] New: internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122 mpolacek at gcc dot gnu.org
  2015-01-26 11:31 ` [Bug middle-end/64766] [4.8/4.9/5 Regression] " rguenth at gcc dot gnu.org
  2015-01-27  8:14 ` jakub at gcc dot gnu.org
@ 2015-01-27  8:48 ` jakub at gcc dot gnu.org
  2015-02-01 17:37 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-01-27  8:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.8/4.9/5 Regression]      |[4.8/4.9 Regression]
                   |internal compiler error:    |internal compiler error:
                   |tree check: expected block, |tree check: expected block,
                   |have error_mark in          |have error_mark in
                   |lower_function_body, at     |lower_function_body, at
                   |gimple-low.c:122            |gimple-low.c:122

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.


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

* [Bug middle-end/64766] [4.8/4.9 Regression] internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122
  2015-01-24 10:22 [Bug middle-end/64766] New: internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122 mpolacek at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-01-27  8:48 ` [Bug middle-end/64766] [4.8/4.9 " jakub at gcc dot gnu.org
@ 2015-02-01 17:37 ` jakub at gcc dot gnu.org
  2015-02-01 21:55 ` jakub at gcc dot gnu.org
  2015-02-01 21:57 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-01 17:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Sun Feb  1 17:36:26 2015
New Revision: 220327

URL: https://gcc.gnu.org/viewcvs?rev=220327&root=gcc&view=rev
Log:
    Backported from mainline
    2015-01-27  Jakub Jelinek  <jakub@redhat.com>

    PR c/64766
    * c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL
    of FUNCTION_DECLs with error_mark_node.

    * gcc.dg/pr64766.c: New test.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/pr64766.c
Modified:
    branches/gcc-4_9-branch/gcc/c/ChangeLog
    branches/gcc-4_9-branch/gcc/c/c-typeck.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


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

* [Bug middle-end/64766] [4.8/4.9 Regression] internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122
  2015-01-24 10:22 [Bug middle-end/64766] New: internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122 mpolacek at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-02-01 17:37 ` jakub at gcc dot gnu.org
@ 2015-02-01 21:55 ` jakub at gcc dot gnu.org
  2015-02-01 21:57 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-01 21:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Sun Feb  1 21:54:27 2015
New Revision: 220335

URL: https://gcc.gnu.org/viewcvs?rev=220335&root=gcc&view=rev
Log:
    Backported from mainline
    2015-01-27  Jakub Jelinek  <jakub@redhat.com>

    PR c/64766
    * c-typeck.c (store_init_value): Don't overwrite DECL_INITIAL
    of FUNCTION_DECLs with error_mark_node.

    * gcc.dg/pr64766.c: New test.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/pr64766.c
Modified:
    branches/gcc-4_8-branch/gcc/c/ChangeLog
    branches/gcc-4_8-branch/gcc/c/c-typeck.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


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

* [Bug middle-end/64766] [4.8/4.9 Regression] internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122
  2015-01-24 10:22 [Bug middle-end/64766] New: internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122 mpolacek at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-02-01 21:55 ` jakub at gcc dot gnu.org
@ 2015-02-01 21:57 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-01 21:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2015-02-01 21:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-24 10:22 [Bug middle-end/64766] New: internal compiler error: tree check: expected block, have error_mark in lower_function_body, at gimple-low.c:122 mpolacek at gcc dot gnu.org
2015-01-26 11:31 ` [Bug middle-end/64766] [4.8/4.9/5 Regression] " rguenth at gcc dot gnu.org
2015-01-27  8:14 ` jakub at gcc dot gnu.org
2015-01-27  8:48 ` [Bug middle-end/64766] [4.8/4.9 " jakub at gcc dot gnu.org
2015-02-01 17:37 ` jakub at gcc dot gnu.org
2015-02-01 21:55 ` jakub at gcc dot gnu.org
2015-02-01 21:57 ` jakub 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).