Comment 1 for bug 1812887

Revision history for this message
Ramana Radhakrishnan (ramana) wrote :

The testcase is not compilable and there is no input on the options that are required to provoke this code generation.

Modifying the testcase to

#include <stdint.h>
static uint8_t * ram;
static uint8_t * Memory;
unsigned int ram_addr;

void ram_emulator_byte_write(unsigned int gpio)
{
   uint8_t data = gpio & 0xFF;
   ram[ram_addr] = data;
   Memory[3] = data;
}

with a recent gcc 7 and using -O2 -march=armv6 produces

am_emulator_byte_write:
 @ args = 0, pretend = 0, frame = 0
 @ frame_needed = 0, uses_anonymous_args = 0
 @ link register save eliminated.
 ldr r2, .L3
 mov r3, #0
 ldr r2, [r2]
 strb r0, [r2]
 strb r3, [r3, #3]
 .inst 0xe7f000f0
.L4:
 .align 2
.L3:
 .word ram_addr

At this point I am speculating about code generated as the example is incomplete.