Bug 41885 - AVR Rotate patterns do not correctly consider overlap.
Summary: AVR Rotate patterns do not correctly consider overlap.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2009-10-31 00:29 UTC by Andy Hutchinson
Modified: 2011-07-02 17:54 UTC (History)
3 users (show)

See Also:
Host: i486-linux-gnu
Target: avr-*-*
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 Andy Hutchinson 2009-10-31 00:29:45 UTC
Rotate patterns that split byte sized rotates into moves do not correctly consider overlap of operands.

This was noted on a similar but different shift bug 

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

and detailed here

http://lists.gnu.org/archive/html/avr-gcc-list/2009-03/msg00158.html

Bug raised to reference separate testcase and fix.
Comment 1 Andy Hutchinson 2009-10-31 00:38:26 UTC
Subject: Bug 41885

Author: hutchinsonandy
Date: Sat Oct 31 00:38:10 2009
New Revision: 153773

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=153773
Log:
PR target/41885
* gcc.target/avr/torture/pr41885.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/avr/torture/pr41885.c
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 2 Andy Hutchinson 2010-01-08 23:02:01 UTC
Subject: Bug 41885

Author: hutchinsonandy
Date: Fri Jan  8 23:01:45 2010
New Revision: 155746

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155746
Log:
2010-01-08  Andy Hutchinson  <hutchinsonandy@gcc.gnu.org>

  PR target/41885
  * avr.md (rotlqi3): Add CONST_INT_P check.
  (rotlhi3): Delete.
  (rotlhi3_8): Delete.
  (rotlsi3): Delete.
  (rotlsi3_8): Delete.
  (rotlsi3_16): Delete.
  (rotlsi3_24): Delete.
  (rotl<mode>3): New.
  (*rotw<mode>3): New.
  (*rotb<mode>3): New.
  *avr.c (avr_rotate_bytes): New function.
  *avr-proto.h (avr_rotate_bytes): New function. 

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/avr/avr-protos.h
    trunk/gcc/config/avr/avr.c
    trunk/gcc/config/avr/avr.md

Comment 3 Georg-Johann Lay 2011-07-02 17:54:09 UTC
Fixed with Andy's patch. 4.5.0 passes the testcase.