public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/47540] New: ARM THUMB crash with complex numbers
@ 2011-01-30  9:44 ian at airs dot com
  2011-01-30 10:24 ` [Bug target/47540] " ian at airs dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: ian at airs dot com @ 2011-01-30  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: ARM THUMB crash with complex numbers
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ian@airs.com


When I compile this C code with -O2 -mthumb on a current mainline compiler
configured for arm-rtems4.11, it crashes.

extern double f1 (_Complex double);
extern _Complex double f2 (_Complex double);
_Complex double f (_Complex double x) { return f1 (x) == 0 ? 0 : f2 (x); }


> gcc/xgcc -Bgcc/ -c -O2 -mthumb foo.c
foo.c: In function 'f':
foo.c:3:1: internal compiler error: in find_valid_class, at reload.c:710
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

The error is the gcc_assert at the end of find_valid_class.

This code compiles OK on x86 and on ARM when not using -mthumb.


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
@ 2011-01-30 10:24 ` ian at airs dot com
  2011-01-30 13:34 ` mikpe at it dot uu.se
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ian at airs dot com @ 2011-01-30 10:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Ian Lance Taylor <ian at airs dot com> 2011-01-30 07:57:23 UTC ---
Created attachment 23166
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23166
Possible patch

This is a possible patch for this bug.  It fixes what appears to be an obvious
bug in the code, and it fixes this test case.  However, I am not set up to test
the ARM target.  Perhaps one of the ARM maintainers could give this patch a
try.


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
  2011-01-30 10:24 ` [Bug target/47540] " ian at airs dot com
@ 2011-01-30 13:34 ` mikpe at it dot uu.se
  2011-01-30 17:50 ` joel at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mikpe at it dot uu.se @ 2011-01-30 13:34 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #2 from Mikael Pettersson <mikpe at it dot uu.se> 2011-01-30 11:41:55 UTC ---
I can't reproduce the ICE on arm-linux-gnueabi with 4.6-20110122, 4.5-20110127,
or 4.4-20110125, and either -march=armv7-a or -march=armv5te + -mthumb.

The second condition in the proposed patch looks like it requires one register
too many to be <= LAST_LO_REGNUM.


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
  2011-01-30 10:24 ` [Bug target/47540] " ian at airs dot com
  2011-01-30 13:34 ` mikpe at it dot uu.se
@ 2011-01-30 17:50 ` joel at gcc dot gnu.org
  2011-01-31 10:50 ` mikpe at it dot uu.se
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: joel at gcc dot gnu.org @ 2011-01-30 17:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Joel Sherrill <joel at gcc dot gnu.org> 2011-01-30 16:39:05 UTC ---
Test case also fails on arm-rtems4.11 4.5.2 and arm-rtems4.10 4.4.5.  It works
on arm-rtems4.9 which is 4.3.2

========================= 4.5.2

$ sh -x j
+ /opt/rtems-4.11/bin/arm-rtems4.11-gcc --version
arm-rtems4.11-gcc (GCC) 4.5.2 20101216 (RTEMS
gcc-4.5.2-3.fc14/newlib-1.19.0-1.fc14)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

+ /opt/rtems-4.11/bin/arm-rtems4.11-gcc -c -O2 -mthumb t1.c
t1.c: In function 'f':
t1.c:3:1: internal compiler error: in find_valid_class, at reload.c:704
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
+ /opt/rtems-4.11/bin/arm-rtems4.11-gcc -c -O1 -mthumb t1.c
t1.c: In function 'f':
t1.c:3:1: internal compiler error: in find_valid_class, at reload.c:704
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
+ /opt/rtems-4.11/bin/arm-rtems4.11-gcc -c -O0 -mthumb t1.c
t1.c: In function 'f':
t1.c:3:1: error: unable to find a register to spill in class 'GENERAL_REGS'
t1.c:3:1: error: this is the insn:
(insn 36 35 37 4 t1.c:3 (set (subreg:DF (reg:DC 147) 0)
        (reg:DF 0 r0)) 184 {*thumb_movdf_insn} (nil))
