Bug 15132 - __attribute__((regparm(?))) gives compiler error
Summary: __attribute__((regparm(?))) gives compiler error
Status: RESOLVED DUPLICATE of bug 15095
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-25 15:32 UTC by Lars Tetzlaff
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Tetzlaff 2004-04-25 15:32:03 UTC
The following code (an example of code used in the linux kernel) gives a
compiler error in 3.4.0. It works in 3.3.2. 

void a( int b, int c, int d ) __attribute__((regparm(3))) ;

void a( int b, int c, int d ) 
{
  b = 2;
}


gcc -v t1.c -c
Lese Spezifikationen von /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Konfiguriert mit: ../gcc-3.4.0/configure --prefix=/usr --enable-threads=posix
--with-cpu=athlon --with-tune=athlon --enable-languages=c,c++
Thread-Modell: posix
gcc-Version 3.4.0
 /usr/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1 -quiet -v t1.c -quiet -dumpbase
t1.c -mtune=athlon -auxbase t1 -version -o /tmp/ccv32PVQ.s
#include "..." - Suche beginnt hier:
#include <...> - Suche beginnt hier:
 /usr/local/include
 /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/include
 /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/include
 /usr/include
Ende der Suchliste.
GNU C version 3.4.0 (i686-pc-linux-gnu)
	compiled by GNU C version 3.4.0.
GGC-Heuristik: --param ggc-min-expand=73 --param ggc-min-heapsize=80715
t1.c:4: Fehler: in Konflikt stehende Typen für »a«
t1.c:1: Fehler: vorherige Deklaration von »a« war hier
t1.c:4: Fehler: in Konflikt stehende Typen für »a«
t1.c:1: Fehler: vorherige Deklaration von »a« war hier

Compilation exited abnormally with code 1 at Sun Apr 25 17:12:59


If you change the code to the following, it works:

void  a( int b, int c, int d ) __attribute__((regparm(3))) ;

void __attribute__((regparm(3))) a( int b, int c, int d ) 
{
  b = 2;
}
Comment 1 Andrew Pinski 2004-04-25 15:37:55 UTC
This is a dup of bug of 15095.

See <http://gcc.gnu.org/ml/gcc/2004-03/msg00039.html> for why this was changed.

*** This bug has been marked as a duplicate of 15095 ***