public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/59919] New: [4.7 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096
@ 2014-01-23 14:25 doko at gcc dot gnu.org
  2014-01-23 15:11 ` [Bug tree-optimization/59919] [4.9 " trippels at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: doko at gcc dot gnu.org @ 2014-01-23 14:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59919
           Summary: [4.7 Regression] ICE in process_assert_insertions_for,
                    at tree-vrp.c:6096
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org

Created attachment 31932
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31932&action=edit
preprocessed source

seen with trunk 20140122, works with the 4.8 branch, lowering to -O1 works
around the issue

$ gcc -c -g -O2 debug.i 
src/debug.c: In function 'Parrot_debugger_break':
src/debug.c:1243:1: internal compiler error: in process_assert_insertions_for,
at tree-vrp.c:6096
 Parrot_debugger_break(PARROT_INTERP, ARGIN(opcode_t * cur_opcode))
 ^
Please submit a full bug report,
with preprocessed source if appropriate.


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

* [Bug tree-optimization/59919] [4.9 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096
  2014-01-23 14:25 [Bug tree-optimization/59919] New: [4.7 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096 doko at gcc dot gnu.org
@ 2014-01-23 15:11 ` trippels at gcc dot gnu.org
  2014-01-23 15:39 ` mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: trippels at gcc dot gnu.org @ 2014-01-23 15:11 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: 5478 bytes --]

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-01-23
                 CC|                            |trippels at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Creduce came up with:

markus@x4 test % cat test.i
typedef struct parrot_interp_t *Parrot_Interp;
typedef int jmp_buf[0];
struct parrot_runloop_t {
  jmp_buf resume;
};
void _setjmp(int[]);
typedef struct {
  struct parrot_interp_t *debugger;
} PDB_t;
void Parrot_pcc_invoke_method_from_c_args(int *, ...);
struct parrot_interp_t {
  PDB_t *pdb;
  int *const_cstring_table;
  struct parrot_runloop_t *current_runloop;
};
__attribute__((__noreturn__))
void Parrot_ex_throw_from_c_args(Parrot_Interp, ...)
__attribute__((__nonnull__));
void Parrot_debugger_break(Parrot_Interp p1) {
  Parrot_ex_throw_from_c_args(p1);
  _setjmp(p1->current_runloop->resume);
  struct parrot_interp_t a = *p1->pdb->debugger;
  int b = a.const_cstring_table[0];
  Parrot_pcc_invoke_method_from_c_args(&b);
}

markus@x4 test % gcc -c -O2 test.i
test.i: In function ‘Parrot_debugger_break’:
test.i:19:6: internal compiler error: in process_assert_insertions_for, at
tree-vrp.c:6096
 void Parrot_debugger_break(Parrot_Interp p1) {
      ^
0xbbe63c process_assert_insertions_for
        ../../gcc/gcc/tree-vrp.c:6096
0xbbe63c process_assert_insertions
        ../../gcc/gcc/tree-vrp.c:6123
0xbbe63c insert_range_assertions
        ../../gcc/gcc/tree-vrp.c:6180
0xbbe63c execute_vrp
        ../../gcc/gcc/tree-vrp.c:9798
0xbbe63c execute
        ../../gcc/gcc/tree-vrp.c:9899
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.
>From gcc-bugs-return-441313-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 23 15:18:46 2014
Return-Path: <gcc-bugs-return-441313-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 15803 invoked by alias); 23 Jan 2014 15:18:46 -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 15777 invoked by uid 48); 23 Jan 2014 15:18:43 -0000
From: "doko at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/59920] New: [4.9 Regression] build doesn't terminate (at least after an hour)
Date: Thu, 23 Jan 2014 15:18:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: other
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: doko at gcc dot gnu.org
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 attachments.created
Message-ID: <bug-59920-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-01/txt/msg02455.txt.bz2
Content-length: 1501

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

            Bug ID: 59920
           Summary: [4.9 Regression] build doesn't terminate (at least
                    after an hour)
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org

Created attachment 31933
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id1933&actioníit
preprocessed source

seen with trunk 20140122, -O0 and -O2, works with the 4.8 branch.

needs a second to build with 4.8, buildd timeout after an hour.

$ gcc-4.8 -g -O2 -c parser.c
parser.c: In function 'VLparse':
parser.c:14129:9: warning: passing argument 1 of 'VLerror' discards 'const'
qualifier from pointer target type [enabled by default]
         yyerror (yymsgp);
         ^
In file included from ./parser.y:42:0:
parser_misc.h:54:13: note: expected 'char *' but argument is of type 'const
char *'
 extern void VLerror( char* msg );
             ^
$ gcc -g -O0 -c parser.c
parser.c: In function 'VLparse':
parser.c:14129:9: warning: passing argument 1 of 'VLerror' discards 'const'
qualifier from pointer target type [enabled by default]
         yyerror (yymsgp);
         ^
In file included from ./parser.y:42:0:
parser_misc.h:54:13: note: expected 'char *' but argument is of type 'const
char *'
 extern void VLerror( char* msg );
             ^
[hangs]


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

* [Bug tree-optimization/59919] [4.9 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096
  2014-01-23 14:25 [Bug tree-optimization/59919] New: [4.7 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096 doko at gcc dot gnu.org
  2014-01-23 15:11 ` [Bug tree-optimization/59919] [4.9 " trippels at gcc dot gnu.org
@ 2014-01-23 15:39 ` mpolacek at gcc dot gnu.org
  2014-01-23 16:04 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-01-23 15:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |4.9.0


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

* [Bug tree-optimization/59919] [4.9 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096
  2014-01-23 14:25 [Bug tree-optimization/59919] New: [4.7 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096 doko at gcc dot gnu.org
  2014-01-23 15:11 ` [Bug tree-optimization/59919] [4.9 " trippels at gcc dot gnu.org
  2014-01-23 15:39 ` mpolacek at gcc dot gnu.org
@ 2014-01-23 16:04 ` mpolacek at gcc dot gnu.org
  2014-01-23 16:42 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-01-23 16:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
More reduced:

typedef int jmp_buf[10];
struct S
{
  int i;
  jmp_buf buf;
};

void setjmp (jmp_buf);
void foo (int *);
__attribute__ ((__noreturn__, __nonnull__)) void bar (struct S *);

void
baz (struct S *p)
{
  bar (p);
  setjmp (p->buf);
  foo (&p->i);
}


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

* [Bug tree-optimization/59919] [4.9 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096
  2014-01-23 14:25 [Bug tree-optimization/59919] New: [4.7 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096 doko at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-01-23 16:04 ` mpolacek at gcc dot gnu.org
@ 2014-01-23 16:42 ` jakub at gcc dot gnu.org
  2014-01-23 17:03 ` law at redhat dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-01-23 16:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r203271.


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

* [Bug tree-optimization/59919] [4.9 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096
  2014-01-23 14:25 [Bug tree-optimization/59919] New: [4.7 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096 doko at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-01-23 16:42 ` jakub at gcc dot gnu.org
@ 2014-01-23 17:03 ` law at redhat dot com
  2014-01-23 17:28 ` law at redhat dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2014-01-23 17:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at redhat dot com> changed:

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

--- Comment #4 from Jeffrey A. Law <law at redhat dot com> ---
I'll take a look.


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

* [Bug tree-optimization/59919] [4.9 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096
  2014-01-23 14:25 [Bug tree-optimization/59919] New: [4.7 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096 doko at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-01-23 17:03 ` law at redhat dot com
@ 2014-01-23 17:28 ` law at redhat dot com
  2014-01-24 20:51 ` law at gcc dot gnu.org
  2014-01-24 20:52 ` law at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2014-01-23 17:28 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |law at redhat dot com

--- Comment #5 from Jeffrey A. Law <law at redhat dot com> ---
The problem here is we have a call to a non-returning function.  The caller
also calls setjmp.

This ultimately results in something like this prior to vrp:

;;   basic block 2, loop depth 0, count 0, freq 10000, maybe hot
;;    prev block 0, next block 3, flags: (NEW, REACHABLE)
;;    pred:       ENTRY [100.0%]  (FALLTHRU,EXECUTABLE)
  bar (p_3(D));
;;    succ:       3 [100.0%]  (ABNORMAL,EXECUTABLE)

;;   basic block 3, loop depth 0, count 0, freq 10000, maybe hot
;;   Invalid sum of incoming frequencies 15000, should be 10000
;;    prev block 2, next block 4, flags: (NEW, REACHABLE, IRREDUCIBLE_LOOP)
;;    pred:       2 [100.0%]  (ABNORMAL,EXECUTABLE)
;;                3 [50.0%]  (ABNORMAL,DFS_BACK,IRREDUCIBLE_LOOP,EXECUTABLE)
  setjmp (_4(D));
  _6 = &p_3(D)->i;
  foo (_6);
;;    succ:       3 [50.0%]  (ABNORMAL,DFS_BACK,IRREDUCIBLE_LOOP,EXECUTABLE)
;;                4 [50.0%]  (FALLTHRU,EXECUTABLE)

;;   basic block 4, loop depth 0, count 0, freq 5000, maybe hot
;;    prev block 3, next block 1, flags: (NEW, REACHABLE)
;;    pred:       3 [50.0%]  (FALLTHRU,EXECUTABLE)
  return;


Note that because "bar" is non-returning there is no normal outgoing edge from
BB2.  There is an abnormal edge because our CFG code isn't flow sensitive. 
Either way we have a single outgoing edge from BB2 that is abnormal.

We want to insert an assertion because of the non-null attribute.  But
process_edge_insertions_for never contemplated this particular situation and we
hit the gcc_unreachable.

Creating an ASSERT_EXPR here is wasteful and preventing that is one potential
solution.   Another is to have process_edge_insertions_for not trigger
gcc_unreachable here as it should be safe to just return false for this case.  
 I'll play a bit with both.


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

* [Bug tree-optimization/59919] [4.9 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096
  2014-01-23 14:25 [Bug tree-optimization/59919] New: [4.7 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096 doko at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-01-23 17:28 ` law at redhat dot com
@ 2014-01-24 20:51 ` law at gcc dot gnu.org
  2014-01-24 20:52 ` law at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: law at gcc dot gnu.org @ 2014-01-24 20:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Author: law
Date: Fri Jan 24 20:51:22 2014
New Revision: 207061

URL: http://gcc.gnu.org/viewcvs?rev=207061&root=gcc&view=rev
Log:
    PR tree-optimization/59919
    * tree-vrp.c (find_assert_locations_1): Do not register asserts
    for non-returning calls.

    PR tree-optimization/59919
    * gcc.c-torture/compile/pr59919.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr59919.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vrp.c


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

* [Bug tree-optimization/59919] [4.9 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096
  2014-01-23 14:25 [Bug tree-optimization/59919] New: [4.7 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096 doko at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2014-01-24 20:51 ` law at gcc dot gnu.org
@ 2014-01-24 20:52 ` law at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: law at redhat dot com @ 2014-01-24 20:52 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at redhat dot com> changed:

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

--- Comment #7 from Jeffrey A. Law <law at redhat dot com> ---
Fixed by my commit on the trunk.


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

end of thread, other threads:[~2014-01-24 20:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-23 14:25 [Bug tree-optimization/59919] New: [4.7 Regression] ICE in process_assert_insertions_for, at tree-vrp.c:6096 doko at gcc dot gnu.org
2014-01-23 15:11 ` [Bug tree-optimization/59919] [4.9 " trippels at gcc dot gnu.org
2014-01-23 15:39 ` mpolacek at gcc dot gnu.org
2014-01-23 16:04 ` mpolacek at gcc dot gnu.org
2014-01-23 16:42 ` jakub at gcc dot gnu.org
2014-01-23 17:03 ` law at redhat dot com
2014-01-23 17:28 ` law at redhat dot com
2014-01-24 20:51 ` law at gcc dot gnu.org
2014-01-24 20:52 ` law at redhat 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).