t1.c:3: confused by earlier errors, bailing out
+ /opt/rtems-4.11/bin/arm-rtems4.11-gcc -c -Os -mthumb t1.c

========================= 4.4.5
$ sh -x j
+ /opt/rtems-4.10/bin/arm-rtems4.10-gcc --version
arm-rtems4.10-gcc (GCC) 4.4.5 20101001 (RTEMS
gcc-4.4.5-4.fc13/newlib-1.18.0-19.fc13)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

+ /opt/rtems-4.10/bin/arm-rtems4.10-gcc -c -O2 -mthumb t1.c
t1.c: In function 'f':
t1.c:3: internal compiler error: in find_valid_class, at reload.c:700
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
+ /opt/rtems-4.10/bin/arm-rtems4.10-gcc -c -O1 -mthumb t1.c
t1.c: In function 'f':
t1.c:3: internal compiler error: in find_valid_class, at reload.c:700
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
+ /opt/rtems-4.10/bin/arm-rtems4.10-gcc -c -O0 -mthumb t1.c
+ /opt/rtems-4.10/bin/arm-rtems4.10-gcc -c -Os -mthumb t1.c

=========================== 4.3.2
$ sh -x j
+ /opt/rtems-4.9/bin/arm-rtems4.9-gcc --version
arm-rtems4.9-gcc (GCC) 4.3.2 20080827 (RTEMS
gcc-4.3.2-24.el5/newlib-1.16.0-24.el5)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

+ /opt/rtems-4.9/bin/arm-rtems4.9-gcc -c -O2 -mthumb t1.c
+ /opt/rtems-4.9/bin/arm-rtems4.9-gcc -c -O1 -mthumb t1.c
+ /opt/rtems-4.9/bin/arm-rtems4.9-gcc -c -O0 -mthumb t1.c
+ /opt/rtems-4.9/bin/arm-rtems4.9-gcc -c -Os -mthumb t1.c


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
                   ` (2 preceding siblings ...)
  2011-01-30 17:50 ` joel at gcc dot gnu.org
@ 2011-01-31 10:50 ` mikpe at it dot uu.se
  2011-01-31 19:04 ` ian at airs dot com
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mikpe at it dot uu.se @ 2011-01-31 10:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Mikael Pettersson <mikpe at it dot uu.se> 2011-01-31 10:34:56 UTC ---
I can reproduce the ICE with a 4.5.2 cross to arm-elf.  Only occurs for Thumb1.


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
                   ` (3 preceding siblings ...)
  2011-01-31 10:50 ` mikpe at it dot uu.se
@ 2011-01-31 19:04 ` ian at airs dot com
  2011-02-01 10:12 ` mikpe at it dot uu.se
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ian at airs dot com @ 2011-01-31 19:04 UTC (permalink / raw)
  To: gcc-bugs

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

Ian Lance Taylor <ian at airs dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.01.31 18:24:35
     Ever Confirmed|0                           |1

--- Comment #5 from Ian Lance Taylor <ian at airs dot com> 2011-01-31 18:24:35 UTC ---
Marking as confirmed.


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
                   ` (4 preceding siblings ...)
  2011-01-31 19:04 ` ian at airs dot com
@ 2011-02-01 10:12 ` mikpe at it dot uu.se
  2011-02-01 10:25 ` rearnsha at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mikpe at it dot uu.se @ 2011-02-01 10:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Mikael Pettersson <mikpe at it dot uu.se> 2011-02-01 10:11:52 UTC ---
The bug started to occur at r140501:

Author: pinskia
Date: Fri Sep 19 22:24:06 2008
New Revision: 140501

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140501
Log:
2008-09-19  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/30930
        * tree-ssa.c (execute_update_addresses_taken): Also update
        DECL_GIMPLE_REG_P for vector and complex types.

But given Ian's observation and proposed patch I suspect r140501 is innocent
and merely triggers a bug in the ARM backend.


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
                   ` (5 preceding siblings ...)
  2011-02-01 10:12 ` mikpe at it dot uu.se
