<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://sourceware.org/bugzilla/page.cgi?id=bugzilla.dtd">

<bugzilla version="4.4+"
          urlbase="http://sourceware.org/bugzilla/"
          
          maintainer="overseers@sourceware.org"
>

    <bug>
          <bug_id>2626</bug_id>
          
          <creation_ts>2006-05-01 09:07:00 +0000</creation_ts>
          <short_desc>Problems with LPM on attiny26</short_desc>
          <delta_ts>2008-02-14 13:04:50 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>binutils</product>
          <component>gas</component>
          <version>2.16</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hakan Ardo">hakan</reporter>
          <assigned_to>unassigned</assigned_to>
          <cc>bug-binutils</cc>
    
    <cc>eric.weddington</cc>
    
    <cc>joachim.falk</cc>
          <cf_gcchost>i486-linux-gnu</cf_gcchost>
          <cf_gcctarget>avr</cf_gcctarget>
          <cf_gccbuild>i486-linux-gnu</cf_gccbuild>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>9865</commentid>
    <comment_count>0</comment_count>
    <who name="Hakan Ardo">hakan</who>
    <bug_when>2006-05-01 09:07:00 +0000</bug_when>
    <thetext>Forwarding debian bug #362270 from Terran Melconian &lt;terran@consistent.org&gt;:

The attiny26 supports some forms of the LPM (load program memory)
instruction, but under certain circumstances GAS produces an incorrect
error claiming that it does not.

There are three forms of the LPM instruction.  They are:

    i.	    LPM			(r0 is implied destination)
    ii.	    LPM destreg, Z
    iii.    LPM	destreg, Z+

(reference: Atmel AVR instruction set reference, revision 06/99, page
79)

Of these, the attiny26 supports forms i and ii but not iii.
(reference:  Atmel attiny26 datasheet, revision 1477G 03/05, page 170)

avr-as will assemble form i, but refuses to assemble forms ii or iii.
Since the datasheet states that form ii *is* supported on this part, I
believe this to be a bug.

Of course it is possible that it is an error in the manufacturer&apos;s
datasheet, and that as&apos; behavior is in fact correct, but barring
explicit information to the contrary I must assume that the
manufacturer&apos;s datasheet is authoritative.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21542</commentid>
    <comment_count>1</comment_count>
      <attachid>2236</attachid>
    <who name="Joachim Falk">joachim.falk</who>
    <bug_when>2008-02-06 20:42:58 +0000</bug_when>
    <thetext>Created attachment 2236
The FIX. Patch is against GNU assembler 2.17.50 20060817 Debian GNU/Linux + coff-avr-patch (20050630)

The bugfix has been tested with attiny26 and attiny2313.
Where gas now allows lpm r,z for attiny26 but generates
&quot;xxx.S:Nr: Error: postincrement not supported&quot; errors
for lpm r,z+. As before attiny2313 allow both forms of
the lpm instruction.

Cheers,
Joachim Falk</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21667</commentid>
    <comment_count>2</comment_count>
    <who name="Nick Clifton">nickc</who>
    <bug_when>2008-02-14 13:04:50 +0000</bug_when>
    <thetext>Hi Hakan,

  Thanks for submitting this fix.  I have applied it along with these changelog
entries.

Cheers
  Nick

include/opcode/ChangeLog
2008-02-14  Hakan Ardo  &lt;hakan@debian.org&gt;

	PR gas/2626
	* avr.h (AVR_ISA_2xxe): Define.

gas/ChangeLog
2008-02-14  Hakan Ardo  &lt;hakan@debian.org&gt;

	PR gas/2626
	* config/tc-avr.c (mcu_types): Change the ISA tyoe of the attiny26
	to AVR_ISA_2xxe.
	(avr_operand): Disallow post-increment addressing in the lpm
	instruction for the attiny26.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21669</commentid>
    <comment_count>3</comment_count>
    <who name="Hakan Ardo">hakan</who>
    <bug_when>2008-02-14 15:10:40 +0000</bug_when>
    <thetext>Subject: Re:  Problems with LPM on attiny26

Hi,
I only forwarded this bugrepport from the debian bts, the fix was done
(as far as I can tell) by joachim dot falk at gmx dot de, and you
should probably contribute it to him and not to me.

