This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71372] [6/7 Regression] C++ FE drops TREE_THIS_VOLATILE in cp_fold on all tcc_reference trees
- From: "hdusel at tangerine-soft dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 03 Jun 2016 07:55:36 +0000
- Subject: [Bug c++/71372] [6/7 Regression] C++ FE drops TREE_THIS_VOLATILE in cp_fold on all tcc_reference trees
- Auto-submitted: auto-generated
- References: <bug-71372-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71372
--- Comment #15 from Hans-Peter Dusel <hdusel@tangerine-soft.de> ---
(In reply to Jakub Jelinek from comment #12)
> Created attachment 38623 [details]
> gcc7-pr71372.patch
>
> Patch I'm going to bootstrap/regtest.
Thanks guys!
I have applied this patch to official Release 6.1.0 too and want to confirm
that it will work for this too!
Now, the my example code will be compiled to correct code:
Thanks a lot! :-)
P.S: I'll attach the patch for gcc 6.1.0
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// testmodule.cpp
void fpoke ()
{
volatile unsigned short* FLASH = (volatile unsigned short*)0x20000000;
*(FLASH + 0) = 0xAA;
*(FLASH + 1) = 0x55;
*(FLASH + 0) = 0xA0;
}
hdusel@Merlin /cygdrive/w/tmp
$ /opt/gcc-6.1.0-myos/bin/m68k-elf-g++ -O3 testmodule.cpp -c
hdusel@Merlin /cygdrive/w/tmp
$ /opt/gcc-6.1.0-myos/m68k-elf/bin/objdump.exe -d ./testmodule.o
./testmodule.o: file format elf32-m68k
Disassembly of section .text:
00000000 <_Z5fpokePvsii>:
0: 4e56 0000 linkw %fp,#0
4: 207c 8000 0000 moveal #-2147483648,%a0
a: 4e5e unlk %fp
c: 7055 moveq #85,%d0
e: 30bc 00aa movew #170,%a0@
12: 33c0 8000 0002 movew %d0,80000002 <_Z5fpokePvsii+0x80000002>
18: 30bc 00a0 movew #160,%a0@
1c: 4e75 rts