public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/57329] New: ICE with -O2 and -mthumb
@ 2013-05-19  9:30 Martin.Jansa at gmail dot com
  2013-05-19  9:30 ` [Bug c/57329] " Martin.Jansa at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Martin.Jansa at gmail dot com @ 2013-05-19  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57329
           Summary: ICE with -O2 and -mthumb
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: Martin.Jansa at gmail dot com

Created attachment 30146
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30146&action=edit
pixman-ice.c

Hi, when compiling pixman for armv4t or armv5te with thumb enabled I've noticed
ICE, disabling thumb or O2 is enough to build it without ICE.

$ arm-oe-linux-gnueabi-gcc -march=armv5te -mthumb -O2 -c pixman-ice.c -o
pixman-ice.o
pixman-ice.c: In function 'prng_srand_r':
pixman-ice.c:113:1: internal compiler error: Segmentation fault
 }
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

pixman-ice.c and preprocessed pixman-ice.E attached.


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

* [Bug c/57329] ICE with -O2 and -mthumb
  2013-05-19  9:30 [Bug c/57329] New: ICE with -O2 and -mthumb Martin.Jansa at gmail dot com
@ 2013-05-19  9:30 ` Martin.Jansa at gmail dot com
  2013-06-03  9:33 ` [Bug target/57329] " terry.guo at arm dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Martin.Jansa at gmail dot com @ 2013-05-19  9:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Martin Jansa <Martin.Jansa at gmail dot com> ---
Created attachment 30147
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30147&action=edit
pixman-ice.E


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

* [Bug target/57329] ICE with -O2 and -mthumb
  2013-05-19  9:30 [Bug c/57329] New: ICE with -O2 and -mthumb Martin.Jansa at gmail dot com
  2013-05-19  9:30 ` [Bug c/57329] " Martin.Jansa at gmail dot com
@ 2013-06-03  9:33 ` terry.guo at arm dot com
  2013-06-12 16:23 ` Martin.Jansa at gmail dot com
  2013-07-10 22:32 ` ramana at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: terry.guo at arm dot com @ 2013-06-03  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |terry.guo at arm dot com

--- Comment #2 from Terry Guo <terry.guo at arm dot com> ---
The case has operations on vector for Thumb-1 targets. Thus subreg is generated
for example:

(insn 65 64 66 2 (set (subreg:SI (reg:TI 137 [ D.4126 ]) 4)
        (reg:SI 211)) 187 {*thumb1_movsi_insn}
     (nil))

The subreg:SI is supposed to be turned into normal reg:SI in subreg1 pass.
However current 4.8 branch incorrectly calculates the rtx cost of such
transformation.

Speed costs
===========
SI move: from zero cost 4, from reg cost 4
DI move: original cost 4, split cost 4 * 2
TI move: original cost 4, split cost 4 * 4
EI move: original cost 4, split cost 4 * 6

The subreg will be kept until IRA stage and causes ICE there.

With Bin's patch at http://gcc.gnu.org/ml/gcc-cvs/2013-03/msg00784.html, we
will get correct rtx cost:

Speed costs
===========
SI move: from zero cost 4, from reg cost 4
DI move: original cost 8, split cost 4 * 2
TI move: original cost 16, split cost 4 * 4
EI move: original cost 24, split cost 4 * 6

Then the split happens, we will get:

(insn 65 64 66 2 (set (reg:SI 393 [ D.4126+4 ])
        (reg:SI 211)) 187 {*thumb1_movsi_insn}
     (nil))

and then everything works well.

I believe this is the cause of the issue and am doing back port to 4.8 branch.


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

* [Bug target/57329] ICE with -O2 and -mthumb
  2013-05-19  9:30 [Bug c/57329] New: ICE with -O2 and -mthumb Martin.Jansa at gmail dot com
  2013-05-19  9:30 ` [Bug c/57329] " Martin.Jansa at gmail dot com
  2013-06-03  9:33 ` [Bug target/57329] " terry.guo at arm dot com
@ 2013-06-12 16:23 ` Martin.Jansa at gmail dot com
  2013-07-10 22:32 ` ramana at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: Martin.Jansa at gmail dot com @ 2013-06-12 16:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Martin Jansa <Martin.Jansa at gmail dot com> ---
Hi Terry,

> With Bin's patch at http://gcc.gnu.org/ml/gcc-cvs/2013-03/msg00784.html, we will get correct rtx cost.

I can confirm that with 4.8.1 + this patch I don't see ICE anymore.

> I believe this is the cause of the issue and am doing back port to 4.8 branch.

Please do, thanks.

I'll start one more build with 4.8.1 but without this patch to check that it
wasn't fixed by some other change between 4.8.0 and 4.8.1 - but if I don't
reply today, then it's really fixed by Bin's patch.


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

* [Bug target/57329] ICE with -O2 and -mthumb
  2013-05-19  9:30 [Bug c/57329] New: ICE with -O2 and -mthumb Martin.Jansa at gmail dot com
                   ` (2 preceding siblings ...)
  2013-06-12 16:23 ` Martin.Jansa at gmail dot com
@ 2013-07-10 22:32 ` ramana at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ramana at gcc dot gnu.org @ 2013-07-10 22:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |ramana at gcc dot gnu.org
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.8.2

--- Comment #5 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
fixed.


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

end of thread, other threads:[~2013-07-10 22:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-19  9:30 [Bug c/57329] New: ICE with -O2 and -mthumb Martin.Jansa at gmail dot com
2013-05-19  9:30 ` [Bug c/57329] " Martin.Jansa at gmail dot com
2013-06-03  9:33 ` [Bug target/57329] " terry.guo at arm dot com
2013-06-12 16:23 ` Martin.Jansa at gmail dot com
2013-07-10 22:32 ` ramana 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).