public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/58627] New: [4.9 Regression] crash during compilation of boost testsuite
@ 2013-10-05  8:04 markus at trippelsdorf dot de
  2013-10-05  8:04 ` [Bug tree-optimization/58627] " markus at trippelsdorf dot de
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: markus at trippelsdorf dot de @ 2013-10-05  8:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58627
           Summary: [4.9 Regression] crash during compilation of boost
                    testsuite
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: markus at trippelsdorf dot de

Crash happened during compilation of the boost testsuite.
It's hard to reduce the testcase, because it appears to be a bug in the 
garbage-collector.

[With --enable-checking=release]
 % g++ -O0 -std=c++11 -c test.ii 
test.ii: In member function ‘boost::chrono::duration<Rep, Period>&
boost::chrono::duration<Rep, Period>::operator--() [with Rep = double; Period =
boost::ratio<1l>]’:
test.ii:3207:286: internal compiler error: Segmentation fault

[gcc-4.8.1 is fine]
 % /usr/x86_64-pc-linux-gnu/gcc-bin/4.8.1/g++ -O2 -std=c++11 -c test.i
 % 

[Backtrace with --enable-checking]
 % gdb --args /var/tmp/gcc_test/usr/local/bin/g++ -w -O0 -std=c++11
-Wfatal-errors -c test.ii -pipe -o /dev/null
Reading symbols from /var/tmp/gcc_test/usr/local/bin/g++...done.
(gdb) run
Starting program: /var/tmp/gcc_test/usr/local/bin/g++ -w -O0 -std=c++11
-Wfatal-errors -c test.ii -pipe -o /dev/null
[New process 20470]
process 20470 is executing new program:
/var/tmp/gcc_test/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/cc1plus

Program received signal SIGSEGV, Segmentation fault.
[Switching to process 20470]
0x0000000000c8e9f8 in tree_class_check_failed (node=<optimized out>,
cl=<optimized out>, file=0xff512d "../../gcc/gcc/c-family/c-common.h",
line=1063, 
    function=0xff514f "c_tree_chain_next") at ../../gcc/gcc/tree.c:9223
9223    ../../gcc/gcc/tree.c: No such file or directory.
(gdb) bt
#0  0x0000000000c8e9f8 in tree_class_check_failed (node=<optimized out>,
cl=<optimized out>, file=0xff512d "../../gcc/gcc/c-family/c-common.h",
line=1063, 
    function=0xff514f "c_tree_chain_next") at ../../gcc/gcc/tree.c:9223
#1  0x00000000006807f1 in tree_class_check (__class=<optimized out>,
__f=<optimized out>, __l=<optimized out>, __g=<optimized out>, __t=<optimized
out>, 
    __class=<optimized out>, __f=<optimized out>, __l=<optimized out>,
__g=<optimized out>) at ../../gcc/gcc/tree.h:2732
#2  c_tree_chain_next (t=<optimized out>) at
../../gcc/gcc/c-family/c-common.h:1063
#3  gt_ggc_mx_lang_tree_node (x_p=<optimized out>) at ./gt-cp-tree.h:158
#4  0x000000000067f79a in gt_ggc_mx_lang_tree_node (x_p=<optimized out>) at
./gt-cp-tree.h:706
#5  0x0000000000680ba3 in gt_ggc_mx_tinst_level (x_p=<optimized out>) at
./gt-cp-tree.h:124
#6  0x000000000057b363 in gt_ggc_mx_pending_template (x_p=<optimized out>) at
./gt-cp-pt.h:44
#7  0x00000000008dfa6b in ggc_mark_root_tab (rt=<optimized out>) at
../../gcc/gcc/ggc-common.c:133
#8  ggc_mark_roots () at ../../gcc/gcc/ggc-common.c:152
#9  0x000000000072d91b in ggc_collect () at ../../gcc/gcc/ggc-page.c:2077
#10 0x000000000079f9c3 in cgraph_finalize_function (decl=<optimized out>,
no_collect=<optimized out>) at ../../gcc/gcc/cgraphunit.c:456
#11 0x000000000065c3fc in expand_or_defer_fn (fn=0x7fffeeb57500) at
../../gcc/gcc/cp/semantics.c:3949
#12 0x0000000000574935 in instantiate_decl (d=0x7fffeeb57500, defer_ok=<error
reading variable: Cannot access memory at address 0x0>,
expl_inst_class_mem_p=<optimized out>)
    at ../../gcc/gcc/cp/pt.c:19406
#13 0x0000000000577738 in instantiate_pending_templates (retries=<optimized
out>) at ../../gcc/gcc/cp/pt.c:19493
#14 0x00000000005b9454 in cp_write_global_declarations () at
../../gcc/gcc/cp/decl2.c:4065
#15 0x0000000000aa2196 in compile_file () at ../../gcc/gcc/toplev.c:560
#16 0x0000000000aa1f67 in do_compile () at ../../gcc/gcc/toplev.c:1893
#17 toplev_main (argc=16, argv=0x7fffffffe028) at ../../gcc/gcc/toplev.c:1969
#18 0x00007ffff74d3a6e in __libc_start_main () from /lib/libc.so.6
#19 0x00000000004e090d in _start ()
>From gcc-bugs-return-431121-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 05 08:15:12 2013
Return-Path: <gcc-bugs-return-431121-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27203 invoked by alias); 5 Oct 2013 08:15:11 -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 27123 invoked by uid 48); 5 Oct 2013 08:15:06 -0000
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/58625] std::signbit always converts to double
Date: Sat, 05 Oct 2013 08:15:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: olegendo at gcc dot gnu.org
X-Bugzilla-Status: NEW
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:
Message-ID: <bug-58625-4-PwHCmxwYJp@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58625-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58625-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-10/txt/msg00265.txt.bz2
Content-length: 1695

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

--- Comment #4 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Paolo Carlini from comment #1)
> Weird that nobody noticed for so much time.

Probably not everybody is practicing the neurotic habit of checking the asm
output for every bit and piece ;)

(In reply to Paolo Carlini from comment #2)
> Well, now I see this can be certainly a correctness issue, for eg very small
> negative long doubles. Thus I think we should certainly do the change anyway
> for 4.9. For c_std I'm afraid we have to add overloads (I think, essentially
> copy over the corresponding bits of c_global without constexpr). Can you
> send a patch to the libstdc++-v3 mailing list? And, please, double check
> isnan and isinf. Thanks!

Yes, I can do that.  But how to check this in a target independent way?  Tree
dump and check whether the correct builtin names appear?

There's another place in file libstdc++-v3/include/c_std/cmath:

  template<typename _Tp>
    inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
                       int>::__type
    signbit(_Tp __f)
    {
      typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
      return __builtin_signbit(__type(__f));
    }

I guess that this is supposed to be used when C++ code pulls in <math.h> and
uses the C macro signbit instead of std::signbit.  It doesn't happen on my SH /
newlib cross config -- I get something like ((sizeof(x) == sizeof(float)) ?
__signbitf(x) : __signbitd(x)).  But if on some config it does happen, then the
problem would be the same, thus requiring signbit (and friends) overloads as
it's done for sqrt etc in the same file, right?


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

end of thread, other threads:[~2013-12-29  9:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-05  8:04 [Bug tree-optimization/58627] New: [4.9 Regression] crash during compilation of boost testsuite markus at trippelsdorf dot de
2013-10-05  8:04 ` [Bug tree-optimization/58627] " markus at trippelsdorf dot de
2013-10-09  7:14 ` [Bug c++/58627] " markus at trippelsdorf dot de
2013-10-10 11:50 ` rguenth at gcc dot gnu.org
2013-11-05 14:49 ` rguenth at gcc dot gnu.org
2013-11-28  7:08 ` jakub at gcc dot gnu.org
2013-12-09 19:11 ` paolo.carlini at oracle dot com
2013-12-10  8:26 ` jakub at gcc dot gnu.org
2013-12-12 13:36 ` jakub at gcc dot gnu.org
2013-12-29  9:27 ` trippels at gcc dot gnu.org
2013-12-29  9:29 ` trippels 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).