public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/65163] New: [5 Regression][SH] ICE in decompose at rtl.h:2007
Date: Sun, 22 Feb 2015 13:17:00 -0000	[thread overview]
Message-ID: <bug-65163-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 65163
           Summary: [5 Regression][SH] ICE in decompose at rtl.h:2007
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: olegendo at gcc dot gnu.org
            Target: sh*-*-*

The following example:

typedef unsigned int uint32_t;
union unaligned_32 { uint32_t l; } __attribute__((packed));

int
test (unsigned char* buf, int bits_per_component)
{
  (((union unaligned_32 *)(buf))->l) = __builtin_bswap32 (bits_per_component ==
10 ? 1 : 0);

  return 0;
}


compiled with -m4 -ml -O2 results in:

 internal compiler error: in decompose, at rtl.h:2007
 }
 ^
0x8708fa1 wi::int_traits<std::pair<rtx_def*, machine_mode> >::decompose(long
long*, unsigned int, std::pair<rtx_def*, machine_mode> const&)
    ../../gcc-trunk/gcc/rtl.h:2005
0x8708fa1 wi::int_traits<std::pair<rtx_def*, machine_mode> >::decompose(long
long*, unsigned int, std::pair<rtx_def*, machine_mode> const&)
    ../../gcc-trunk/gcc/simplify-rtx.c:3717
0x8708fa1 wide_int_ref_storage<std::pair<rtx_def*, machine_mode> >
    ../../gcc-trunk/gcc/wide-int.h:948
0x8708fa1 generic_wide_int<std::pair<rtx_def*, machine_mode> >
    ../../gcc-trunk/gcc/wide-int.h:725
0x8708fa1 neg_p<std::pair<rtx_def*, machine_mode> >
    ../../gcc-trunk/gcc/wide-int.h:1694
0x8708fa1 simplify_const_binary_operation(rtx_code, machine_mode, rtx_def*,
rtx_def*)
    ../../gcc-trunk/gcc/simplify-rtx.c:4029
0x87077e3 simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
    ../../gcc-trunk/gcc/simplify-rtx.c:1987
0x870a9b6 simplify_gen_binary
    ../../gcc-trunk/gcc/simplify-rtx.c:212
0x8b6b047 if_then_else_cond
    ../../gcc-trunk/gcc/combine.c:8885
0x8b73a22 combine_simplify_rtx
    ../../gcc-trunk/gcc/combine.c:5492
0x8b7679f subst
    ../../gcc-trunk/gcc/combine.c:5429
0x8b76518 subst
    ../../gcc-trunk/gcc/combine.c:5374
0x8b76518 subst
    ../../gcc-trunk/gcc/combine.c:5374
0x8b78f03 try_combine
    ../../gcc-trunk/gcc/combine.c:3273
0x8b7f44f combine_instructions
    ../../gcc-trunk/gcc/combine.c:1309
0x8b7f44f rest_of_handle_combine
    ../../gcc-trunk/gcc/combine.c:14194
0x8b7f44f execute
    ../../gcc-trunk/gcc/combine.c:14237

... when combine tries to simplify the following rtx:

(and:SI (rotate:SI (reg:SI 170)
        (const_int 16 [0x10]))
    (const_int 4294901760 [0xffff0000]))

The problem is that in sh.md the constant 0xffff0000 is not written as sign
extended hwi values.

It's actually a latent bug, which seems to have gone unnoticed so far.


             reply	other threads:[~2015-02-22 13:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-22 13:17 olegendo at gcc dot gnu.org [this message]
2015-02-22 13:48 ` [Bug target/65163] " olegendo at gcc dot gnu.org
2015-02-23 10:18 ` rguenth at gcc dot gnu.org
2015-02-23 20:21 ` olegendo at gcc dot gnu.org
2015-02-23 21:06 ` olegendo at gcc dot gnu.org
2015-02-23 21:06 ` olegendo at gcc dot gnu.org
2015-02-23 21:46 ` olegendo at gcc dot gnu.org

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=bug-65163-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).