GCC 3.4-20041224: __attribute__ ((regparm)) misbehaviour
This program:
static
int x(int y)__attribute__ ((regparm(1)));
static
int x(int y)
{
return y;
}can't be compiled with GCC 3.4.4 20041224. The compiler complains:
y-bug.c:7: error: conflicting types for 'x' y-bug.c:3: error: previous declaration of 'x' was here y-bug.c:7: error: conflicting types for 'x' y-bug.c:3: error: previous declaration of 'x' was here
It seems that it's a bug.
Quoted 7 lines · Denis Zaitsev
This program:
static
int x(int y)__attribute__((regparm(1)));
Quoted 6 lines
static
int x(int y){ return y; }
No this is not a bug. You need regparm attribute on the function definition too.
-- Pinski
Quoted 17 lines · Andrew Pinski
Quoted 7 lines · Denis Zaitsev
This program:
static
int x(int y)__attribute__((regparm(1)));Quoted 6 lines
static
int x(int y){ return y; }
Quoted 2 lines
No this is not a bug. You need regparm attribute on the function definition too.
Hmm... Is it regparm-only related? And is it something new though? GCC 3.3.x doesnt show this behaviour.
Quoted 2 lines · Denis Zaitsev
Hmm... Is it regparm-only related? And is it something new though? GCC 3.3.x doesnt show this behaviour.
Read <http://gcc.gnu.org/ml/gcc/2004-03/msg00039.html>.
-- Pinski
Quoted 5 lines · Andrew Pinski
Quoted 2 lines · Denis Zaitsev
Hmm... Is it regparm-only related? And is it something new though? GCC 3.3.x doesnt show this behaviour.
Ok, thanks.