On 14 Feb 2008 13:04:51 -0000, nickc at redhat dot com
&lt;sourceware-bugzilla@sourceware.org&gt; wrote:
&gt;
&gt;  ------- Additional Comments From nickc at redhat dot com  2008-02-14 13:04 -------
&gt;  Hi Hakan,
&gt;
&gt;   Thanks for submitting this fix.  I have applied it along with these changelog
&gt;  entries.
&gt;
&gt;  Cheers
&gt;   Nick
&gt;
&gt;  include/opcode/ChangeLog
&gt;  2008-02-14  Hakan Ardo  &lt;hakan@debian.org&gt;
&gt;
&gt;         PR gas/2626
&gt;         * avr.h (AVR_ISA_2xxe): Define.
&gt;
&gt;  gas/ChangeLog
&gt;  2008-02-14  Hakan Ardo  &lt;hakan@debian.org&gt;
&gt;
&gt;         PR gas/2626
&gt;         * config/tc-avr.c (mcu_types): Change the ISA tyoe of the attiny26
&gt;         to AVR_ISA_2xxe.
&gt;         (avr_operand): Disallow post-increment addressing in the lpm
&gt;         instruction for the attiny26.
&gt;
&gt;
&gt;  --
&gt;            What    |Removed                     |Added
&gt;  ----------------------------------------------------------------------------
&gt;              Status|WAITING                     |RESOLVED
&gt;          Resolution|                            |FIXED
&gt;
&gt;
&gt;
&gt;
&gt;  http://sourceware.org/bugzilla/show_bug.cgi?id=2626
&gt;
&gt;  ------- You are receiving this mail because: -------
&gt;  You reported the bug, or are watching the reporter.
&gt;



</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>2236</attachid>
            <date>2008-02-06 20:42:00 +0000</date>
            <delta_ts>2008-02-06 20:42:58 +0000</delta_ts>
            <desc>The FIX. Patch is against GNU assembler 2.17.50 20060817 Debian GNU/Linux + coff-avr-patch (20050630)</desc>
            <filename>970-binutils-20060817-avr-attiny26-lpm.patch</filename>
            <type>text/plain</type>
            <size>1622</size>
            <attacher name="Joachim Falk">joachim.falk</attacher>
            
              <data encoding="base64">LS0tIGJpbnV0aWxzLTIwMDYwODE3LTEvaW5jbHVkZS9vcGNvZGUvYXZyLmgub3JpZwkyMDA4LTAy
LTA2IDEzOjAwOjE3LjAwMDAwMDAwMCArMDEwMAorKysgYmludXRpbHMtMjAwNjA4MTctMS9pbmNs
dWRlL29wY29kZS9hdnIuaAkyMDA4LTAyLTA2IDE5OjA4OjE2LjAwMDAwMDAwMCArMDEwMApAQCAt
MzQsNiArMzQsOCBAQAogI2RlZmluZSBBVlJfSVNBX1RJTlkxIChBVlJfSVNBXzEyMDAgfCBBVlJf
SVNBX0xQTSkKICNkZWZpbmUgQVZSX0lTQV9QV014ICAoQVZSX0lTQV9NOCAgIHwgQVZSX0lTQV9C
UkspCiAjZGVmaW5lIEFWUl9JU0FfMnh4eCAgKEFWUl9JU0FfVElOWTEgfCBBVlJfSVNBX1NSQU0p
CisvKiBTcGVjaWFsIGhhY2sgaW4gdGMtYXZyLmMgYXR0aW55MjYgaXMgbWlzc2luZyBMUE0gUmQs
WisgKi8KKyNkZWZpbmUgQVZSX0lTQV8yeHhlICAoQVZSX0lTQV8yeHh4IHwgQVZSX0lTQV9MUE1Y
KQogI2RlZmluZSBBVlJfSVNBX1RJTlkyIChBVlJfSVNBXzJ4eHggfCBBVlJfSVNBX01PVlcgfCBB
VlJfSVNBX0xQTVggfCBcCiAgICAgICAgICAgICAgICAgICAgICAgIEFWUl9JU0FfU1BNICB8IEFW
Ul9JU0FfQlJLKQogI2RlZmluZSBBVlJfSVNBX004ICAgIChBVlJfSVNBXzJ4eHggfCBBVlJfSVNB
X01VTCB8IEFWUl9JU0FfTU9WVyB8IFwKLS0tIGJpbnV0aWxzLTIwMDYwODE3LTEvZ2FzL2NvbmZp
Zy90Yy1hdnIuYy5vcmlnCTIwMDgtMDItMDYgMTI6NTY6MTguMDAwMDAwMDAwICswMTAwCisrKyBi
aW51dGlscy0yMD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