Fedora development switch to GCC 4.1.0-RH prerelease

Jakub Jelinek jakub at redhat.com
Thu Dec 8 09:51:01 UTC 2005


Hi!

Some time between today and tomorrow we plan to switch Fedora development
primary compiler from GCC 4.0.2-RH to 4.1.0-RH prerelease.
We hope GCC 4.1.0 will be officially released in time for the
Fedora Core 5 release, but if we want to switch, we need to do it now
so that the compiler and packages built with it are sufficiently tested.

For (so far preliminary) list of changes see
http://gcc.gnu.org/gcc-4.1/changes.html
(though, safe builtins and -fstack-protector has been already provided
in GCC 4.0.2-RH).

GCC 4.1.0-RH rpms are based on snapshots from
svn://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_1-branch
This branch is a merge between the upstream
svn://gcc.gnu.org/svn/gcc/branches/gcc-4_1-branch
and
svn://gcc.gnu.org/svn/gcc/branches/gomp-20050608-branch
which adds (preliminary) OpenMP 2.5 support.

From our experience with building rawhide packages with this compiler,
we know about a few outstanding GCC bugs that affect them:
http://gcc.gnu.org/PR25240 (_Pragma parsing bug, prevents glibc build)
http://gcc.gnu.org/PR25221 (reload ICE when compiling GIMP on i?86)
http://gcc.gnu.org/PR25023 (ICE with pushw in struct by value passing
			    and -g on i586 kernel)
(of course there are many more regressions:
http://gcc.gnu.org/bugzilla/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=4.1&target_milestone=4.0.3&target_milestone=4.1.0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_status=WAITING&bug_status=REOPENED&priority=P1&priority=P2&priority=P3
but those weren't seen in rawhide packages (so far)).

The C++ frontend is again more strict then in GCC 4.0.x and rejects more
invalid code.  Problems seen in multiple packages include:

"extra qualification..." errors - http://gcc.gnu.org/PR16782

friend injection change -
struct A { typedef int S; friend void foo (S); friend void foo (); };
struct B { typedef int T; T t; void foo () { ::foo (t); } };
used to be accepted but is not any longer as ill-formed code.
To fix this, the function needs to be declared at namespace scope,
not just in a friend declaration.

methods defined in wrong namespaces -
struct A { void foo (); };
namespace { void A::foo () {} };
This is ill-formed, the definition needs to be done in the namespace
containing the class.

extern int bar (const char *);
template <class T> struct A { void bar (const T &) { } };
template <class T> struct B : public A <T>
{ B () : x (0) { } void baz () { bar (this->x); } const T x; };
void foo () { B <double> b; b.baz (); }
This is ill-formed, as bar is not template dependent and so it is looked
up and found in the global namespace.  The fix is to make the call
template dependent, e.g. by using this->bar (this->x);

relying on some C++ STL headers to include <cassert> -
some of the headers no longer include <cassert> (on purpose),
if you see this, just add explicit #include <cassert>.

Also packages that use -Werror might need some changes, because some
new warnings were added (especially strict aliasing warnings in C++)
and with -Werror that means the package doesn't build any longer.

Please report any internal compiler errors as well as other problems
where GCC is on fault (and that aren't in the above list) to
http://bugzilla.redhat.com/bugzilla/ as usually, ideally the /tmp/cc*.out
preprocessed source GCC driver creates for ICEs, or by manually
preprocessing the source, verifying the bug is still reproduceable and
also mentioning exact compiler version, architecture and all compiler
options needed to reproduce it.

If you want to test OpenMP, use -fopenmp option.

	Jakub
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20051208/db36bf4c/attachment.sig>


More information about the fedora-devel-list mailing list