ARM for v7-m states
POP
SP cannot be in the list
and GCC obliges with an error message for v7m
"Error: invalid register list to push/pop instruction -- `pop {sp}'"
Differential D6819
[ARM] Correct POP reglist handling jyoti.allur on Dec 31 2014, 8:22 AM. Authored by
Details
ARM for v7-m states and GCC obliges with an error message for v7m
Diff Detail Event TimelineComment Actions This is incorrect. pop {sp} is permitted on armv7-a and armv7-r. You are correct, I did not correctly account for armv7-m. This would result in incorrect behavior on the A/R targets. Comment Actions Hi Compnerd, Some tests with GNU assembler lead me to think pop {sp} is not permitted in v7 a/r targets as well in thumb mode though. GNU assembler results :-cat ldmstm.s POP(Thumb) mode v7 a/rarm-linux-gnueabi-as -march=armv7r -mthumb ldmstm.s arm-linux-gnueabi-as -march=armv7a -mthumb ldmstm.s Without this patch, SP was allowed in POP(Thumb mode) for v7 A/R targets, resulting in This patch does not affect POP(ARM mode) for v7 A/R targets as it is handled in getARMLoadDeprecationInfo. Comment Actions The current revision of the ARM ARM seems to indicate that pop {sp} is permitted. I think that this may be a bug in GAS (its tricky since ldm {sp} is not permitted, but pop can be relaxed to a ldm). I think for now, being more conservative and just changing the IsPop to IsARPop and passing that information along might be the better solution. Comment Actions Alright, modified accordingly. Comment Actions Hi Saleem,
Comment Actions I agree with jroelofs' suggestion about the test changes. I think that would make it easier to maintain as well.
|
The variable here is unnecessary. I would just inline the call to !isMClass() not the call to validateLDMRegList.