Bug 45800 - [M32C] compile error on increment volatile long var
Summary: [M32C] compile error on increment volatile long var
Status: ASSIGNED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: DJ Delorie
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2010-09-26 15:17 UTC by aesok
Modified: 2010-09-28 22:01 UTC (History)
2 users (show)

See Also:
Host:
Target: M32C
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-09-28 21:18:10


Attachments
patch (334 bytes, application/octet-stream)
2010-09-28 21:43 UTC, aesok
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aesok 2010-09-26 15:17:24 UTC
Hi!

The following code snippet leads to compile error

volatile long boo = 0;

void
foo (void)
{
  boo++;
}



[]$ /opt/m32c-elf/bin/m32c-elf-gcc -O1   -c test.c -o test.o
unconvertible operand - `Sms'(subreg:HI (mem/v/c/i:SI (symbol_ref:HI ("boo") [flags 0x2] <var_decl 0x7faa9a811000 boo>) [0 boo+0 S4 A8]) 0)
unconvertible operand - `Sms'(subreg:HI (mem/v/c/i:SI (symbol_ref:HI ("boo") [flags 0x2] <var_decl 0x7faa9a811000 boo>) [0 boo+0 S4 A8]) 2)
/tmp/ccx0sAA0.s: Assembler messages:
/tmp/ccx0sAA0.s:6: Error: Invalid literal `add.w #0x1,[-.Sms]'
/tmp/ccx0sAA0.s:7: Error: Invalid literal `adcf.w [-.Sms]'

Anatoly.
Comment 1 aesok 2010-09-28 21:43:07 UTC
Created attachment 21910 [details]
patch
Comment 2 dj@gcc.gnu.org 2010-09-28 22:01:58 UTC
Author: dj
Date: Tue Sep 28 22:01:54 2010
New Revision: 164705

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=164705
Log:
PR target/45800
* config/m32c/m32c.c (m32c_subreg): Force adjustment of subregs of
volatile MEMs.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/m32c/m32c.c