public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/57358] New: segmentation fault with attribute(optimize(O0))
@ 2013-05-21 15:17 nbkolchin at gmail dot com
  2013-06-04 14:16 ` [Bug tree-optimization/57358] " nbkolchin at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: nbkolchin at gmail dot com @ 2013-05-21 15:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57358
           Summary: segmentation fault with attribute(optimize(O0))
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nbkolchin at gmail dot com

Created attachment 30157
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30157&action=edit
backtrace

The following code crashes GCC (gcc-4.8.0 -O2):

typedef void (*done)(void* arg);
struct t { done func; void* arg; };
static void test_func() __attribute__((optimize("O0")));                       
  static void test_func(struct t* a)
{
  a->func(a->arg);
}

Program received signal SIGSEGV, Segmentation fault.
walk_aliased_vdefs_1 (ref=ref@entry=0x7fffffffda70, vdef=0x0,
    walker=0x6f5d90 <mark_modified(ao_ref*, tree, void*)>, data=0x7fffffffda5f,
    visited=0x7fffffffda28, cnt=0)
    at /mnt/work/oktet/transas/sources/4.8/gcc/gcc/tree-ssa-alias.c:2196
2196          gimple def_stmt = SSA_NAME_DEF_STMT (vdef);

Backtrace from gdb attached.

Reproducable with custom GCC build and gentoo 4.8. No error in 4.7.


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

* [Bug tree-optimization/57358] segmentation fault with attribute(optimize(O0))
  2013-05-21 15:17 [Bug tree-optimization/57358] New: segmentation fault with attribute(optimize(O0)) nbkolchin at gmail dot com
@ 2013-06-04 14:16 ` nbkolchin at gmail dot com
  2013-06-04 15:14 ` nbkolchin at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: nbkolchin at gmail dot com @ 2013-06-04 14:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Nickolay Kolchin-Semyonov <nbkolchin at gmail dot com> ---
Reproducable with gcc-4.8.1.

Using built-in specs.
COLLECT_GCC=gcc-4.8.1
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/mnt/work/tmp/portage/sys-devel/gcc-4.8.1/work/gcc-4.8.1/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.1
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.1
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.1/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.1/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec
--disable-fixed-point --with-cloog --disable-isl-version-check --enable-lto
--enable-nls --without-included-gettext --with-system-zlib --enable-obsolete
--disable-werror --enable-secureplt --enable-multilib
--with-multilib-list=m32,m64 --enable-libmudflap --disable-libssp
--enable-libgomp
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.1/python
--enable-checking=release --disable-libgcj --enable-libstdcxx-time
--enable-languages=c,c++,go,fortran --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --enable-targets=all
--with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.1 p1.0,
pie-0.5.6'
Thread model: posix
gcc version 4.8.1 (Gentoo 4.8.1 p1.0, pie-0.5.6)

$ gcc-4.8.1 -O3 -c no-optimize.c
no-optimize.c: In function ‘test_func’:
no-optimize.c:7:1: internal compiler error: Segmentation fault
 }
 ^
>From gcc-bugs-return-423799-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jun 04 14:56:02 2013
Return-Path: <gcc-bugs-return-423799-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 15727 invoked by alias); 4 Jun 2013 14:56:02 -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 15695 invoked by uid 48); 4 Jun 2013 14:55:55 -0000
From: "thutt at vmware dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/57357] Error with '-mno-sse' and include wchar.h
Date: Tue, 04 Jun 2013 14:56:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: thutt at vmware 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_status resolution
Message-ID: <bug-57357-4-pQ5Wwk1xmv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57357-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57357-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-06/txt/msg00178.txt.bz2
Content-length: 816

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

thutt at vmware dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |---

--- Comment #7 from thutt at vmware dot com ---
(In reply to Andrew Pinski from comment #6)
> (In reply to thutt from comment #5)
> > Is there simple explanation for the difference in behavior?
>
> Is the preprocessed source the same?  I bet glibc enables some inline
> function at -O1.

Yes, the cpp output is different.

Because this produces different results for -O0 and -O1, I'm reopening
because the compiler really shouldn't fail with one setting and succeed with
another.


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

* [Bug tree-optimization/57358] segmentation fault with attribute(optimize(O0))
  2013-05-21 15:17 [Bug tree-optimization/57358] New: segmentation fault with attribute(optimize(O0)) nbkolchin at gmail dot com
  2013-06-04 14:16 ` [Bug tree-optimization/57358] " nbkolchin at gmail dot com
@ 2013-06-04 15:14 ` nbkolchin at gmail dot com
  2013-06-11 12:00 ` jamborm at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: nbkolchin at gmail dot com @ 2013-06-04 15:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Nickolay Kolchin-Semyonov <nbkolchin at gmail dot com> ---
