public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sumanth Gundapaneni <Sumanth.Gundapaneni@kpitcummins.com>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Cc: "rth@redhat.com" <rth@redhat.com>,
	"Jayant R. Sonar"	<Jayant.Sonar@kpitcummins.com>
Subject: Internal Compiler Error in gen_rtx_SUBREG,at emit-rtl.c:776 in CR16
Date: Mon, 31 Jan 2011 09:38:00 -0000	[thread overview]
Message-ID: <371569CBCFB2E745B891DBB88B2DFDDD19FA64F721@KCINPUNHJCMS01.kpit.com> (raw)

Hi,

I have been working on port with variable register widths.
We have 12 16-bit registers and 4 32-bit registers.
Registers r0 - r11 are 16-b wide and can be paired to form a 32-b register.
Registers r12,r13,r14 and r15 are 32-bit wide and out of which 
r12 - argument pointer register.
r13 - frame pointer register.
r14 - return address register.
r15 - stack pointer register. 

I faced a regression in gcc-torture test case "20070905-1.c"
when I compile the code with -O2 or higher the test case fails
with "internal compiler error: in gen_rtx_SUBREG, at emit-rtl.c:776"

After analyzing the rtl dump, I figured out that below mentioned dump is the 
reason for the failure.
(insn 46 14 47 4 20070905-1.c:17 (set (reg:HI 3 r3)
        (subreg:HI (reg/f:SI 13 r13) 0)) 64 {*movhi_short} (nil))

(insn 47 46 18 4 20070905-1.c:17 (set (reg:HI 4 r4 [+2 ])
        (subreg:HI (reg/f:SI 13 r13) 2)) 64 {*movhi_short} (nil))

The insn  47 with subreg byte value of 2 causes the ICE in 
function gen_rtx_SUBREG.
" gcc_assert (validate_subreg (mode, GET_MODE (reg), reg, offset)); "

You can find the current implementation of cr16 at the following link
http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00803.html

In addition to the patch I have made couple of changes suggested by 
Richard Henderson. http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01008.html

One among them is :: 
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)       \
  (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)           \
   ? reg_classes_intersect_p (LONG_REGS, (CLASS))        \
   : 0)
>> LONG_REGS are 32-bit registers

Please let me know if you need further information.
Your help in this regard is highly appreciated.

Thanks and Regards,
Sumanth G

 


             reply	other threads:[~2011-01-31  4:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31  9:38 Sumanth Gundapaneni [this message]
2011-01-31 19:21 ` Ian Lance Taylor
2011-02-01  9:08   ` Sumanth Gundapaneni
2011-02-01 15:19     ` Ian Lance Taylor
2011-02-01 15:22       ` Jeff Law
2011-02-04 14:15         ` Sumanth Gundapaneni
2011-02-04 15:51           ` Ian Lance Taylor
2011-02-04 16:25           ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=371569CBCFB2E745B891DBB88B2DFDDD19FA64F721@KCINPUNHJCMS01.kpit.com \
    --to=sumanth.gundapaneni@kpitcummins.com \
    --cc=Jayant.Sonar@kpitcummins.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).