2008/7/16 Ian Lance Taylor <[EMAIL PROTECTED]>: > "Mohamed Shafi" <[EMAIL PROTECTED]> writes: > >> I am involved in the porting of gcc 4.1.2 for 16 bit target. For this >> target size of long long is 32bits. For the following code >> >> #define VALUE 0x1B4E81B4E81B4DLL > > That is not a 32-bit value. > > >> #define AFTER 0x55 >> >> //void test (int n, long long q, int y); >> void test (int n, ...); >> >> int >> main () >> { >> test (1, VALUE, AFTER); >> exit(0); >> } >> >> i find that the machine mode of the arguments of test are HImode, >> DImode and HImode. When replace function 'test' with normal one >> instead of varargs i find that the machine modes are HImode, SImode >> and HImode respectively. >> My question is even if the function is a vararg function shouldn't the >> mode of the argument be SImode instead of DImode since long long is >> only 32bit for the target? > > The value is too big for a long long. When you specify the type, gcc > is forced to convert (I hope you can get a warning for that). When > you don't specify the type, gcc does not convert. The resulting value > has a type which can only be expressed using a gcc extension.
So the behavior that i am getting is a proper one. > > If you change the TARGET_SCALAR_MODE_SUPPORTED_P hook to reject all > modes larger than SImode, you may get a different result--probably > some sort of error. Yes this is one option that i dint think about. But let me ask you some thing. for my target when returning structures will use registers, if its available. So a structure that has size of 16x4 will be given 4 registers (i.e DImode). So if i use this hook will the structure returning work properly? I mean will they be broken down into two 32bit data types? Shafi