public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug translation/61561] New: arm gcc internal error
@ 2014-06-19 13:00 m.zakirov at samsung dot com
  2014-06-19 13:17 ` [Bug translation/61561] " ktkachov at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: m.zakirov at samsung dot com @ 2014-06-19 13:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61561
           Summary: arm gcc internal error
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: translation
          Assignee: unassigned at gcc dot gnu.org
          Reporter: m.zakirov at samsung dot com

Created attachment 32973
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32973&action=edit
Proposed patch

To reproduce the issue do:
1) Configure gcc for arm as traget and x86 as host.
$ ./configure --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=arm-v7a15v5r2-linux-gnueabi
--prefix=/home/mzakirov/proj/gcc_arm_ref/arm-v7a15v5r2
--with-sysroot=/your_arm/sys-root
2) make -j6
3) make install
4) Compile following:
$ cat ex.c
int dummy(int a);

char a;

void mmm (void)
{
  char dyn[ dummy(3) ];
  a = (char)&dyn[0];
}
$ gcc -O3 ex.c -o ex.o 
ex.c: In function ‘mmm’:
ex.c:8:7: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
   a = (char)&dyn[0];
       ^
ex.c:9:1: internal compiler error: in check_rtl, at lra.c:1919
 }
 ^
0x8689e5 check_rtl
   
/home/mzakirov/proj/gcc_arm_ref/build.arm.cortex-a15/sources/gcc_1/gcc/lra.c:1919
0x86bde5 lra(_IO_FILE*)
   
/home/mzakirov/proj/gcc_arm_ref/build.arm.cortex-a15/sources/gcc_1/gcc/lra.c:2309
0x82b02e do_reload
   
/home/mzakirov/proj/gcc_arm_ref/build.arm.cortex-a15/sources/gcc_1/gcc/ira.c:5325
0x82b02e execute
   
/home/mzakirov/proj/gcc_arm_ref/build.arm.cortex-a15/sources/gcc_1/gcc/ira.c:5486
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.

Analysis showed that the problem in instruction like:
(insn 26 12 18 2 (set (reg:QI 2 r2)
        (reg:QI 13 sp)) ex.c:8 205 {*arm_movqi_insn}
     (nil))
gcc cse propogates sp register to (char/short) cast from a pointer (32 bit
value) and reload phase fails because gcc do not founds applicable template for
loading a byte or word from sp.
Adding correct template to arm.md fixes the issue. See attached patch.

Note: that issue appeared while translating linux kernel for arm.
>From gcc-bugs-return-454551-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jun 19 13:06:17 2014
Return-Path: <gcc-bugs-return-454551-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 12271 invoked by alias); 19 Jun 2014 13:06:17 -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 12233 invoked by uid 48); 19 Jun 2014 13:06:13 -0000
From: "ktkachov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug translation/61561] arm gcc internal error
Date: Thu, 19 Jun 2014 13:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: translation
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: major
X-Bugzilla-Who: ktkachov 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: bug_status cf_reconfirmed_on cc everconfirmed cf_known_to_fail
Message-ID: <bug-61561-4-bkTjnKFeO3@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61561-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61561-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: 2014-06/txt/msg01633.txt.bz2
Content-length: 752

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida561

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-06-19
                 CC|                            |ktkachov at gcc dot gnu.org
     Ever confirmed|0                           |1
      Known to fail|                            |4.10.0, 4.8.3, 4.9.1

--- Comment #1 from ktkachov at gcc dot gnu.org ---
Confirmed for trunk, 4.9 and 4.8.

Marat, please send the patch to gcc-patches@gcc.gnu.org with an appropriate
ChangeLog entry and the included testcase for review.


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

* [Bug translation/61561] arm gcc internal error
  2014-06-19 13:00 [Bug translation/61561] New: arm gcc internal error m.zakirov at samsung dot com
@ 2014-06-19 13:17 ` ktkachov at gcc dot gnu.org
  2014-06-19 13:20 ` ktkachov at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2014-06-19 13:17 UTC (permalink / raw)
  To: gcc-bugs

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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.7.4

--- Comment #2 from ktkachov at gcc dot gnu.org ---
Also ICEs on 4.7.4, I guess that's been this way for a while


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

* [Bug translation/61561] arm gcc internal error
  2014-06-19 13:00 [Bug translation/61561] New: arm gcc internal error m.zakirov at samsung dot com
  2014-06-19 13:17 ` [Bug translation/61561] " ktkachov at gcc dot gnu.org
