https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67448

            Bug ID: 67448
           Summary: compiler crash#inline assembly#rvalue operand with
                    constraint "m"
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barannikov88 at gmail dot com
  Target Milestone: ---

$ cat t1.c
void f(int i)
{
    __asm("" : : "m"(i += 1));
}

$gcc t1.c -S
t1.c: In function 'f':
t1.c:3:24: internal compiler error: in expand_gimple_stmt_1, at
cfgexpand.c:3391
     __asm("" : : "m"(i += 1));
                        ^
0x82b4249 expand_gimple_stmt_1
        ../../gcc-5.1.0.src/gcc/cfgexpand.c:3390
0x82b4249 expand_gimple_stmt
        ../../gcc-5.1.0.src/gcc/cfgexpand.c:3497
0x82b7746 expand_gimple_basic_block
        ../../gcc-5.1.0.src/gcc/cfgexpand.c:5509
0x82b9356 execute
        ../../gcc-5.1.0.src/gcc/cfgexpand.c:6127
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

The operand is an rvalue and should be restricted from using within this
context, like 'i++' is. Strangely enough, 'i = 0' is allowed despite of the
fact that it is also an rvalue.

Reply via email to