@ 2011-02-01 10:25 ` rearnsha at gcc dot gnu.org
  2011-02-28  4:17 ` ramana at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2011-02-01 10:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Richard Earnshaw <rearnsha at gcc dot gnu.org> 2011-02-01 10:24:33 UTC ---
(In reply to comment #1)
> Created attachment 23166 [details]
> Possible patch
> 
> This is a possible patch for this bug.  It fixes what appears to be an obvious
> bug in the code, and it fixes this test case.  However, I am not set up to test
> the ARM target.  Perhaps one of the ARM maintainers could give this patch a
> try.

Looks sensible to me. But please update comment.


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
                   ` (6 preceding siblings ...)
  2011-02-01 10:25 ` rearnsha at gcc dot gnu.org
@ 2011-02-28  4:17 ` ramana at gcc dot gnu.org
  2011-03-25 20:10 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ramana at gcc dot gnu.org @ 2011-02-28  4:17 UTC (permalink / raw)
  To: gcc-bugs

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

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ramana at gcc dot gnu.org
   Target Milestone|---                         |4.6.0


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
                   ` (7 preceding siblings ...)
  2011-02-28  4:17 ` ramana at gcc dot gnu.org
@ 2011-03-25 20:10 ` jakub at gcc dot gnu.org
  2011-04-28 16:51 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-25 20:10 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.0                       |4.6.1

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-25 19:53:15 UTC ---
GCC 4.6.0 is being released, adjusting target milestone.


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
                   ` (8 preceding siblings ...)
  2011-03-25 20:10 ` jakub at gcc dot gnu.org
@ 2011-04-28 16:51 ` rguenth at gcc dot gnu.org
  2013-07-10 10:59 ` sebastian.huber@embedded-brains.de
  2015-01-02 20:53 ` joel at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-04-28 16:51 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.1                       |---


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
                   ` (9 preceding siblings ...)
  2011-04-28 16:51 ` rguenth at gcc dot gnu.org
@ 2013-07-10 10:59 ` sebastian.huber@embedded-brains.de
  2015-01-02 20:53 ` joel at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: sebastian.huber@embedded-brains.de @ 2013-07-10 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

Sebastian Huber <sebastian.huber@embedded-brains.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sebastian.huber@embedded-br
                   |                            |ains.de

--- Comment #9 from Sebastian Huber <sebastian.huber@embedded-brains.de> ---
I cannot reproduce this problem with GCC 4.6.4 and 4.8.1.


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

* [Bug target/47540] ARM THUMB crash with complex numbers
  2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
                   ` (10 preceding siblings ...)
  2013-07-10 10:59 ` sebastian.huber@embedded-brains.de
@ 2015-01-02 20:53 ` joel at gcc dot gnu.org
  11 siblings, 0 replies; 13+ messages in thread
From: joel at gcc dot gnu.org @ 2015-01-02 20:53 UTC (permalink / raw)
  To: gcc-bugs

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

Joel Sherrill <joel at gcc dot gnu.org> changed:

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

--- Comment #10 from Joel Sherrill <joel at gcc dot gnu.org> ---
Based on Sebastian's last comment, I am marking this as resolved/fixed.


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

end of thread, other threads:[~2015-01-02 20:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-30  9:44 [Bug target/47540] New: ARM THUMB crash with complex numbers ian at airs dot com
2011-01-30 10:24 ` [Bug target/47540] " ian at airs dot com
2011-01-30 13:34 ` mikpe at it dot uu.se
2011-01-30 17:50 ` joel at gcc dot gnu.org
2011-01-31 10:50 ` mikpe at it dot uu.se
2011-01-31 19:04 ` ian at airs dot com
2011-02-01 10:12 ` mikpe at it dot uu.se
2011-02-01 10:25 ` rearnsha at gcc dot gnu.org
2011-02-28  4:17 ` ramana at gcc dot gnu.org
2011-03-25 20:10 ` jakub at gcc dot gnu.org
2011-04-28 16:51 ` rguenth at gcc dot gnu.org
2013-07-10 10:59 ` sebastian.huber@embedded-brains.de
2015-01-02 20:53 ` joel 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).