@ 2014-06-19 13:20 ` ktkachov at gcc dot gnu.org
  2014-07-11  9:03 ` [Bug target/61561] " mzakirov at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2014-06-19 13:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from ktkachov at gcc dot gnu.org ---
FWIW On 4.7.4 without LRA the ICE is:
ice.c:9:1: error: insn does not satisfy its constraints:
(insn 25 12 19 2 (set (reg:QI 2 r2)
        (reg:QI 13 sp)) ice.c:8 193 {*arm_movqi_insn}
     (nil))

But 4.7 is no loner maintained, so that's more of a trivia at this point


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

* [Bug target/61561] arm gcc internal error
  2014-06-19 13:00 [Bug translation/61561] New: arm gcc internal error m.zakirov at samsung dot com
  2014-06-19 13:17 ` [Bug translation/61561] " ktkachov at gcc dot gnu.org
  2014-06-19 13:20 ` ktkachov at gcc dot gnu.org
@ 2014-07-11  9:03 ` mzakirov at gcc dot gnu.org
  2014-07-11 10:53 ` m.zakirov at samsung dot com
  2014-07-11 14:44 ` rearnsha at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: mzakirov at gcc dot gnu.org @ 2014-07-11  9:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from mzakirov at gcc dot gnu.org ---
Author: mzakirov
Date: Fri Jul 11 09:02:39 2014
New Revision: 212450

URL: https://gcc.gnu.org/viewcvs?rev=212450&root=gcc&view=rev
Log:
gcc/
2014-07-11  Marat Zakirov  <m.zakirov@samsung.com>

    PR target/61561
    * config/arm/arm.md (*movhi_insn_arch4): Handle stack pointer.
    (*movhi_bytes): Likewise.
    (*arm_movqi_insn): Likewise. 

gcc/testsuite/
2014-07-11  Marat Zakirov  <m.zakirov@samsung.com>

    PR target/61561
    * gcc.dg/pr61561.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/pr61561.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.md
    trunk/gcc/testsuite/ChangeLog


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

* [Bug target/61561] arm gcc internal error
  2014-06-19 13:00 [Bug translation/61561] New: arm gcc internal error m.zakirov at samsung dot com
                   ` (2 preceding siblings ...)
  2014-07-11  9:03 ` [Bug target/61561] " mzakirov at gcc dot gnu.org
@ 2014-07-11 10:53 ` m.zakirov at samsung dot com
  2014-07-11 14:44 ` rearnsha at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: m.zakirov at samsung dot com @ 2014-07-11 10:53 UTC (permalink / raw)
  To: gcc-bugs

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

Marat Zakirov <m.zakirov at samsung dot com> changed:

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

--- Comment #5 from Marat Zakirov <m.zakirov at samsung dot com> ---
fixed


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

* [Bug target/61561] arm gcc internal error
  2014-06-19 13:00 [Bug translation/61561] New: arm gcc internal error m.zakirov at samsung dot com
                   ` (3 preceding siblings ...)
  2014-07-11 10:53 ` m.zakirov at samsung dot com
@ 2014-07-11 14:44 ` rearnsha at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2014-07-11 14:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.10.0


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

end of thread, other threads:[~2014-07-11 14:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-19 13:00 [Bug translation/61561] New: arm gcc internal error m.zakirov at samsung dot com
2014-06-19 13:17 ` [Bug translation/61561] " ktkachov at gcc dot gnu.org
2014-06-19 13:20 ` ktkachov at gcc dot gnu.org
2014-07-11  9:03 ` [Bug target/61561] " mzakirov at gcc dot gnu.org
2014-07-11 10:53 ` m.zakirov at samsung dot com
2014-07-11 14:44 ` 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).