Messages in this thread | | | From | David Laight <> | Subject | RE: [PATCH v5] coresight: etm4x: avoid build failure with unrolled loops | Date | Tue, 28 Jun 2022 09:40:40 +0000 |
| |
... > > Regardless of which compiler or compiler options determine whether a > > loop can or can't be unrolled, which determines whether > > __builtin_constant_p evaluates to true when passed an expression using a > > loop induction variable, it is NEVER safe to allow the preprocessor to > > construct inline asm like: > > asm volatile (".inst (0x160 + (i * 4))" : "=r"(__val)); > > ^ expected constant expression
Can't you use (IIRC) an "=i" constraint with the C expression so that the compiler evaluates the expression and passes the correct constant value to the assembler?
David
- Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
| |