On 01/26/2016 09:17 AM, Jens Vankeirsbilck wrote:
Hi all
While testing a GCC plugin I wrote, I came across something very strange.
The plugin inserts extra code into a C++ program on the RTL level. The code that produces the "magic" is as follows:
someMethod(){
someInstructions()
FOR_EACH_BB_FN(){
someMoreInstructions()
}
evenMoreInstructions()
}
Now, the strange part:
Within the "FOR_EACH_BB_FN" loop, I create and emit an insn that contains a CONST_INT(VOIDmode, 32) rtx.
Once out of that "FOR_..." loop, the value of 32 gets changed to 28, for no apparent reason! I do not touch that emitted insn anymore, yet somehow the value of 32 is changed into 28.
Also, this only happens with the value 32. I also create the same kinds of insn's with values like 8, 64 or 262144 and they hold there value.
Can someone explain to me why this happens?
There's a structure sharing problem somewhere -- many nodes in the IL
are shared.
jeff