More simplified test variant:

struct t { void (*func)(void*); };
void test_func(struct t* a) __attribute__((optimize("O0")));
void test_func(struct t* a)
{
  a->func(0);
}

P.S. If you compile this as C++ code, no segmentation fault would occure.


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

* [Bug tree-optimization/57358] segmentation fault with attribute(optimize(O0))
  2013-05-21 15:17 [Bug tree-optimization/57358] New: segmentation fault with attribute(optimize(O0)) nbkolchin at gmail dot com
  2013-06-04 14:16 ` [Bug tree-optimization/57358] " nbkolchin at gmail dot com
  2013-06-04 15:14 ` nbkolchin at gmail dot com
@ 2013-06-11 12:00 ` jamborm at gcc dot gnu.org
  2013-06-14 10:00 ` jamborm at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-06-11 12:00 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jamborm at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jamborm at gcc dot gnu.org

--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I'll take a look.


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

* [Bug tree-optimization/57358] segmentation fault with attribute(optimize(O0))
  2013-05-21 15:17 [Bug tree-optimization/57358] New: segmentation fault with attribute(optimize(O0)) nbkolchin at gmail dot com
                   ` (2 preceding siblings ...)
  2013-06-11 12:00 ` jamborm at gcc dot gnu.org
@ 2013-06-14 10:00 ` jamborm at gcc dot gnu.org
  2013-06-24 12:52 ` jamborm at gcc dot gnu.org
  2013-06-24 12:59 ` jamborm at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-06-14 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2013-06/msg00666.htm
                   |                            |l

--- Comment #4 from Martin Jambor <jamborm at gcc dot gnu.org> ---
I have submitted a fix for the 4.8 branch here:

http://gcc.gnu.org/ml/gcc-patches/2013-06/msg00663.html

and for the current trunk here:

http://gcc.gnu.org/ml/gcc-patches/2013-06/msg00666.html


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

* [Bug tree-optimization/57358] segmentation fault with attribute(optimize(O0))
  2013-05-21 15:17 [Bug tree-optimization/57358] New: segmentation fault with attribute(optimize(O0)) nbkolchin at gmail dot com
                   ` (3 preceding siblings ...)
  2013-06-14 10:00 ` jamborm at gcc dot gnu.org
@ 2013-06-24 12:52 ` jamborm at gcc dot gnu.org
  2013-06-24 12:59 ` jamborm at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-06-24 12:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Author: jamborm
Date: Mon Jun 24 12:51:43 2013
New Revision: 200369

URL: http://gcc.gnu.org/viewcvs?rev=200369&root=gcc&view=rev
Log:
2013-06-24  Martin Jambor  <mjambor@suse.cz>

    PR tree-optimization/57358
    * ipa-prop.c (ipa_func_spec_opts_forbid_analysis_p): New function.
    (ipa_compute_jump_functions_for_edge): Bail out if it returns true.
    (ipa_analyze_params_uses): Generate pessimistic info when true.

testsuite
    * gcc.dg/ipa/pr57358.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/ipa/pr57358.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ipa-prop.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug tree-optimization/57358] segmentation fault with attribute(optimize(O0))
  2013-05-21 15:17 [Bug tree-optimization/57358] New: segmentation fault with attribute(optimize(O0)) nbkolchin at gmail dot com
                   ` (4 preceding siblings ...)
  2013-06-24 12:52 ` jamborm at gcc dot gnu.org
@ 2013-06-24 12:59 ` jamborm at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jamborm at gcc dot gnu.org @ 2013-06-24 12:59 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

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

--- Comment #6 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Author: jamborm
Date: Mon Jun 24 12:57:52 2013
New Revision: 200370

URL: http://gcc.gnu.org/viewcvs?rev=200370&root=gcc&view=rev
Log:
2013-06-24  Martin Jambor  <mjambor@suse.cz>

    PR tree-optimization/57358
    * ipa-prop.c (parm_ref_data_preserved_p): Always return true when
    not optimizing.

testsuite/
    * gcc.dg/ipa/pr57358.c: New test.


Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/ipa/pr57358.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/ipa-prop.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


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

end of thread, other threads:[~2013-06-24 12:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-21 15:17 [Bug tree-optimization/57358] New: segmentation fault with attribute(optimize(O0)) nbkolchin at gmail dot com
2013-06-04 14:16 ` [Bug tree-optimization/57358] " nbkolchin at gmail dot com
2013-06-04 15:14 ` nbkolchin at gmail dot com
2013-06-11 12:00 ` jamborm at gcc dot gnu.org
2013-06-14 10:00 ` jamborm at gcc dot gnu.org
2013-06-24 12:52 ` jamborm at gcc dot gnu.org
2013-06-24 12:59 ` jamborm 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).