public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/59359] New: Segmentation fault in thread_through_all_blocks
@ 2013-12-01 10:54 antoine.balestrat at gmail dot com
  2013-12-02 12:44 ` [Bug tree-optimization/59359] [4.9 Regression] " rguenth at gcc dot gnu.org
  2013-12-02 16:28 ` law at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: antoine.balestrat at gmail dot com @ 2013-12-01 10:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59359
           Summary: Segmentation fault in thread_through_all_blocks
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antoine.balestrat at gmail dot com

Hello !
The following testcase makes GCC 4.9.0 as of 20131201 crash.

$ cat seg.c
int a, b;

void f()
{
    int c = 0;

    for(; b; b++)
    {
        for(a = 0; a; a++);

        unsigned d = 1;

        for(; c < 2; c++)
            if(d = (c = d) < 1)
                return;
    }
}

$ xgcc -O2 -w seg.c
seg.c: In function ‘f’:
seg.c:3:6: internal compiler error: Segmentation fault
 void f()
      ^
0x9901cf crash_signal
        ../../srcdir/gcc/toplev.c:336
0xb33a67 thread_through_all_blocks(bool)
        ../../srcdir/gcc/tree-ssa-threadupdate.c:1652
0xa7a7ab tree_ssa_dominator_optimize
        ../../srcdir/gcc/tree-ssa-dom.c:886
0xa7a7ab execute
        ../../srcdir/gcc/tree-ssa-dom.c:984
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-436352-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 01 11:07:36 2013
Return-Path: <gcc-bugs-return-436352-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11554 invoked by alias); 1 Dec 2013 11:07:36 -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 11509 invoked by uid 48); 1 Dec 2013 11:07:32 -0000
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57354] Wrong run-time assignment of allocatable array of derived type with allocatable component
Date: Sun, 01 Dec 2013 11:07: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-Version: 4.8.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: burnus at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: pault at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57354-4-ISccOm02Tb@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57354-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57354-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-12/txt/msg00007.txt.bz2
Content-length: 1047

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Paul Thomas from comment #3)
> This patch is preliminary since a temporary is produced, for each
> assignment, copied to the newly reallocated lhs and then deallocated.
> Clearly it would be more efficient to deallocate the lhs and then point the
> lhs to the temporary.

Well, if one has code such as
  a = [a, e]
(and not: "a = [e, a]" or "a = [a, e]*5") one could even do a simple realloc(),
which preserves the data when being extended.

However, one needs to be careful with finalization when using realloc() as both
the LHS and the array constructor would be finalized. (Order: evaluation of the
RHS, finalization of the LHS, assignment, finalization of the RHS [= of the
array constructor/temporaries]. – But that would often involve defined
assignment.)
Note: Finalization of the LHS and of function results + array/structure
constructors after their use is not yet implemented.
>From gcc-bugs-return-436353-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 01 11:42:34 2013
Return-Path: <gcc-bugs-return-436353-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 31534 invoked by alias); 1 Dec 2013 11:42:33 -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 31460 invoked by uid 55); 1 Dec 2013 11:42:29 -0000
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/58410] [4.8/4.9 Regression] Bogus uninitialized variable warning for allocatable derived type array function result
Date: Sun, 01 Dec 2013 11:42: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-Version: 4.8.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pault at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: pault at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58410-4-qus6AteXqD@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58410-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58410-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: 2013-12/txt/msg00008.txt.bz2
Content-length: 548

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

--- Comment #5 from Paul Thomas <pault at gcc dot gnu.org> ---
Author: pault
Date: Sun Dec  1 11:42:25 2013
New Revision: 205566

URL: http://gcc.gnu.org/viewcvs?rev 5566&root=gcc&view=rev
Log:
2013-12-01  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/58410
    * trans-array.c (gfc_alloc_allocatable_for_assignment): Do not
    use the array bounds of an unallocated array but set its size
    to zero instead.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c


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

* [Bug tree-optimization/59359] [4.9 Regression] Segmentation fault in thread_through_all_blocks
  2013-12-01 10:54 [Bug tree-optimization/59359] New: Segmentation fault in thread_through_all_blocks antoine.balestrat at gmail dot com
@ 2013-12-02 12:44 ` rguenth at gcc dot gnu.org
  2013-12-02 16:28 ` law at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-02 12:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-12-02
                 CC|                            |law at gcc dot gnu.org
   Target Milestone|---                         |4.9.0
            Summary|Segmentation fault in       |[4.9 Regression]
                   |thread_through_all_blocks   |Segmentation fault in
                   |                            |thread_through_all_blocks
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.


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

* [Bug tree-optimization/59359] [4.9 Regression] Segmentation fault in thread_through_all_blocks
  2013-12-01 10:54 [Bug tree-optimization/59359] New: Segmentation fault in thread_through_all_blocks antoine.balestrat at gmail dot com
  2013-12-02 12:44 ` [Bug tree-optimization/59359] [4.9 Regression] " rguenth at gcc dot gnu.org
@ 2013-12-02 16:28 ` law at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: law at redhat dot com @ 2013-12-02 16:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jeffrey A. Law <law at redhat dot com> ---
Confirmed duplicate.

*** This bug has been marked as a duplicate of bug 59322 ***


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

end of thread, other threads:[~2013-12-02 16:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-01 10:54 [Bug tree-optimization/59359] New: Segmentation fault in thread_through_all_blocks antoine.balestrat at gmail dot com
2013-12-02 12:44 ` [Bug tree-optimization/59359] [4.9 Regression] " rguenth at gcc dot gnu.org
2013-12-02 16:28 ` 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).