public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/61544] New: ICE due to thumb1_reorg function mishandles label type insn
@ 2014-06-18  4:32 terry.guo at arm dot com
  2014-06-18 10:11 ` [Bug target/61544] " xguo at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: terry.guo at arm dot com @ 2014-06-18  4:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61544
           Summary: ICE due to thumb1_reorg function mishandles label type
                    insn
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: terry.guo at arm dot com

When build some c++ files for pure thumb1 target, I ran into below ICE:

terguo01@terry-pc01:thumb1-reorg$
/myssd/terguo01/toolchain-build/thumb1-reorg/build-native/gcc-final/./gcc/xgcc
-shared-libgcc
-B/myssd/terguo01/toolchain-build/thumb1-reorg/build-native/gcc-final/./gcc
-nostdinc++
-L/myssd/terguo01/toolchain-build/thumb1-reorg/build-native/gcc-final/arm-none-eabi/libstdc++-v3/src
-L/myssd/terguo01/toolchain-build/thumb1-reorg/build-native/gcc-final/arm-none-eabi/libstdc++-v3/src/.libs
-L/myssd/terguo01/toolchain-build/thumb1-reorg/build-native/gcc-final/arm-none-eabi/libstdc++-v3/libsupc++/.libs
-B/myssd/terguo01/toolchain-build/thumb1-reorg/install-native/arm-none-eabi/bin/
-B/myssd/terguo01/toolchain-build/thumb1-reorg/install-native/arm-none-eabi/lib/
-isystem
/myssd/terguo01/toolchain-build/thumb1-reorg/install-native/arm-none-eabi/include
-isystem
/myssd/terguo01/toolchain-build/thumb1-reorg/install-native/arm-none-eabi/sys-include
-I/myssd/terguo01/toolchain-build/thumb1-reorg/src/gcc/libstdc++-v3/../libgcc
-I/myssd/terguo01/toolchain-build/thumb1-reorg/build-native/gcc-final/arm-none-eabi/libstdc++-v3/include/arm-none-eabi
-I/myssd/terguo01/toolchain-build/thumb1-reorg/build-native/gcc-final/arm-none-eabi/libstdc++-v3/include
-I/myssd/terguo01/toolchain-build/thumb1-reorg/src/gcc/libstdc++-v3/libsupc++
-fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi
-fdiagnostics-show-location=once -ffunction-sections -fdata-sections
-frandom-seed=sstream-inst.lo -g -O2 -c
/myssd/terguo01/toolchain-build/thumb1-reorg/src/gcc/libstdc++-v3/src/c++98/sstream-inst.cc
-o sstream-inst.o 
In file included from
/myssd/terguo01/toolchain-build/thumb1-reorg/src/gcc/libstdc++-v3/src/c++98/sstream-inst.cc:29:0:
/myssd/terguo01/toolchain-build/thumb1-reorg/build-native/gcc-final/arm-none-eabi/libstdc++-v3/include/sstream:
In member function 'std::basic_stringstream<_CharT, _Traits,
_Alloc>::__string_type std::basic_stringstream<_CharT, _Traits, _Alloc>::str()
const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc =
std::allocator<char>; std::basic_stringstream<_CharT, _Traits,
_Alloc>::__string_type = std::basic_string<char>]':
/myssd/terguo01/toolchain-build/thumb1-reorg/build-native/gcc-final/arm-none-eabi/libstdc++-v3/include/sstream:584:36:
internal compiler error: Segmentation fault
       { return _M_stringbuf.str(); }
                                    ^
0xd90226 crash_signal
    /myssd/terguo01/toolchain-build/thumb1-reorg/src/gcc/gcc/toplev.c:337
0x10e1219 thumb1_reorg
   
/myssd/terguo01/toolchain-build/thumb1-reorg/src/gcc/gcc/config/arm/arm.c:16954
0x10e1cbe arm_reorg
   
/myssd/terguo01/toolchain-build/thumb1-reorg/src/gcc/gcc/config/arm/arm.c:17223
0xd1451c execute
    /myssd/terguo01/toolchain-build/thumb1-reorg/src/gcc/gcc/reorg.c:3959
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.

Such ICE is triggered when apply thumb1_reorg function to below basic block:

(gdb) p debug_bb(bb)
(code_label/s 477 953 480 736 "" [1 uses])
(note 480 477 954 [bb 19] NOTE_INSN_BASIC_BLOCK)
(note 954 480 955 (var_location this (plus:SI (reg/f:SI 103 afp)
    (const_int -20 [0xffffffffffffffec]))) NOTE_INSN_VAR_LOCATION)
(note 955 954 956 (var_location this (plus:SI (reg/f:SI 103 afp)
    (const_int -20 [0xffffffffffffffec]))) NOTE_INSN_VAR_LOCATION)

For the code_label insn 477, its INSN_CODE accidentally equals the value of
CODE_FOR_cbranchsi4_insn. This leads to the execution of subsequent gcc code:

16953          pat = PATTERN (insn);
16954          op0 = XEXP (XEXP (SET_SRC (pat), 0), 0);

Then the ICE is triggered due to applying SET_SRC to a code_label insn.

>From the very beginning, we shouldn't use INSN_CODE to insn like code_label.
Thus when the head of basic block isn't a proper insn, we should move to next
basic block.

Patch at https://gcc.gnu.org/ml/gcc-patches/2014-06/msg00809.html can fix this
ICE.


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

* [Bug target/61544] ICE due to thumb1_reorg function mishandles label type insn
  2014-06-18  4:32 [Bug target/61544] New: ICE due to thumb1_reorg function mishandles label type insn terry.guo at arm dot com
@ 2014-06-18 10:11 ` xguo at gcc dot gnu.org
  2014-06-18 10:13 ` terry.guo at arm dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: xguo at gcc dot gnu.org @ 2014-06-18 10:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from xuepeng guo <xguo at gcc dot gnu.org> ---
Author: xguo
Date: Wed Jun 18 10:11:08 2014
New Revision: 211775

URL: https://gcc.gnu.org/viewcvs?rev=211775&root=gcc&view=rev
Log:
2014-06-18  Terry Guo  <terry.guo@arm.com>

    PR target/61544
    * config/arm/arm.c (thumb1_reorg): Move to next basic block if we
    reach the head.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.c


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

* [Bug target/61544] ICE due to thumb1_reorg function mishandles label type insn
  2014-06-18  4:32 [Bug target/61544] New: ICE due to thumb1_reorg function mishandles label type insn terry.guo at arm dot com
  2014-06-18 10:11 ` [Bug target/61544] " xguo at gcc dot gnu.org
