[Bug regression/23328] Improper removal of struct field assignments by optimizer

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Aug 11 16:48:00 GMT 2005


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-11 16:48 -------
The code is invalid as you don't say you going to access memory.
either mark the asm as clobbers memory (which is not fully true) or use the following replacement asm 
(which works):
    asm("mov 0(%%esi),%%eax; mov 4(%%esi),%%edx; add %%edx,%%eax;"
        : "=a" (c)
        : "S" (&args)
        ,"m" (args)
        : "edx");

It says to the compiler that args is accessed as memory.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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



More information about the Gcc-bugs mailing list