Bug 55221 - [regression] gcc-4.6-20121102/gcc/rtl.h:2105: error: 'FIRST_PSEUDO_REGISTER' undeclared here (not in a fnction)
Summary: [regression] gcc-4.6-20121102/gcc/rtl.h:2105: error: 'FIRST_PSEUDO_REGISTER' ...
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 4.6.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-06 12:55 UTC by Anton Shterenlikht
Modified: 2013-07-08 13:43 UTC (History)
1 user (show)

See Also:
Host:
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 Anton Shterenlikht 2012-11-06 12:55:52 UTC
FreeBSD 10.0-CURRENT #6 r237134 ia64

Updating from gcc-4.6.4.20120928 to 4.6.4.20121102

cc -c   -O2 -pipe -I/usr/local/include -fno-strict-aliasing -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I.././../gcc-4.6-20121102/gcc -I.././../gcc-4.6-20121102/gcc/build -I.././../gcc-4.6-20121102/gcc/../include -I.././../gcc-4.6-20121102/gcc/../libcpp/include -I/usr/local/include  -I.././../gcc-4.6-20121102/gcc/../libdecnumber -I.././../gcc-4.6-20121102/gcc/../libdecnumber/dpd -I../libdecnumber   -I/usr/local/include \
        -o build/rtl.o .././../gcc-4.6-20121102/gcc/rtl.c
In file included from .././../gcc-4.6-20121102/gcc/genflags.c:28:
.././../gcc-4.6-20121102/gcc/rtl.h:1989: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20121102/gcc/rtl.h:1990: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20121102/gcc/rtl.h:1991: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20121102/gcc/rtl.h:1992: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20121102/gcc/rtl.h:1992: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20121102/gcc/rtl.h:1993: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20121102/gcc/rtl.h:2105: error: 'FIRST_PSEUDO_REGISTER' undeclared here (not in a function)
Comment 1 Anton Shterenlikht 2012-11-08 09:49:08 UTC
On the same system gcc47 updated fine to gcc-4.7.3.20121103
Comment 2 Anton Shterenlikht 2012-11-09 10:40:41 UTC
On the same system I can build gcc-4.8.0.20121014
Comment 3 Anton Shterenlikht 2012-11-09 10:47:22 UTC
forgot to add, all these builds are with
a patch to unwind-ia64.h. For example, for 4.8
branch, the patch is (credit to gerald@freebsd.org):

Index: libgcc/config/ia64/unwind-ia64.h
===================================================================
--- libgcc/config/ia64/unwind-ia64.h
+++ libgcc/config/ia64/unwind-ia64.h    (working copy)
@@ -49,4 +49,7 @@
 extern struct unw_table_entry *
 _Unwind_FindTableEntry (void *pc, unw_word *segment_base,
                        unw_word *gp, struct unw_table_entry *ent)
-                       __attribute__ ((__visibility__ ("hidden")));
+#ifndef __FreeBSD__
+                       __attribute__ ((__visibility__ ("hidden")))
+#endif
+                       ;
Comment 4 Thierry Thomas 2013-01-28 17:19:12 UTC
Same error on FreeBSD 9.1-RELEASE #0 r243826 i386 and gcc-4.6-20130125:

cc -c   -O2 -pipe -march=prescott -I/usr/local/include -fno-strict-aliasing -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat   -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I.././../gcc-4.6-20130125/gcc -I.././../gcc-4.6-20130125/gcc/build -I.././../gcc-4.6-20130125/gcc/../include -I.././../gcc-4.6-20130125/gcc/../libcpp/include -I/usr/local/include  -I.././../gcc-4.6-20130125/gcc/../libdecnumber -I.././../gcc-4.6-20130125/gcc/../libdecnumber/dpd -I../libdecnumber   -I/usr/local/include \
        -o build/vec.o .././../gcc-4.6-20130125/gcc/vec.c
In file included from .././../gcc-4.6-20130125/gcc/genflags.c:29:
.././../gcc-4.6-20130125/gcc/rtl.h:1989: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1990: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1991: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1992: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1992: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1993: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:2105: error: 'FIRST_PSEUDO_REGISTER' undeclared here (not in a function)
.././../gcc-4.6-20130125/gcc/rtl.h:2456: warning: ISO C forbids forward references to 'enum' types
gmake[2]: *** [build/genflags.o] Erreur 1
gmake[2]: *** Attente des tâches non terminées....
In file included from .././../gcc-4.6-20130125/gcc/read-rtl.c:31:
.././../gcc-4.6-20130125/gcc/rtl.h:1989: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1990: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1991: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1992: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1992: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1993: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:2105: error: 'FIRST_PSEUDO_REGISTER' undeclared here (not in a function)
.././../gcc-4.6-20130125/gcc/rtl.h:2456: warning: ISO C forbids forward references to 'enum' types
gmake[2]: *** [build/read-rtl.o] Erreur 1
In file included from .././../gcc-4.6-20130125/gcc/rtl.c:34:
.././../gcc-4.6-20130125/gcc/rtl.h:1989: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1990: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1991: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1992: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1992: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:1993: warning: ISO C forbids forward references to 'enum' types
.././../gcc-4.6-20130125/gcc/rtl.h:2105: error: 'FIRST_PSEUDO_REGISTER' undeclared here (not in a function)
.././../gcc-4.6-20130125/gcc/rtl.h:2456: warning: ISO C forbids forward references to 'enum' types
gmake[2]: *** [build/rtl.o] Erreur 1
Comment 5 Anton Shterenlikht 2013-07-08 13:43:06 UTC
On FreeBSD 10.0-CURRENT #5 r252055,
with ports tree at r322480, I can built
lang/gcc, which is now 4.6:

# gcc46 --version
gcc46 (FreeBSD Ports Collection) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# pkg info -xo gcc-4.6
gcc-4.6.3                      lang/gcc
# 

This is with Gerald's patch:

# cat /usr/ports/lang/gcc/files/patch-unwind-ia64.h
2010-09-12  Gerald Pfeifer  <gerald@pfeifer.com>

       PR target/45650
       * config/ia64/unwind-ia64.h: Do not mark _Unwind_FindTableEntry
       hidden on FreeBSD.

Index: gcc/config/ia64/unwind-ia64.h
===================================================================
--- gcc/config/ia64/unwind-ia64.h       (revision 164211)
+++ gcc/config/ia64/unwind-ia64.h       (working copy)
@@ -40,4 +40,7 @@
 extern struct unw_table_entry *
 _Unwind_FindTableEntry (void *pc, unsigned long *segment_base,
                        unsigned long *gp, struct unw_table_entry *ent)
-                       __attribute__ ((__visibility__ ("hidden")));
+#ifndef __FreeBSD__
+                       __attribute__ ((__visibility__ ("hidden")))
+#endif
+                        ;
# 

I think it was fixed due to recent binutil fixes.

Since 4.7, 4.8, 4.9 all build fine on this platform,
I'm no longer interested in 4.6.4.
I'm therefore closing this PR.