ATmega: Can one determine if an address is program memory or data memory?
As noted in other answer, __memx might help. Check it's description:

This is a 24-bit address space that linearizes flash and RAM: If the high bit of the address is set, data is read from RAM using the lower two bytes as RAM address. If the high bit of the address is clear, data is read from flash with RAMPZ set according to the high byte of the address. See __builtin_avr_flash_segment.

So it's possible to tell where data are stored in FLASH or RAM by checking that high bit. But let's take a look at that __builtin_avr_flash_segment description:

char __builtin_avr_flash_segment (const __memx void*)


This built-in takes a byte address to the 24-bit address space __memx and returns the number of the flash segment (the 64 KiB chunk) where the address points to. Counting starts at 0. If the address does not point to flash memory, return -1.

Seems to be just what you need. So basically you can go with this example (taken from here):
void func (void * dest, const __memx void *source) 
{ 
    if (__builtin_avr_flash_segment (source) &lt; 0)
        strcpy (dest, source);
    else
        strcpy_P (dest, source);
}

PS. I suggest to read whole Named Address Spaces manual page. It has some caveats and limatitions.