This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/15132] New: __attribute__((regparm(?))) gives compiler error


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;
}

-- 
           Summary: __attribute__((regparm(?))) gives compiler error
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lars dot tetzlaff at gmx dot net
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15132


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]