@ 2014-06-18 10:13 ` terry.guo at arm dot com
  2014-07-04 12:46 ` amker at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: terry.guo at arm dot com @ 2014-06-18 10:13 UTC (permalink / raw)
  To: gcc-bugs

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

Terry Guo <terry.guo at arm dot com> changed:

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

--- Comment #2 from Terry Guo <terry.guo at arm dot com> ---
The fix is submitted.


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

* [Bug target/61544] ICE due to thumb1_reorg function mishandles label type insn
  2014-06-18  4:32 [Bug target/61544] New: ICE due to thumb1_reorg function mishandles label type insn terry.guo at arm dot com
  2014-06-18 10:11 ` [Bug target/61544] " xguo at gcc dot gnu.org
  2014-06-18 10:13 ` terry.guo at arm dot com
@ 2014-07-04 12:46 ` amker at gcc dot gnu.org
  2014-07-09  5:28 ` zqchen at gcc dot gnu.org
  2014-07-29 10:50 ` rearnsha at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: amker at gcc dot gnu.org @ 2014-07-04 12:46 UTC (permalink / raw)
  To: gcc-bugs

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

amker at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |arm
                 CC|                            |amker at gcc dot gnu.org
   Target Milestone|---                         |4.9.1
      Known to fail|                            |4.9.0


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

* [Bug target/61544] ICE due to thumb1_reorg function mishandles label type insn
  2014-06-18  4:32 [Bug target/61544] New: ICE due to thumb1_reorg function mishandles label type insn terry.guo at arm dot com
                   ` (2 preceding siblings ...)
  2014-07-04 12:46 ` amker at gcc dot gnu.org
@ 2014-07-09  5:28 ` zqchen at gcc dot gnu.org
  2014-07-29 10:50 ` rearnsha at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: zqchen at gcc dot gnu.org @ 2014-07-09  5:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from zqchen at gcc dot gnu.org ---
Author: zqchen
Date: Wed Jul  9 05:27:16 2014
New Revision: 212385

URL: https://gcc.gnu.org/viewcvs?rev=212385&root=gcc&view=rev
Log:
    Backport r211775 from trunk.
    2014-06-18  Terry Guo  <terry.guo@arm.com>

    PR target/61544
    * config/arm/arm.c (thumb1_reorg): Move to next basic block if we
    reach the head.


Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/config/arm/arm.c


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

* [Bug target/61544] ICE due to thumb1_reorg function mishandles label type insn
  2014-06-18  4:32 [Bug target/61544] New: ICE due to thumb1_reorg function mishandles label type insn terry.guo at arm dot com
                   ` (3 preceding siblings ...)
  2014-07-09  5:28 ` zqchen at gcc dot gnu.org
@ 2014-07-29 10:50 ` rearnsha at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2014-07-29 10:50 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manjian2006 at gmail dot com

--- Comment #4 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
*** Bug 61712 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2014-07-29 10:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-18  4:32 [Bug target/61544] New: ICE due to thumb1_reorg function mishandles label type insn terry.guo at arm dot com
2014-06-18 10:11 ` [Bug target/61544] " xguo at gcc dot gnu.org
2014-06-18 10:13 ` terry.guo at arm dot com
2014-07-04 12:46 ` amker at gcc dot gnu.org
2014-07-09  5:28 ` zqchen at gcc dot gnu.org
2014-07-29 10:50 ` rearnsha 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).