Potential problem with variable handling - Was: Handling of local variables in the backend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 12 September 2017 at 22:54, Dibyendu Majumdar <mobile@xxxxxxxxxxxxxxx> wrote:
> One issue I am facing at the moment is that there is no explicit
> alloca for each symbol that is used in a function - so that the
> backend has to detect when a symbol is accessed and then do alloca to
> associate stack space. In the LLVM backend this is not so much an
> issue as LLVM allows instructions to be inserted at a particular point
> - so my code just ensures that all the allocas go at the start of the
> function as required by LLVM. But I am having trouble with the other
> backend that doesn't have this capability.
>

I have been thinking about this issue for some time - i.e. that the
Sparse IR does not explicitly define or initialize local variables.
The back-end deals with it by doing it at first access. But this could
result in incorrect behavior if the initialization was meant to occur
at a certain point in the code. I should probably try to prove this
theory by creating a test - but intuitively it seems that if the
programmer had meant to initialize a variable at a particular point,
there could be a reason why it should be done at that point and not
some point later.

Regards
Dibyendu
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux