This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Sanjiv Kumar Gupta wrote:Programmer will get an overflow error for that during linking.
calculated by linker. Now add r1, foo add r1, 10 add r1, -10 are okay but add r1, foo + 10 add r1, -10 are not, since (foo + 10) may overflow during relocation, so the value (foo + 10) && 0xff inserted by linker is not correct.
What is stopping the value of 'foo' itself being > 255?
nathan
But the problem here is that with foo = 255, the code works without -O2, but not with -O2, which looks strange. Since -O2 (CSE) combines add r1, foo add r1, 10 to add r1, foo + 10
Thanks. --Sanjiv
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |