Bug 62261 - [sh64] ICE for negative shift counts
Summary: [sh64] ICE for negative shift counts
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.9.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2014-08-25 23:27 UTC by Kazumoto Kojima
Modified: 2014-09-02 22:36 UTC (History)
1 user (show)

See Also:
Host:
Target: sh64-*
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kazumoto Kojima 2014-08-25 23:27:21 UTC
This was reported originally by dhowells at #c7 of PR62111.

void foo (unsigned long long x)
{
  bar (x << -1);
}

causes an error: unrecognizable insn:

(insn 7 6 8 2 (set (reg:DI 160 [ D.1442 ])
        (ashift:DI (reg:DI 161)
            (const_int -1 [0xffffffffffffffff]))) xx.c:3 -1
     (nil))

A possible patch is proposed at #c14 of PR62111.
Comment 1 Kazumoto Kojima 2014-08-27 23:25:46 UTC
Author: kkojima
Date: Wed Aug 27 23:25:14 2014
New Revision: 214612

URL: https://gcc.gnu.org/viewcvs?rev=214612&root=gcc&view=rev
Log:
        PR target/62261
        * config/sh/sh.md (ashlsi3): Handle negative shift count for
	TARGET_SHMEDIA.
	(ashldi3, ashrsi3, ashrdi3, lshrsi3, lshrdi3): Likewise.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/sh/sh.md
Comment 2 Kazumoto Kojima 2014-09-02 22:33:00 UTC
Author: kkojima
Date: Tue Sep  2 22:32:29 2014
New Revision: 214833

URL: https://gcc.gnu.org/viewcvs?rev=214833&root=gcc&view=rev
Log:
        PR target/62261
        * config/sh/sh.md (ashlsi3): Handle negative shift count for
	TARGET_SHMEDIA.
	(ashldi3, ashrsi3, ashrdi3, lshrsi3, lshrdi3): Likewise.


Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/config/sh/sh.md
Comment 3 Kazumoto Kojima 2014-09-02 22:36:08 UTC
Fixed.