Clarification on alloca semantics

According to the language reference:

The ‘alloca‘ instruction allocates memory on the stack frame of the currently executing function, to be automatically released when this function returns to its caller. The object is always allocated in the generic address space (address space zero).

The last sentence specifies where the memory is allocated, but it’s not clear precisely what “allocated in the generic address space” means. For architectures with a segmented memory layout, allocating “in” the generic address space may not make sense. Instead, you allocate in a specific address space, and create a “generic” pointer to that allocation. Is this a legal interpretation of the language reference?

If so, I would like to make the text in the language reference more explicit that this is allowed. If not, I would like to petition to make this legal. Something along the lines of:

The object is allocated in a target-defined memory space and the returned pointer is always in the generic address space (address space zero).

Is there any reason why it is saying "generic address space (address space
zero)" and not just "address space zero"?

-- Sean Silva

Good question. As far as I know, there is no specification that dictates address space 0 is a “generic” address space for the target.