-
Notifications
You must be signed in to change notification settings - Fork 6
Crash on literal strings #11
Copy link
Copy link
Open
Description
The following program crashes while being parsed (?) by clang:
struct device_information {
unsigned id_lo, id_hi;
unsigned version;
unsigned manufacturer_lo, manufacturer_hi;
};
void get_device_information(unsigned device_number,
struct device_information *info) {
asm volatile (
"HWQ %5\n"
"SET %0, A\n"
"SET %1, B\n"
"SET %2, C\n"
"SET %3, X\n"
"SET %4, Y"
:
"=g" (info->id_lo),
"=g" (info->id_hi),
"=g" (info->version),
"=g" (info->manufacturer_lo),
"=g" (info->manufacturer_hi)
:
"r" (device_number)
:
// Clobbered registers
"A", "B", "C", "X", "Y");
}If the asm string is concatenated into one line ("HWQ %5\nSET %0, A\nSET %1, B\nSET %2, C\nSET %3, X\nSET %4, Y"), everything works as it should.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels